@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
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Module } from "@nestjs/common";
8
8
  import { AdminModule } from "../admin/admin.module.js";
9
9
  import { AgentsModule } from "../agents/agents.module.js";
10
+ import { AutomationsModule } from "../automations/automations.module.js";
10
11
  import { BackgroundModule } from "../background/background.module.js";
11
12
  import { AppearanceModule } from "../catalog/appearance.service.js";
12
13
  import { CatalogModule } from "../catalog/catalog.module.js";
@@ -16,13 +17,13 @@ import { DevicesModule } from "../devices/devices.module.js";
16
17
  import { EvalsModule } from "../evals/evals.module.js";
17
18
  import { ExtensionsModule } from "../extensions/extensions.module.js";
18
19
  import { FilesModule } from "../files/files.module.js";
20
+ import { LibraryReadModule } from "../files/library-read.module.js";
19
21
  import { IdentityModule } from "../identity/identity.module.js";
20
22
  import { InboxModule } from "../inbox/inbox.module.js";
21
23
  import { ModelsModule } from "../models/models.module.js";
22
24
  import { OrgsModule } from "../orgs/orgs.module.js";
23
25
  import { PushModule } from "../push/push.module.js";
24
26
  import { ProvidersModule } from "../runtime/providers.js";
25
- import { SchedulesModule } from "../schedules/schedules.module.js";
26
27
  import { SetupModule } from "../setup/setup.module.js";
27
28
  import { SharesModule } from "../shares/shares.module.js";
28
29
  import { SkillsModule } from "../skills/skills.module.js";
@@ -35,6 +36,7 @@ import { AgentSkillsOperations } from "./ops/agent-skills.ops.js";
35
36
  import { AgentTemplatesOperations } from "./ops/agent-templates.ops.js";
36
37
  import { AgentsOperations } from "./ops/agents.ops.js";
37
38
  import { ApprovalsOperations } from "./ops/approvals.ops.js";
39
+ import { AutomationsOperations } from "./ops/automations.ops.js";
38
40
  import { BackgroundOperations } from "./ops/background.ops.js";
39
41
  import { CatalogAdminOperations } from "./ops/catalog-admin.ops.js";
40
42
  import { ChannelsOperations } from "./ops/channels.ops.js";
@@ -45,6 +47,7 @@ import { DevicesOperations } from "./ops/devices.ops.js";
45
47
  import { EvalsOperations } from "./ops/evals.ops.js";
46
48
  import { ExtensionsOperations } from "./ops/extensions.ops.js";
47
49
  import { ExtensionsAdminOperations } from "./ops/extensions-admin.ops.js";
50
+ import { FilesOperations } from "./ops/files.ops.js";
48
51
  import { InboxOperations } from "./ops/inbox.ops.js";
49
52
  import { MarketplacesOperations } from "./ops/marketplaces.ops.js";
50
53
  import { ModelsOperations } from "./ops/models.ops.js";
@@ -57,7 +60,6 @@ import { PlatformIconsOperations } from "./ops/platform-icons.ops.js";
57
60
  import { PluginsOperations } from "./ops/plugins.ops.js";
58
61
  import { PreviewersOperations } from "./ops/previewers.ops.js";
59
62
  import { RequestsOperations } from "./ops/requests.ops.js";
60
- import { SchedulesOperations } from "./ops/schedules.ops.js";
61
63
  import { SetupOperations } from "./ops/setup.ops.js";
62
64
  import { SharesOperations } from "./ops/shares.ops.js";
63
65
  import { SkillsOperations } from "./ops/skills.ops.js";
@@ -110,14 +112,16 @@ export const PLATFORM_OPERATION_PROVIDERS = [
110
112
  UiOperations,
111
113
  // every org's agents and connectors, the conversation org's through the tool (spec §4.5)
112
114
  AdminItemsOperations,
113
- // scheduled tasks (scheduled tasks spec §10)
114
- SchedulesOperations,
115
+ // automations (scheduled tasks spec §10)
116
+ AutomationsOperations,
115
117
  // dead outbox rows (transactional outbox spec §3.4)
116
118
  OutboxOperations,
117
119
  // shared file links (file sharing spec §10)
118
120
  SharesOperations,
119
121
  // the platform icon (mobile layout spec §10.2.1)
120
122
  PlatformIconsOperations,
123
+ // the person's file library (file library spec §6)
124
+ FilesOperations,
121
125
  ];
122
126
  /**
123
127
  * The `Platform` tool's operations (ruling P2): one provider per domain, each registering its
@@ -148,9 +152,10 @@ PlatformOpsModule = __decorate([
148
152
  DevicesModule,
149
153
  BackgroundModule,
150
154
  FilesModule,
155
+ LibraryReadModule,
151
156
  ThemesModule,
152
157
  SetupModule,
153
- SchedulesModule,
158
+ AutomationsModule,
154
159
  SharesModule,
155
160
  PushModule,
156
161
  ],
@@ -8,6 +8,7 @@ import { OUTBOX_DEAD_ROUTES } from "../admin/outbox-dead.schemas.js";
8
8
  import { OVERVIEW_ROUTES } from "../admin/overview.schemas.js";
9
9
  import { AGENT_ROUTES } from "../agents/agents.schemas.js";
10
10
  import { AGENT_TEMPLATE_ROUTES } from "../agents/templates.schemas.js";
11
+ import { AUTOMATION_ROUTES } from "../automations/automations.schemas.js";
11
12
  import { BACKGROUND_ROUTES } from "../background/background.schemas.js";
12
13
  import { ADMIN_CATALOG_ROUTES } from "../catalog/admin-catalog.schemas.js";
13
14
  import { APPEARANCE_ROUTES } from "../catalog/appearance.schemas.js";
@@ -21,13 +22,13 @@ import { CONVERSATION_ROUTES } from "../conversations/conversations.schemas.js";
21
22
  import { DEVICE_ROUTES } from "../devices/devices.schemas.js";
22
23
  import { EVAL_ROUTES } from "../evals/evals.schemas.js";
23
24
  import { EXTENSION_POINT_ROUTES } from "../extensions/point-defaults.schemas.js";
25
+ import { FILE_ROUTES } from "../files/library.schemas.js";
24
26
  import { FILE_PREVIEWER_ROUTES } from "../files/previewers.schemas.js";
25
27
  import { ME_ROUTES } from "../identity/me.schemas.js";
26
28
  import { INBOX_ROUTES } from "../inbox/inbox.schemas.js";
27
29
  import { ORG_MODEL_ROUTES } from "../models/org-models.schemas.js";
28
30
  import { ORG_ROUTES, ORG_SETTINGS_ROUTES } from "../orgs/orgs.schemas.js";
29
31
  import { PUSH_ROUTES } from "../push/push.schemas.js";
30
- import { SCHEDULE_ROUTES } from "../schedules/schedules.schemas.js";
31
32
  import { SETUP_CHECK_ROUTES } from "../setup/setup-checks.schemas.js";
32
33
  import { SETUP_GUIDE_ROUTES } from "../setup/setup-guides.schemas.js";
33
34
  import { SHARE_ROUTES } from "../shares/shares.schemas.js";
@@ -92,8 +93,8 @@ export const ROUTE_SCHEMAS = [
92
93
  ...UI_ROUTES,
93
94
  // every org's agents and connectors (admin agents and connectors spec §4)
94
95
  ...ADMIN_ITEM_ROUTES,
95
- // scheduled tasks (scheduled tasks spec §10)
96
- ...SCHEDULE_ROUTES,
96
+ // automations (scheduled tasks spec §10)
97
+ ...AUTOMATION_ROUTES,
97
98
  // the admin overview and the platform-level audit log (admin overview spec §5.2)
98
99
  ...OVERVIEW_ROUTES,
99
100
  ...AUDIT_ROUTES,
@@ -104,4 +105,6 @@ export const ROUTE_SCHEMAS = [
104
105
  ...LOGIN_SOURCE_ROUTES,
105
106
  // shares of conversation files (file sharing spec §10)
106
107
  ...SHARE_ROUTES,
108
+ // the person's file library (file library spec §6)
109
+ ...FILE_ROUTES,
107
110
  ];
@@ -12,8 +12,8 @@ export declare const PUSH_FANOUT_JOB = "push-fanout";
12
12
  export declare const PUSH_DELIVER_JOB = "push-deliver";
13
13
  /** The event id of a conversation event (`conv-<conversationId>-<seq>`). */
14
14
  export declare const conversationEventId: (conversationId: string, seq: number) => string;
15
- /** The event id of a scheduled task run's settle (`sched-<taskRunId>`). */
16
- export declare const scheduleRunEventId: (taskRunId: string) => string;
15
+ /** The event id of an automation run's settle (`automation-<taskRunId>`). */
16
+ export declare const automationRunEventId: (taskRunId: string) => string;
17
17
  /** One fanout per event: `push-fanout-<eventId>`. */
18
18
  export declare const pushFanoutJobId: (eventId: string) => string;
19
19
  /** One delivery per event and registration: `push-<eventId>-<registrationId>`. */
@@ -26,7 +26,7 @@ export type PushFanoutData = {
26
26
  conversationId: string;
27
27
  seq: number;
28
28
  } | {
29
- kind: "schedule";
29
+ kind: "automation";
30
30
  taskRunId: string;
31
31
  };
32
32
  };
package/dist/push/jobs.js CHANGED
@@ -11,8 +11,8 @@ export const PUSH_FANOUT_JOB = "push-fanout";
11
11
  export const PUSH_DELIVER_JOB = "push-deliver";
12
12
  /** The event id of a conversation event (`conv-<conversationId>-<seq>`). */
13
13
  export const conversationEventId = (conversationId, seq) => `conv-${conversationId}-${seq}`;
14
- /** The event id of a scheduled task run's settle (`sched-<taskRunId>`). */
15
- export const scheduleRunEventId = (taskRunId) => `sched-${taskRunId}`;
14
+ /** The event id of an automation run's settle (`automation-<taskRunId>`). */
15
+ export const automationRunEventId = (taskRunId) => `automation-${taskRunId}`;
16
16
  /** One fanout per event: `push-fanout-<eventId>`. */
17
17
  export const pushFanoutJobId = (eventId) => `push-fanout-${eventId}`;
18
18
  /** One delivery per event and registration: `push-<eventId>-<registrationId>`. */
@@ -31,7 +31,7 @@ let PushPreferencesService = class PushPreferencesService {
31
31
  .select(["category", "enabled"])
32
32
  .where("account_id", "=", accountId)
33
33
  .execute();
34
- const out = { waiting: true, replies: true, tasks: true, schedules: true };
34
+ const out = { waiting: true, replies: true, tasks: true, automations: true };
35
35
  for (const r of rows)
36
36
  out[r.category] = r.enabled;
37
37
  return out;
@@ -20,13 +20,13 @@ export declare class PushOwed {
20
20
  */
21
21
  oweIn(conversationId: string, orgId: string, kind: string, events: readonly ConversationEvent[]): Promise<void>;
22
22
  /**
23
- * The fanout of a scheduled task run's settle (completed or failed), in the caller's
23
+ * The fanout of an automation run's settle (completed or failed), in the caller's
24
24
  * transaction.
25
25
  */
26
- oweScheduleRun(taskRunId: string, orgId: string): Promise<void>;
26
+ oweAutomationRun(taskRunId: string, orgId: string): Promise<void>;
27
27
  }
28
28
  /**
29
- * {@link PushOwed}: infra and the extension registry only, so the event log and the scheduled task
29
+ * {@link PushOwed}: infra and the extension registry only, so the event log and the automation
30
30
  * run tracker import it without a cycle.
31
31
  */
32
32
  export declare class PushOwedModule {
@@ -11,7 +11,7 @@ import { Inject, Injectable, Module } from "@nestjs/common";
11
11
  import { TransactionHost } from "../infra/database/transaction-host.js";
12
12
  import { Transactional } from "../infra/database/transactional.decorator.js";
13
13
  import { OutboxService } from "../infra/outbox/outbox.service.js";
14
- import { conversationEventId, PUSH_FANOUT_JOB, PUSH_QUEUE, pushFanoutJobId, scheduleRunEventId, } from "./jobs.js";
14
+ import { automationRunEventId, conversationEventId, PUSH_FANOUT_JOB, PUSH_QUEUE, pushFanoutJobId, } from "./jobs.js";
15
15
  import { PushHostModule, PushProviderHost } from "./provider-host.js";
16
16
  import { pushTriggerOf } from "./triggers.js";
17
17
  /**
@@ -50,13 +50,13 @@ let PushOwed = class PushOwed {
50
50
  })));
51
51
  }
52
52
  /**
53
- * The fanout of a scheduled task run's settle (completed or failed), in the caller's
53
+ * The fanout of an automation run's settle (completed or failed), in the caller's
54
54
  * transaction.
55
55
  */
56
- async oweScheduleRun(taskRunId, orgId) {
56
+ async oweAutomationRun(taskRunId, orgId) {
57
57
  if (!this.host.any())
58
58
  return;
59
- await this.outbox.add(fanoutJob(scheduleRunEventId(taskRunId), orgId, { kind: "schedule", taskRunId }));
59
+ await this.outbox.add(fanoutJob(automationRunEventId(taskRunId), orgId, { kind: "automation", taskRunId }));
60
60
  }
61
61
  };
62
62
  __decorate([
@@ -64,7 +64,7 @@ __decorate([
64
64
  ], PushOwed.prototype, "oweIn", null);
65
65
  __decorate([
66
66
  Transactional({ propagation: "mandatory" })
67
- ], PushOwed.prototype, "oweScheduleRun", null);
67
+ ], PushOwed.prototype, "oweAutomationRun", null);
68
68
  PushOwed = __decorate([
69
69
  Injectable(),
70
70
  __param(0, Inject(OutboxService)),
@@ -82,7 +82,7 @@ function fanoutJob(eventId, orgId, source) {
82
82
  };
83
83
  }
84
84
  /**
85
- * {@link PushOwed}: infra and the extension registry only, so the event log and the scheduled task
85
+ * {@link PushOwed}: infra and the extension registry only, so the event log and the automation
86
86
  * run tracker import it without a cycle.
87
87
  */
88
88
  let PushOwedModule = class PushOwedModule {
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import type { RouteSchemas } from "../platform/route-schemas.js";
3
3
  /** The push categories a person switches (mobile app spec §9.4); an absent preference is on. */
4
- export declare const PUSH_CATEGORIES: readonly ["waiting", "replies", "tasks", "schedules"];
4
+ export declare const PUSH_CATEGORIES: readonly ["waiting", "replies", "tasks", "automations"];
5
5
  export type PushCategory = (typeof PUSH_CATEGORIES)[number];
6
6
  /**
7
7
  * `POST /me/push-registrations`: what the app's shell returns from `push@1.register()`, plus the
@@ -64,7 +64,7 @@ export declare const PushPreferencesSchema: z.ZodObject<{
64
64
  waiting: z.ZodBoolean;
65
65
  replies: z.ZodBoolean;
66
66
  tasks: z.ZodBoolean;
67
- schedules: z.ZodBoolean;
67
+ automations: z.ZodBoolean;
68
68
  }, z.core.$strict>;
69
69
  export type PushPreferences = z.infer<typeof PushPreferencesSchema>;
70
70
  /** `PUT /me/push-preferences`: the switches to change, at least one. */
@@ -72,14 +72,14 @@ export declare const PushPreferencesPatchSchema: z.ZodObject<{
72
72
  waiting: z.ZodOptional<z.ZodBoolean>;
73
73
  replies: z.ZodOptional<z.ZodBoolean>;
74
74
  tasks: z.ZodOptional<z.ZodBoolean>;
75
- schedules: z.ZodOptional<z.ZodBoolean>;
75
+ automations: z.ZodOptional<z.ZodBoolean>;
76
76
  }, z.core.$strict>;
77
77
  export type PushPreferencesPatch = z.infer<typeof PushPreferencesPatchSchema>;
78
78
  declare const PushPreferencesPatchDto_base: import("../infra/validation/create-zod-dto.js").ZodDtoClass<z.ZodObject<{
79
79
  waiting: z.ZodOptional<z.ZodBoolean>;
80
80
  replies: z.ZodOptional<z.ZodBoolean>;
81
81
  tasks: z.ZodOptional<z.ZodBoolean>;
82
- schedules: z.ZodOptional<z.ZodBoolean>;
82
+ automations: z.ZodOptional<z.ZodBoolean>;
83
83
  }, z.core.$strict>>;
84
84
  export declare class PushPreferencesPatchDto extends PushPreferencesPatchDto_base {
85
85
  }
@@ -2,7 +2,7 @@ import { PUSH_LIMITS } from "@capybara-hq/plugin-sdk";
2
2
  import { z } from "zod";
3
3
  import { createZodDto } from "../infra/validation/create-zod-dto.js";
4
4
  /** The push categories a person switches (mobile app spec §9.4); an absent preference is on. */
5
- export const PUSH_CATEGORIES = ["waiting", "replies", "tasks", "schedules"];
5
+ export const PUSH_CATEGORIES = ["waiting", "replies", "tasks", "automations"];
6
6
  /**
7
7
  * `POST /me/push-registrations`: what the app's shell returns from `push@1.register()`, plus the
8
8
  * person's locale and a device name. The token is sealed at rest and never echoed.
@@ -39,11 +39,11 @@ export const PushPreferencesSchema = z
39
39
  waiting: z.boolean(),
40
40
  replies: z.boolean(),
41
41
  tasks: z.boolean(),
42
- schedules: z.boolean(),
42
+ automations: z.boolean(),
43
43
  })
44
44
  .strict();
45
45
  /** `PUT /me/push-preferences`: the switches to change, at least one. */
46
- export const PushPreferencesPatchSchema = PushPreferencesSchema.partial().refine((p) => Object.values(p).some((v) => v !== undefined), { message: "give at least one of waiting, replies, tasks, schedules" });
46
+ export const PushPreferencesPatchSchema = PushPreferencesSchema.partial().refine((p) => Object.values(p).some((v) => v !== undefined), { message: "give at least one of waiting, replies, tasks, automations" });
47
47
  export class PushPreferencesPatchDto extends createZodDto(PushPreferencesPatchSchema, "PushPreferencesPatch") {
48
48
  }
49
49
  /** The push routes the Platform operations mirror (`check:platform-ops` keys). */
@@ -15,15 +15,15 @@ export type ResolvedRecipients = Omit<ResolvedPush, "eventId">;
15
15
  * while it is still `pending`; a question only while pending; both, and a connect request, go to
16
16
  * the run's trigger account (an approval assigned to someone goes to that person);
17
17
  * - `replies`: chat conversations only, to the conversation's owner, never for a run serving a
18
- * scheduled task (that pushes as `schedules`);
18
+ * automation (that pushes as `automations`);
19
19
  * - `tasks`: the root conversation's owner;
20
- * - `schedules`: the task's owner, for a task run `completed` or `failed` of a task not deleted;
20
+ * - `automations`: the task's owner, for a task run `completed` or `failed` of a task not deleted;
21
21
  * - eval conversations (a sub-agent under an eval root too) and deleted conversations never push;
22
22
  * - an escalated approval whose run is gone pushes nothing (its initiator is unknown).
23
23
  *
24
24
  * The path carries the org (`/chat/<root>?org=<orgId>`, `&subagent=<child>` for an event of a
25
- * sub-agent's log; a schedule run without a conversation opens `/inbox?org=<orgId>`), the thread
26
- * is the root conversation (`schedule-<taskId>` for a schedule), the title the root's agent name
25
+ * sub-agent's log; an automation run without a conversation opens `/inbox?org=<orgId>`), the thread
26
+ * is the root conversation (`automation-<taskId>` for an automation), the title the root's agent name
27
27
  * (the task's name).
28
28
  */
29
29
  export declare function resolveRecipients(db: KernelSchemaDb, source: PushFanoutData["source"]): Promise<ResolvedRecipients | null>;
@@ -13,20 +13,20 @@ import { pushTriggerOf } from "./triggers.js";
13
13
  * while it is still `pending`; a question only while pending; both, and a connect request, go to
14
14
  * the run's trigger account (an approval assigned to someone goes to that person);
15
15
  * - `replies`: chat conversations only, to the conversation's owner, never for a run serving a
16
- * scheduled task (that pushes as `schedules`);
16
+ * automation (that pushes as `automations`);
17
17
  * - `tasks`: the root conversation's owner;
18
- * - `schedules`: the task's owner, for a task run `completed` or `failed` of a task not deleted;
18
+ * - `automations`: the task's owner, for a task run `completed` or `failed` of a task not deleted;
19
19
  * - eval conversations (a sub-agent under an eval root too) and deleted conversations never push;
20
20
  * - an escalated approval whose run is gone pushes nothing (its initiator is unknown).
21
21
  *
22
22
  * The path carries the org (`/chat/<root>?org=<orgId>`, `&subagent=<child>` for an event of a
23
- * sub-agent's log; a schedule run without a conversation opens `/inbox?org=<orgId>`), the thread
24
- * is the root conversation (`schedule-<taskId>` for a schedule), the title the root's agent name
23
+ * sub-agent's log; an automation run without a conversation opens `/inbox?org=<orgId>`), the thread
24
+ * is the root conversation (`automation-<taskId>` for an automation), the title the root's agent name
25
25
  * (the task's name).
26
26
  */
27
27
  export async function resolveRecipients(db, source) {
28
- return source.kind === "schedule"
29
- ? resolveSchedule(db, source.taskRunId)
28
+ return source.kind === "automation"
29
+ ? resolveAutomation(db, source.taskRunId)
30
30
  : resolveConversation(db, source.conversationId, source.seq);
31
31
  }
32
32
  async function resolveConversation(db, conversationId, seq) {
@@ -132,11 +132,11 @@ async function resolveConversation(db, conversationId, seq) {
132
132
  return null;
133
133
  const run = await db
134
134
  .selectFrom("runs")
135
- .select("scheduled_task_run_id")
135
+ .select("automation_run_id")
136
136
  .where("id", "=", event.run_id)
137
137
  .where("conversation_id", "=", conversationId)
138
138
  .executeTakeFirst();
139
- if (!run || run.scheduled_task_run_id !== null)
139
+ if (!run || run.automation_run_id !== null)
140
140
  return null;
141
141
  candidates = [owner];
142
142
  break;
@@ -168,24 +168,24 @@ async function resolveConversation(db, conversationId, seq) {
168
168
  text: trigger.text,
169
169
  };
170
170
  }
171
- async function resolveSchedule(db, taskRunId) {
171
+ async function resolveAutomation(db, taskRunId) {
172
172
  // org-filter: taskRunId comes from the kernel-written push fan-out job; this read learns the
173
173
  // run's org (checked against its task's below), which every later read filters by
174
174
  const row = await db
175
- .selectFrom("scheduled_task_runs")
176
- .innerJoin("scheduled_tasks", "scheduled_tasks.id", "scheduled_task_runs.task_id")
175
+ .selectFrom("automation_runs")
176
+ .innerJoin("automations", "automations.id", "automation_runs.automation_id")
177
177
  .select([
178
- "scheduled_task_runs.org_id",
179
- "scheduled_task_runs.status",
180
- "scheduled_task_runs.conversation_id",
181
- "scheduled_tasks.id as task_id",
182
- "scheduled_tasks.org_id as task_org_id",
183
- "scheduled_tasks.account_id",
184
- "scheduled_tasks.name",
178
+ "automation_runs.org_id",
179
+ "automation_runs.status",
180
+ "automation_runs.conversation_id",
181
+ "automations.id as automation_id",
182
+ "automations.org_id as task_org_id",
183
+ "automations.account_id",
184
+ "automations.name",
185
185
  ])
186
- .where("scheduled_task_runs.id", "=", taskRunId)
186
+ .where("automation_runs.id", "=", taskRunId)
187
187
  // a deleted task pushes nothing
188
- .where("scheduled_tasks.deleted_at", "is", null)
188
+ .where("automations.deleted_at", "is", null)
189
189
  .executeTakeFirst();
190
190
  if (!row || row.org_id !== row.task_org_id)
191
191
  return null;
@@ -210,12 +210,12 @@ async function resolveSchedule(db, taskRunId) {
210
210
  return {
211
211
  orgId,
212
212
  accountIds,
213
- category: "schedules",
213
+ category: "automations",
214
214
  path: conv === undefined ? `/inbox?org=${org}` : `/chat/${row.conversation_id}?org=${org}`,
215
- threadId: `schedule-${row.task_id}`,
215
+ threadId: `automation-${row.automation_id}`,
216
216
  title: row.name,
217
217
  conversationTitle: conv?.title ?? null,
218
- text: row.status === "completed" ? "scheduleRan" : "scheduleFailed",
218
+ text: row.status === "completed" ? "automationRan" : "automationFailed",
219
219
  };
220
220
  }
221
221
  const optional = (id) => (id === null ? [] : [id]);
@@ -6,16 +6,16 @@ export declare const PUSH_TEXT_KEYS: readonly PushTextKey[];
6
6
  export declare function pushText(key: PushTextKey, locale: "zh" | "en"): string;
7
7
  /** An event's push as the fanout resolved it (`recipients.ts`), with the event id. */
8
8
  export interface ResolvedPush {
9
- /** `conv-<conversationId>-<seq>` or `sched-<taskRunId>`: the message's collapse id. */
9
+ /** `conv-<conversationId>-<seq>` or `automation-<taskRunId>`: the message's collapse id. */
10
10
  eventId: string;
11
11
  orgId: string;
12
12
  accountIds: string[];
13
13
  category: PushCategory;
14
14
  /** In-app path with `?org=` (plan decision 8). */
15
15
  path: string;
16
- /** The root conversation id, or `schedule-<taskId>`. */
16
+ /** The root conversation id, or `automation-<taskId>`. */
17
17
  threadId: string;
18
- /** The agent's display name (the task's name for a schedule). */
18
+ /** The agent's display name (the task's name for an automation). */
19
19
  title: string;
20
20
  /** Shown only with `push.previews: "titles"`. */
21
21
  conversationTitle: string | null;
@@ -8,8 +8,8 @@ const PUSH_TEXTS = {
8
8
  runFailed: { en: "failed", zh: "运行失败" },
9
9
  backgroundFinished: { en: "a background task ended", zh: "后台任务已结束" },
10
10
  subagentFinished: { en: "a sub-agent finished", zh: "子智能体已完成" },
11
- scheduleRan: { en: "your scheduled task ran", zh: "你的定时任务已运行" },
12
- scheduleFailed: { en: "your scheduled task failed", zh: "你的定时任务运行失败" },
11
+ automationRan: { en: "your automation ran", zh: "你的自动化已运行" },
12
+ automationFailed: { en: "your automation failed", zh: "你的自动化运行失败" },
13
13
  };
14
14
  /** Every push text key. */
15
15
  export const PUSH_TEXT_KEYS = Object.keys(PUSH_TEXTS);
@@ -2,7 +2,7 @@ import type { ConversationEvent } from "../conversations/events.js";
2
2
  import type { PushCategory } from "./push.schemas.js";
3
3
  export type { PushCategory } from "./push.schemas.js";
4
4
  /** The fixed sentences of a push body (`texts.ts` holds the copy). */
5
- export type PushTextKey = "approval" | "question" | "connect" | "runFinished" | "runFailed" | "backgroundFinished" | "subagentFinished" | "scheduleRan" | "scheduleFailed";
5
+ export type PushTextKey = "approval" | "question" | "connect" | "runFinished" | "runFailed" | "backgroundFinished" | "subagentFinished" | "automationRan" | "automationFailed";
6
6
  /** What one event pushes: its category (the person's switch) and its sentence. */
7
7
  export interface PushTrigger {
8
8
  category: PushCategory;
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  var WorkerModule_1;
8
8
  import { Module } from "@nestjs/common";
9
+ import { AutomationFireModule } from "../automations/fire.js";
9
10
  import { BackgroundModule } from "../background/background.module.js";
10
11
  import { BackgroundTaskPollJob } from "../background/poll.job.js";
11
12
  import { RetireLegacyTasksJob } from "../background/retire-legacy-tasks.job.js";
@@ -28,6 +29,11 @@ import { EvalWorkersModule } from "../evals/evals.module.js";
28
29
  import { ExtensionsModule } from "../extensions/extensions.module.js";
29
30
  import { PluginsReconcileJob } from "../extensions/lifecycle.js";
30
31
  import { LifecycleHookWorkersModule } from "../extensions/lifecycle-hooks.js";
32
+ import { BlobSweepJob } from "../files/blob-sweep.job.js";
33
+ import { FileDraftCleanupJob } from "../files/draft-cleanup.job.js";
34
+ import { FileLibraryKickoffJob } from "../files/hash-job.js";
35
+ import { LibraryFilesModule } from "../files/library.module.js";
36
+ import { FileLibraryJobsModule } from "../files/library-jobs.module.js";
31
37
  import { AccountAvatarCleanupJob } from "../identity/account-avatars.service.js";
32
38
  import { IdentityModule } from "../identity/identity.module.js";
33
39
  import { InitialPasswordCleanupJob } from "../identity/initial-passwords.job.js";
@@ -45,7 +51,6 @@ import { RuntimeModule } from "../runtime/runtime.module.js";
45
51
  import { UsageReportModule } from "../runtime/usage-report.js";
46
52
  import { SandboxSweepJobs } from "../sandbox/jobs.js";
47
53
  import { SandboxModule } from "../sandbox/sandbox.module.js";
48
- import { ScheduledTaskFireModule } from "../schedules/fire.js";
49
54
  import { ShareObjectsModule } from "../shares/share-objects.js";
50
55
  import { ShareSweepJob } from "../shares/sweep.job.js";
51
56
  import { StoragePurgeJob } from "../storage/purge.js";
@@ -96,6 +101,10 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
96
101
  TitlesModule,
97
102
  PromptSuggestionsModule,
98
103
  AttachmentsModule,
104
+ // the hourly cleanup of expired uploads and drafts
105
+ LibraryFilesModule,
106
+ // the hashing and catch-up copy the kickoff owes
107
+ FileLibraryJobsModule,
99
108
  IdentityModule,
100
109
  StorageModule,
101
110
  SandboxModule,
@@ -107,9 +116,9 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
107
116
  OrgLockModule,
108
117
  ExtensionsModule,
109
118
  ChannelsModule,
110
- // the scheduled task scanner (`@LockedCron`) and the fire job's body
111
- ScheduledTaskFireModule,
112
- // the share snapshots the daily share sweep frees
119
+ // the automation scanner (`@LockedCron`) and the fire job's body
120
+ AutomationFireModule,
121
+ // the legacy share snapshot deletions the maintenance processor still runs
113
122
  ShareObjectsModule,
114
123
  // the owed conversation notices the sweep delivers
115
124
  ConversationNoticesModule,
@@ -118,6 +127,11 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
118
127
  // the one repair of a run nobody runs (transactional outbox spec §8.3)
119
128
  RunOrphanCheck,
120
129
  AttachmentCleanupJob,
130
+ // expired uploads and composer drafts of the file library (file library spec §3)
131
+ FileDraftCleanupJob,
132
+ // the daily blob sweep and the hourly kickoff of hashing and the catch-up copy (§7, §9)
133
+ BlobSweepJob,
134
+ FileLibraryKickoffJob,
121
135
  StoragePurgeJob,
122
136
  SandboxSweepJobs,
123
137
  LegacySandboxCleanupJob,
@@ -1,5 +1,5 @@
1
1
  import type { KernelSchemaDb } from "../db/kernel-schema.js";
2
- import { type CompactionSettings, SettingsService } from "../identity/settings.js";
2
+ import { type CompactionSettings, type PromptCacheSettings, SettingsService } from "../identity/settings.js";
3
3
  import { KernelDb } from "../infra/database/kernel-db.js";
4
4
  export { COMPACTION_SETTINGS, type CompactionSettings, effectiveCompactionSettings, } from "../identity/settings.js";
5
5
  /**
@@ -9,6 +9,16 @@ export { COMPACTION_SETTINGS, type CompactionSettings, effectiveCompactionSettin
9
9
  * job), which would otherwise import the runtime module in a cycle.
10
10
  */
11
11
  export declare function resolveCompactionSettings(settings: Pick<SettingsService, "get">, db: KernelSchemaDb, orgId: string): Promise<CompactionSettings>;
12
+ /** The settings a model step reads: compaction and the prompt cache, from one read of each source. */
13
+ export interface StepSettings {
14
+ compaction: CompactionSettings;
15
+ promptCache: PromptCacheSettings;
16
+ }
17
+ /**
18
+ * The effective compaction and prompt cache settings for `orgId` (org override > platform setting
19
+ * > built-in default), with one read of the platform settings and one of the org row.
20
+ */
21
+ export declare function resolveStepSettings(settings: Pick<SettingsService, "get">, db: KernelSchemaDb, orgId: string): Promise<StepSettings>;
12
22
  /**
13
23
  * The compaction settings in effect for one organization (context compaction spec §4.8):
14
24
  * the organization's override over the platform's stored settings, which carry the built-in
@@ -21,4 +31,6 @@ export declare class CompactionSettingsService {
21
31
  constructor(settings: Pick<SettingsService, "get">, db: KernelDb);
22
32
  /** The effective settings for `orgId`: org override > platform setting > built-in default. */
23
33
  resolve(orgId: string): Promise<CompactionSettings>;
34
+ /** What a model step reads for `orgId`: the compaction and prompt cache settings, one read each. */
35
+ resolveStep(orgId: string): Promise<StepSettings>;
24
36
  }
@@ -8,7 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
8
  return function (target, key) { decorator(target, key, paramIndex); }
9
9
  };
10
10
  import { Inject, Injectable } from "@nestjs/common";
11
- import { effectiveCompactionSettings, SettingsService, } from "../identity/settings.js";
11
+ import { effectiveCompactionSettings, effectivePromptCacheSettings, SettingsService, } from "../identity/settings.js";
12
12
  import { KernelDb } from "../infra/database/kernel-db.js";
13
13
  import { readOrgSettings } from "../orgs/settings.service.js";
14
14
  export { COMPACTION_SETTINGS, effectiveCompactionSettings, } from "../identity/settings.js";
@@ -22,6 +22,17 @@ export async function resolveCompactionSettings(settings, db, orgId) {
22
22
  const [platform, org] = await Promise.all([settings.get(), readOrgSettings(db, orgId)]);
23
23
  return effectiveCompactionSettings(platform.compaction, org.compaction);
24
24
  }
25
+ /**
26
+ * The effective compaction and prompt cache settings for `orgId` (org override > platform setting
27
+ * > built-in default), with one read of the platform settings and one of the org row.
28
+ */
29
+ export async function resolveStepSettings(settings, db, orgId) {
30
+ const [platform, org] = await Promise.all([settings.get(), readOrgSettings(db, orgId)]);
31
+ return {
32
+ compaction: effectiveCompactionSettings(platform.compaction, org.compaction),
33
+ promptCache: effectivePromptCacheSettings(platform.promptCache, org.promptCache),
34
+ };
35
+ }
25
36
  /**
26
37
  * The compaction settings in effect for one organization (context compaction spec §4.8):
27
38
  * the organization's override over the platform's stored settings, which carry the built-in
@@ -39,6 +50,10 @@ let CompactionSettingsService = class CompactionSettingsService {
39
50
  resolve(orgId) {
40
51
  return resolveCompactionSettings(this.settings, this.db.db, orgId);
41
52
  }
53
+ /** What a model step reads for `orgId`: the compaction and prompt cache settings, one read each. */
54
+ resolveStep(orgId) {
55
+ return resolveStepSettings(this.settings, this.db.db, orgId);
56
+ }
42
57
  };
43
58
  CompactionSettingsService = __decorate([
44
59
  Injectable(),
@@ -37,7 +37,9 @@ export interface ForcedCompaction {
37
37
  * settings) and calls the shared {@link runCompaction} with `force: true`: the trigger,
38
38
  * `enabled: false` and the failure backoff are bypassed, the compaction plan is still required, with
39
39
  * the manual rule (`manual: true`: every turn before the latest summarized, about a fifth of the
40
- * window of the latest turn kept; maintainer decision 2026-11-28).
40
+ * window of the latest turn kept; maintainer decision 2026-11-28). A manual compaction always
41
+ * summarizes the transcript with that plan, on a model the in-context gate lists too (ruling R13,
42
+ * idle compaction spec §9.4).
41
43
  *
42
44
  * The run writes only its outcome, with `step: 0`: `compaction_summary` / `compaction_failed` + the
43
45
  * summary calls' `usage`, or `compaction_skipped` when there is nothing to summarize (maintainer
@@ -19,7 +19,9 @@ import { RunSteps } from "./run-steps.js";
19
19
  * settings) and calls the shared {@link runCompaction} with `force: true`: the trigger,
20
20
  * `enabled: false` and the failure backoff are bypassed, the compaction plan is still required, with
21
21
  * the manual rule (`manual: true`: every turn before the latest summarized, about a fifth of the
22
- * window of the latest turn kept; maintainer decision 2026-11-28).
22
+ * window of the latest turn kept; maintainer decision 2026-11-28). A manual compaction always
23
+ * summarizes the transcript with that plan, on a model the in-context gate lists too (ruling R13,
24
+ * idle compaction spec §9.4).
23
25
  *
24
26
  * The run writes only its outcome, with `step: 0`: `compaction_summary` / `compaction_failed` + the
25
27
  * summary calls' `usage`, or `compaction_skipped` when there is nothing to summarize (maintainer