openloops 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +9 -8
  2. package/dist/db/index.d.ts +1 -0
  3. package/dist/db/index.js +3 -1
  4. package/dist/db/index.mjs +1 -0
  5. package/dist/db/indexes/automation-runs.d.ts +2 -0
  6. package/dist/db/indexes/automation-runs.js +33 -0
  7. package/dist/db/indexes/automation-runs.mjs +10 -0
  8. package/dist/db/indexes/automations.d.ts +2 -0
  9. package/dist/db/indexes/{agentic-jobs.js → automations.js} +6 -6
  10. package/dist/db/indexes/{agentic-jobs.mjs → automations.mjs} +2 -2
  11. package/dist/db/indexes/index.js +6 -4
  12. package/dist/db/indexes/index.mjs +6 -4
  13. package/dist/db/indexes/revoked-tokens.d.ts +2 -0
  14. package/dist/db/indexes/{agentic-job-runs.js → revoked-tokens.js} +8 -9
  15. package/dist/db/indexes/revoked-tokens.mjs +8 -0
  16. package/dist/db/migrations/automations.d.ts +12 -0
  17. package/dist/db/migrations/automations.js +70 -0
  18. package/dist/db/migrations/automations.mjs +47 -0
  19. package/dist/services/authentication/entities/index.d.ts +1 -0
  20. package/dist/services/authentication/entities/index.js +22 -0
  21. package/dist/services/authentication/entities/index.mjs +1 -0
  22. package/dist/services/authentication/entities/revoked-token.entity.d.ts +17 -0
  23. package/dist/services/authentication/entities/revoked-token.entity.js +67 -0
  24. package/dist/services/authentication/entities/revoked-token.entity.mjs +44 -0
  25. package/dist/services/authentication/index.d.ts +1 -0
  26. package/dist/services/authentication/index.js +3 -1
  27. package/dist/services/authentication/index.mjs +1 -0
  28. package/dist/services/authentication/module.d.ts +4 -0
  29. package/dist/services/authentication/module.js +16 -2
  30. package/dist/services/authentication/module.mjs +13 -1
  31. package/dist/services/authentication/repositories/index.d.ts +1 -0
  32. package/dist/services/{agentic-jobs → authentication}/repositories/index.js +2 -4
  33. package/dist/services/authentication/repositories/index.mjs +1 -0
  34. package/dist/services/authentication/repositories/revoked-token.repository.d.ts +7 -0
  35. package/dist/services/authentication/repositories/revoked-token.repository.js +55 -0
  36. package/dist/services/authentication/repositories/revoked-token.repository.mjs +26 -0
  37. package/dist/services/authentication/use-cases/is-token-revoked.use-case.d.ts +15 -0
  38. package/dist/services/authentication/use-cases/is-token-revoked.use-case.js +55 -0
  39. package/dist/services/authentication/use-cases/is-token-revoked.use-case.mjs +26 -0
  40. package/dist/services/authentication/use-cases/revoke-token.use-case.d.ts +14 -0
  41. package/dist/services/authentication/use-cases/revoke-token.use-case.js +65 -0
  42. package/dist/services/authentication/use-cases/revoke-token.use-case.mjs +36 -0
  43. package/dist/services/automations/entities/automation-run.entity.d.ts +46 -0
  44. package/dist/services/{agentic-jobs/entities/agentic-job-run.entity.js → automations/entities/automation-run.entity.js} +22 -14
  45. package/dist/services/{agentic-jobs/entities/agentic-job-run.entity.mjs → automations/entities/automation-run.entity.mjs} +18 -10
  46. package/dist/services/automations/entities/automation.entity.d.ts +38 -0
  47. package/dist/services/{agentic-jobs/entities/agentic-job.entity.js → automations/entities/automation.entity.js} +17 -17
  48. package/dist/services/{agentic-jobs/entities/agentic-job.entity.mjs → automations/entities/automation.entity.mjs} +13 -13
  49. package/dist/services/automations/entities/index.d.ts +4 -0
  50. package/dist/services/{agentic-jobs → automations}/entities/index.js +6 -4
  51. package/dist/services/automations/entities/index.mjs +4 -0
  52. package/dist/services/automations/entities/trigger.d.ts +11 -0
  53. package/dist/services/automations/entities/trigger.js +49 -0
  54. package/dist/services/automations/entities/trigger.mjs +26 -0
  55. package/dist/services/automations/index.d.ts +5 -0
  56. package/dist/services/{agentic-jobs → automations}/index.js +9 -7
  57. package/dist/services/automations/index.mjs +5 -0
  58. package/dist/services/automations/module.d.ts +41 -0
  59. package/dist/services/automations/module.js +167 -0
  60. package/dist/services/automations/module.mjs +125 -0
  61. package/dist/services/automations/repositories/automation-run.repository.d.ts +14 -0
  62. package/dist/services/{agentic-jobs/repositories/agentic-job-run.repository.js → automations/repositories/automation-run.repository.js} +23 -11
  63. package/dist/services/{agentic-jobs/repositories/agentic-job-run.repository.mjs → automations/repositories/automation-run.repository.mjs} +19 -7
  64. package/dist/services/automations/repositories/automation.repository.d.ts +27 -0
  65. package/dist/services/{agentic-jobs/repositories/agentic-job.repository.js → automations/repositories/automation.repository.js} +17 -17
  66. package/dist/services/{agentic-jobs/repositories/agentic-job.repository.mjs → automations/repositories/automation.repository.mjs} +13 -13
  67. package/dist/services/automations/repositories/index.d.ts +2 -0
  68. package/dist/services/automations/repositories/index.js +24 -0
  69. package/dist/services/automations/repositories/index.mjs +2 -0
  70. package/dist/services/automations/runner/automation-runner.d.ts +49 -0
  71. package/dist/services/{agentic-jobs/runner/agentic-job-runner.js → automations/runner/automation-runner.js} +55 -45
  72. package/dist/services/{agentic-jobs/runner/agentic-job-runner.mjs → automations/runner/automation-runner.mjs} +50 -40
  73. package/dist/services/{agentic-jobs/use-cases/attach-agentic-job-run-chat.use-case.d.ts → automations/use-cases/attach-automation-run-chat.use-case.d.ts} +6 -6
  74. package/dist/services/{agentic-jobs/use-cases/attach-agentic-job-run-chat.use-case.js → automations/use-cases/attach-automation-run-chat.use-case.js} +14 -14
  75. package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.mjs +29 -0
  76. package/dist/services/automations/use-cases/claim-due-automations.use-case.d.ts +28 -0
  77. package/dist/services/{agentic-jobs/use-cases/claim-due-agentic-jobs.use-case.js → automations/use-cases/claim-due-automations.use-case.js} +32 -43
  78. package/dist/services/automations/use-cases/claim-due-automations.use-case.mjs +70 -0
  79. package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.d.ts +27 -0
  80. package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.js +106 -0
  81. package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.mjs +77 -0
  82. package/dist/services/automations/use-cases/create-automation.use-case.d.ts +14 -0
  83. package/dist/services/{agentic-jobs/use-cases/create-agentic-job.use-case.js → automations/use-cases/create-automation.use-case.js} +24 -25
  84. package/dist/services/automations/use-cases/create-automation.use-case.mjs +43 -0
  85. package/dist/services/{agentic-jobs/use-cases/delete-agentic-job.use-case.d.ts → automations/use-cases/delete-automation.use-case.d.ts} +6 -6
  86. package/dist/services/{agentic-jobs/use-cases/delete-agentic-job.use-case.js → automations/use-cases/delete-automation.use-case.js} +17 -17
  87. package/dist/services/automations/use-cases/delete-automation.use-case.mjs +36 -0
  88. package/dist/services/{agentic-jobs/use-cases/finish-agentic-job-run.use-case.d.ts → automations/use-cases/finish-automation-run.use-case.d.ts} +8 -8
  89. package/dist/services/{agentic-jobs/use-cases/finish-agentic-job-run.use-case.js → automations/use-cases/finish-automation-run.use-case.js} +20 -20
  90. package/dist/services/automations/use-cases/finish-automation-run.use-case.mjs +46 -0
  91. package/dist/services/{agentic-jobs/use-cases/get-agentic-job-by-id.use-case.d.ts → automations/use-cases/get-automation-by-id.use-case.d.ts} +6 -6
  92. package/dist/services/{agentic-jobs/use-cases/get-agentic-job-by-id.use-case.js → automations/use-cases/get-automation-by-id.use-case.js} +13 -13
  93. package/dist/services/automations/use-cases/get-automation-by-id.use-case.mjs +26 -0
  94. package/dist/services/automations/use-cases/issue-automation-event-token.use-case.d.ts +17 -0
  95. package/dist/services/automations/use-cases/issue-automation-event-token.use-case.js +59 -0
  96. package/dist/services/automations/use-cases/issue-automation-event-token.use-case.mjs +30 -0
  97. package/dist/services/{agentic-jobs/use-cases/list-agentic-job-runs-by-job.use-case.d.ts → automations/use-cases/list-automation-runs-by-automation.use-case.d.ts} +7 -7
  98. package/dist/services/{agentic-jobs/use-cases/list-agentic-job-runs-by-job.use-case.js → automations/use-cases/list-automation-runs-by-automation.use-case.js} +15 -15
  99. package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.mjs +28 -0
  100. package/dist/services/{agentic-jobs/use-cases/list-agentic-job-runs-by-user.use-case.d.ts → automations/use-cases/list-automation-runs-by-user.use-case.d.ts} +7 -7
  101. package/dist/services/{agentic-jobs/use-cases/list-agentic-job-runs-by-user.use-case.js → automations/use-cases/list-automation-runs-by-user.use-case.js} +14 -14
  102. package/dist/services/{agentic-jobs/use-cases/list-agentic-job-runs-by-user.use-case.mjs → automations/use-cases/list-automation-runs-by-user.use-case.mjs} +11 -11
  103. package/dist/services/{agentic-jobs/use-cases/list-agentic-jobs-by-user.use-case.d.ts → automations/use-cases/list-automations-by-user.use-case.d.ts} +6 -6
  104. package/dist/services/{agentic-jobs/use-cases/list-agentic-jobs-by-user.use-case.js → automations/use-cases/list-automations-by-user.use-case.js} +14 -14
  105. package/dist/services/{agentic-jobs/use-cases/list-agentic-jobs-by-user.use-case.mjs → automations/use-cases/list-automations-by-user.use-case.mjs} +11 -11
  106. package/dist/services/{agentic-jobs/use-cases/preview-agentic-job-runs.use-case.d.ts → automations/use-cases/preview-automation-runs.use-case.d.ts} +1 -1
  107. package/dist/services/{agentic-jobs/use-cases/preview-agentic-job-runs.use-case.js → automations/use-cases/preview-automation-runs.use-case.js} +8 -8
  108. package/dist/services/{agentic-jobs/use-cases/preview-agentic-job-runs.use-case.mjs → automations/use-cases/preview-automation-runs.use-case.mjs} +4 -4
  109. package/dist/services/automations/use-cases/receive-automation-event.use-case.d.ts +23 -0
  110. package/dist/services/automations/use-cases/receive-automation-event.use-case.js +97 -0
  111. package/dist/services/automations/use-cases/receive-automation-event.use-case.mjs +68 -0
  112. package/dist/services/{agentic-jobs/use-cases/renew-agentic-job-lease.use-case.d.ts → automations/use-cases/renew-automation-lease.use-case.d.ts} +5 -5
  113. package/dist/services/{agentic-jobs/use-cases/renew-agentic-job-lease.use-case.js → automations/use-cases/renew-automation-lease.use-case.js} +15 -15
  114. package/dist/services/automations/use-cases/renew-automation-lease.use-case.mjs +29 -0
  115. package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.d.ts +16 -0
  116. package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.js +65 -0
  117. package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.mjs +36 -0
  118. package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.d.ts +14 -0
  119. package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.js +63 -0
  120. package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.mjs +34 -0
  121. package/dist/services/automations/use-cases/start-automation-run.use-case.d.ts +21 -0
  122. package/dist/services/{agentic-jobs/use-cases/start-agentic-job-run.use-case.js → automations/use-cases/start-automation-run.use-case.js} +24 -24
  123. package/dist/services/automations/use-cases/start-automation-run.use-case.mjs +38 -0
  124. package/dist/services/automations/use-cases/sync-automation-run.use-case.d.ts +20 -0
  125. package/dist/services/{agentic-jobs/use-cases/sync-agentic-job-run.use-case.js → automations/use-cases/sync-automation-run.use-case.js} +23 -23
  126. package/dist/services/{agentic-jobs/use-cases/sync-agentic-job-run.use-case.mjs → automations/use-cases/sync-automation-run.use-case.mjs} +21 -21
  127. package/dist/services/{agentic-jobs/use-cases/sync-agentic-job-runs.use-case.d.ts → automations/use-cases/sync-automation-runs.use-case.d.ts} +5 -5
  128. package/dist/services/{agentic-jobs/use-cases/sync-agentic-job-runs.use-case.js → automations/use-cases/sync-automation-runs.use-case.js} +16 -16
  129. package/dist/services/{agentic-jobs/use-cases/sync-agentic-job-runs.use-case.mjs → automations/use-cases/sync-automation-runs.use-case.mjs} +13 -13
  130. package/dist/services/automations/use-cases/update-automation.use-case.d.ts +15 -0
  131. package/dist/services/{agentic-jobs/use-cases/update-agentic-job.use-case.js → automations/use-cases/update-automation.use-case.js} +27 -27
  132. package/dist/services/automations/use-cases/update-automation.use-case.mjs +54 -0
  133. package/dist/services/automations/utils/automation-event-error.d.ts +6 -0
  134. package/dist/services/automations/utils/automation-event-error.js +37 -0
  135. package/dist/services/automations/utils/automation-event-error.mjs +14 -0
  136. package/dist/services/automations/utils/automation-fields.d.ts +14 -0
  137. package/dist/services/{agentic-jobs/utils/job-fields.js → automations/utils/automation-fields.js} +8 -10
  138. package/dist/services/{agentic-jobs/utils/job-fields.mjs → automations/utils/automation-fields.mjs} +4 -6
  139. package/dist/services/automations/utils/event-message.d.ts +1 -0
  140. package/dist/services/automations/utils/event-message.js +37 -0
  141. package/dist/services/automations/utils/event-message.mjs +14 -0
  142. package/dist/services/automations/utils/event-token.d.ts +18 -0
  143. package/dist/services/automations/utils/event-token.js +78 -0
  144. package/dist/services/automations/utils/event-token.mjs +43 -0
  145. package/dist/services/automations/utils/open-run.d.ts +14 -0
  146. package/dist/services/{agentic-jobs → automations}/utils/open-run.js +10 -8
  147. package/dist/services/automations/utils/open-run.mjs +26 -0
  148. package/dist/services/automations/utils/previous-run.d.ts +4 -0
  149. package/dist/services/automations/utils/previous-run.js +42 -0
  150. package/dist/services/automations/utils/previous-run.mjs +19 -0
  151. package/dist/services/{agentic-jobs → automations}/utils/settings.d.ts +1 -0
  152. package/dist/services/{agentic-jobs → automations}/utils/settings.js +6 -2
  153. package/dist/services/automations/utils/settings.mjs +13 -0
  154. package/docs/README.md +1 -1
  155. package/docs/agent.md +2 -2
  156. package/docs/authentication.md +18 -1
  157. package/docs/automations.md +341 -0
  158. package/docs/configuration.md +6 -5
  159. package/docs/harness.md +1 -1
  160. package/docs/integration-guide.md +22 -18
  161. package/docs/llms.txt +1 -1
  162. package/docs/mcp-servers.md +1 -1
  163. package/examples/{agentic-jobs/create-agentic-job.ts → automations/create-automation.ts} +10 -7
  164. package/examples/automations/create-event-automation.ts +24 -0
  165. package/examples/{agentic-jobs/list-agentic-job-runs.ts → automations/list-automation-runs.ts} +8 -8
  166. package/examples/automations/list-automations.ts +25 -0
  167. package/examples/{agentic-jobs/preview-agentic-job-runs.ts → automations/preview-automation-runs.ts} +2 -2
  168. package/examples/automations/receive-automation-event.ts +26 -0
  169. package/examples/automations/revoke-automation-event-token.ts +25 -0
  170. package/examples/{agentic-jobs/run-agentic-job-now.ts → automations/run-automation-now.ts} +3 -3
  171. package/examples/{agentic-jobs/run-agentic-job-worker.ts → automations/run-automation-worker.ts} +6 -6
  172. package/examples/{agentic-jobs/update-agentic-job.ts → automations/update-automation.ts} +10 -10
  173. package/package.json +14 -13
  174. package/dist/db/indexes/agentic-job-runs.d.ts +0 -2
  175. package/dist/db/indexes/agentic-job-runs.mjs +0 -9
  176. package/dist/db/indexes/agentic-jobs.d.ts +0 -2
  177. package/dist/services/agentic-jobs/entities/agentic-job-run.entity.d.ts +0 -42
  178. package/dist/services/agentic-jobs/entities/agentic-job.entity.d.ts +0 -39
  179. package/dist/services/agentic-jobs/entities/index.d.ts +0 -3
  180. package/dist/services/agentic-jobs/entities/index.mjs +0 -3
  181. package/dist/services/agentic-jobs/index.d.ts +0 -4
  182. package/dist/services/agentic-jobs/index.mjs +0 -4
  183. package/dist/services/agentic-jobs/module.d.ts +0 -31
  184. package/dist/services/agentic-jobs/module.js +0 -132
  185. package/dist/services/agentic-jobs/module.mjs +0 -95
  186. package/dist/services/agentic-jobs/repositories/agentic-job-run.repository.d.ts +0 -11
  187. package/dist/services/agentic-jobs/repositories/agentic-job.repository.d.ts +0 -27
  188. package/dist/services/agentic-jobs/repositories/index.d.ts +0 -2
  189. package/dist/services/agentic-jobs/repositories/index.mjs +0 -2
  190. package/dist/services/agentic-jobs/runner/agentic-job-runner.d.ts +0 -48
  191. package/dist/services/agentic-jobs/use-cases/attach-agentic-job-run-chat.use-case.mjs +0 -29
  192. package/dist/services/agentic-jobs/use-cases/claim-due-agentic-jobs.use-case.d.ts +0 -29
  193. package/dist/services/agentic-jobs/use-cases/claim-due-agentic-jobs.use-case.mjs +0 -81
  194. package/dist/services/agentic-jobs/use-cases/create-agentic-job.use-case.d.ts +0 -14
  195. package/dist/services/agentic-jobs/use-cases/create-agentic-job.use-case.mjs +0 -44
  196. package/dist/services/agentic-jobs/use-cases/delete-agentic-job.use-case.mjs +0 -36
  197. package/dist/services/agentic-jobs/use-cases/finish-agentic-job-run.use-case.mjs +0 -46
  198. package/dist/services/agentic-jobs/use-cases/get-agentic-job-by-id.use-case.mjs +0 -26
  199. package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-job.use-case.mjs +0 -28
  200. package/dist/services/agentic-jobs/use-cases/renew-agentic-job-lease.use-case.mjs +0 -29
  201. package/dist/services/agentic-jobs/use-cases/start-agentic-job-run.use-case.d.ts +0 -21
  202. package/dist/services/agentic-jobs/use-cases/start-agentic-job-run.use-case.mjs +0 -38
  203. package/dist/services/agentic-jobs/use-cases/sync-agentic-job-run.use-case.d.ts +0 -20
  204. package/dist/services/agentic-jobs/use-cases/update-agentic-job.use-case.d.ts +0 -15
  205. package/dist/services/agentic-jobs/use-cases/update-agentic-job.use-case.mjs +0 -54
  206. package/dist/services/agentic-jobs/utils/job-fields.d.ts +0 -14
  207. package/dist/services/agentic-jobs/utils/open-run.d.ts +0 -12
  208. package/dist/services/agentic-jobs/utils/open-run.mjs +0 -24
  209. package/dist/services/agentic-jobs/utils/settings.mjs +0 -10
  210. package/docs/agentic-jobs.md +0 -217
  211. package/examples/agentic-jobs/list-agentic-jobs.ts +0 -25
  212. /package/dist/services/{agentic-jobs → automations}/entities/recurrence.d.ts +0 -0
  213. /package/dist/services/{agentic-jobs → automations}/entities/recurrence.js +0 -0
  214. /package/dist/services/{agentic-jobs → automations}/entities/recurrence.mjs +0 -0
  215. /package/dist/services/{agentic-jobs → automations}/utils/next-run.d.ts +0 -0
  216. /package/dist/services/{agentic-jobs → automations}/utils/next-run.js +0 -0
  217. /package/dist/services/{agentic-jobs → automations}/utils/next-run.mjs +0 -0
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var agentic_job_entity_exports = {};
20
- __export(agentic_job_entity_exports, {
21
- AgenticJob: () => AgenticJob
19
+ var automation_entity_exports = {};
20
+ __export(automation_entity_exports, {
21
+ Automation: () => Automation
22
22
  });
23
- module.exports = __toCommonJS(agentic_job_entity_exports);
23
+ module.exports = __toCommonJS(automation_entity_exports);
24
24
  var import_base = require("../../../common/base/base.entity.js");
25
25
  var import_next_run = require("../utils/next-run");
26
26
  const toDate = (value) => {
@@ -29,15 +29,14 @@ const toDate = (value) => {
29
29
  if (Number.isNaN(date.getTime())) throw new Error("{{value_must_be_a_date}}");
30
30
  return date;
31
31
  };
32
- class AgenticJob extends import_base.BaseEntity {
33
- constructor(props, name, instructions, enabled, recurrence, timezone, modelProvider, modelName, nextRunAt, lastRunAt, lastRunStatus, lockedBy, lockedUntil, activeRunId) {
32
+ class Automation extends import_base.BaseEntity {
33
+ constructor(props, name, instructions, enabled, trigger, modelProvider, modelName, nextRunAt, lastRunAt, lastRunStatus, lockedBy, lockedUntil, activeRunId) {
34
34
  super(props);
35
35
  this.props = props;
36
36
  this.name = name;
37
37
  this.instructions = instructions;
38
38
  this.enabled = enabled;
39
- this.recurrence = recurrence;
40
- this.timezone = timezone;
39
+ this.trigger = trigger;
41
40
  this.modelProvider = modelProvider;
42
41
  this.modelName = modelName;
43
42
  this.nextRunAt = nextRunAt;
@@ -51,8 +50,7 @@ class AgenticJob extends import_base.BaseEntity {
51
50
  name;
52
51
  instructions;
53
52
  enabled;
54
- recurrence;
55
- timezone;
53
+ trigger;
56
54
  modelProvider;
57
55
  modelName;
58
56
  nextRunAt;
@@ -62,13 +60,12 @@ class AgenticJob extends import_base.BaseEntity {
62
60
  lockedUntil;
63
61
  activeRunId;
64
62
  static fromJSON(props) {
65
- return new AgenticJob(
63
+ return new Automation(
66
64
  props,
67
65
  props.name || void 0,
68
66
  props.instructions || void 0,
69
67
  props.enabled,
70
- props.recurrence,
71
- props.timezone || void 0,
68
+ props.trigger,
72
69
  props.modelProvider || void 0,
73
70
  props.modelName || void 0,
74
71
  toDate(props.nextRunAt),
@@ -85,8 +82,7 @@ class AgenticJob extends import_base.BaseEntity {
85
82
  name: this.name,
86
83
  instructions: this.instructions,
87
84
  enabled: this.enabled,
88
- recurrence: this.recurrence,
89
- timezone: this.timezone,
85
+ trigger: this.trigger,
90
86
  modelProvider: this.modelProvider,
91
87
  modelName: this.modelName,
92
88
  nextRunAt: this.nextRunAt,
@@ -97,8 +93,12 @@ class AgenticJob extends import_base.BaseEntity {
97
93
  activeRunId: this.activeRunId
98
94
  };
99
95
  }
96
+ isScheduled() {
97
+ return this.trigger?.type === "schedule";
98
+ }
100
99
  scheduleNextRun(from = /* @__PURE__ */ new Date()) {
101
- const next = this.enabled && this.recurrence && this.timezone ? (0, import_next_run.computeNextRun)(this.recurrence, this.timezone, from) : null;
100
+ const trigger = this.trigger;
101
+ const next = this.enabled && trigger?.type === "schedule" ? (0, import_next_run.computeNextRun)(trigger.recurrence, trigger.timezone, from) : null;
102
102
  if (next) {
103
103
  this.nextRunAt = next;
104
104
  } else {
@@ -109,5 +109,5 @@ class AgenticJob extends import_base.BaseEntity {
109
109
  }
110
110
  // Annotate the CommonJS export names for ESM import in node:
111
111
  0 && (module.exports = {
112
- AgenticJob
112
+ Automation
113
113
  });
@@ -7,15 +7,14 @@ const toDate = (value) => {
7
7
  if (Number.isNaN(date.getTime())) throw new Error("{{value_must_be_a_date}}");
8
8
  return date;
9
9
  };
10
- class AgenticJob extends BaseEntity {
11
- constructor(props, name, instructions, enabled, recurrence, timezone, modelProvider, modelName, nextRunAt, lastRunAt, lastRunStatus, lockedBy, lockedUntil, activeRunId) {
10
+ class Automation extends BaseEntity {
11
+ constructor(props, name, instructions, enabled, trigger, modelProvider, modelName, nextRunAt, lastRunAt, lastRunStatus, lockedBy, lockedUntil, activeRunId) {
12
12
  super(props);
13
13
  this.props = props;
14
14
  this.name = name;
15
15
  this.instructions = instructions;
16
16
  this.enabled = enabled;
17
- this.recurrence = recurrence;
18
- this.timezone = timezone;
17
+ this.trigger = trigger;
19
18
  this.modelProvider = modelProvider;
20
19
  this.modelName = modelName;
21
20
  this.nextRunAt = nextRunAt;
@@ -29,8 +28,7 @@ class AgenticJob extends BaseEntity {
29
28
  name;
30
29
  instructions;
31
30
  enabled;
32
- recurrence;
33
- timezone;
31
+ trigger;
34
32
  modelProvider;
35
33
  modelName;
36
34
  nextRunAt;
@@ -40,13 +38,12 @@ class AgenticJob extends BaseEntity {
40
38
  lockedUntil;
41
39
  activeRunId;
42
40
  static fromJSON(props) {
43
- return new AgenticJob(
41
+ return new Automation(
44
42
  props,
45
43
  props.name || void 0,
46
44
  props.instructions || void 0,
47
45
  props.enabled,
48
- props.recurrence,
49
- props.timezone || void 0,
46
+ props.trigger,
50
47
  props.modelProvider || void 0,
51
48
  props.modelName || void 0,
52
49
  toDate(props.nextRunAt),
@@ -63,8 +60,7 @@ class AgenticJob extends BaseEntity {
63
60
  name: this.name,
64
61
  instructions: this.instructions,
65
62
  enabled: this.enabled,
66
- recurrence: this.recurrence,
67
- timezone: this.timezone,
63
+ trigger: this.trigger,
68
64
  modelProvider: this.modelProvider,
69
65
  modelName: this.modelName,
70
66
  nextRunAt: this.nextRunAt,
@@ -75,8 +71,12 @@ class AgenticJob extends BaseEntity {
75
71
  activeRunId: this.activeRunId
76
72
  };
77
73
  }
74
+ isScheduled() {
75
+ return this.trigger?.type === "schedule";
76
+ }
78
77
  scheduleNextRun(from = /* @__PURE__ */ new Date()) {
79
- const next = this.enabled && this.recurrence && this.timezone ? computeNextRun(this.recurrence, this.timezone, from) : null;
78
+ const trigger = this.trigger;
79
+ const next = this.enabled && trigger?.type === "schedule" ? computeNextRun(trigger.recurrence, trigger.timezone, from) : null;
80
80
  if (next) {
81
81
  this.nextRunAt = next;
82
82
  } else {
@@ -86,5 +86,5 @@ class AgenticJob extends BaseEntity {
86
86
  }
87
87
  }
88
88
  export {
89
- AgenticJob
89
+ Automation
90
90
  };
@@ -0,0 +1,4 @@
1
+ export * from './recurrence';
2
+ export * from './automation.entity';
3
+ export * from './automation-run.entity';
4
+ export * from './trigger';
@@ -16,11 +16,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  var entities_exports = {};
17
17
  module.exports = __toCommonJS(entities_exports);
18
18
  __reExport(entities_exports, require("./recurrence"), module.exports);
19
- __reExport(entities_exports, require("./agentic-job.entity"), module.exports);
20
- __reExport(entities_exports, require("./agentic-job-run.entity"), module.exports);
19
+ __reExport(entities_exports, require("./automation.entity"), module.exports);
20
+ __reExport(entities_exports, require("./automation-run.entity"), module.exports);
21
+ __reExport(entities_exports, require("./trigger"), module.exports);
21
22
  // Annotate the CommonJS export names for ESM import in node:
22
23
  0 && (module.exports = {
23
24
  ...require("./recurrence"),
24
- ...require("./agentic-job.entity"),
25
- ...require("./agentic-job-run.entity")
25
+ ...require("./automation.entity"),
26
+ ...require("./automation-run.entity"),
27
+ ...require("./trigger")
26
28
  });
@@ -0,0 +1,4 @@
1
+ export * from "./recurrence";
2
+ export * from "./automation.entity";
3
+ export * from "./automation-run.entity";
4
+ export * from "./trigger";
@@ -0,0 +1,11 @@
1
+ import { Recurrence } from './recurrence';
2
+ export type AutomationTrigger = {
3
+ type: 'schedule';
4
+ recurrence: Recurrence;
5
+ timezone: string;
6
+ } | {
7
+ type: 'event';
8
+ tokenVersion: number;
9
+ timezone?: string;
10
+ };
11
+ export declare function readTrigger(input: unknown, existing?: AutomationTrigger): AutomationTrigger;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var trigger_exports = {};
20
+ __export(trigger_exports, {
21
+ readTrigger: () => readTrigger
22
+ });
23
+ module.exports = __toCommonJS(trigger_exports);
24
+ var import_recurrence = require("./recurrence");
25
+ var import_next_run = require("../utils/next-run");
26
+ const isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
27
+ function readTrigger(input, existing) {
28
+ if (!isRecord(input)) throw new Error("The trigger is required");
29
+ const type = input.type ?? existing?.type;
30
+ if (type !== "schedule" && type !== "event") throw new Error("The trigger type must be schedule or event");
31
+ if (existing && type !== existing.type) throw new Error("The type of the trigger cannot be changed");
32
+ const previous = existing?.type === type ? existing : void 0;
33
+ const has = (key) => input[key] !== void 0;
34
+ if (type === "event") {
35
+ const event = previous;
36
+ const timezone = has("timezone") ? (0, import_next_run.assertTimezone)(input.timezone) : event?.timezone;
37
+ return { type, tokenVersion: event?.tokenVersion ?? 1, ...timezone ? { timezone } : {} };
38
+ }
39
+ const schedule = previous;
40
+ return {
41
+ type,
42
+ recurrence: has("recurrence") || !schedule ? (0, import_recurrence.validateRecurrence)(input.recurrence) : schedule.recurrence,
43
+ timezone: has("timezone") || !schedule ? (0, import_next_run.assertTimezone)(input.timezone) : schedule.timezone
44
+ };
45
+ }
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ readTrigger
49
+ });
@@ -0,0 +1,26 @@
1
+ import "../../../chunk-CF3WOMB3.mjs";
2
+ import { validateRecurrence } from "./recurrence";
3
+ import { assertTimezone } from "../utils/next-run";
4
+ const isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
5
+ function readTrigger(input, existing) {
6
+ if (!isRecord(input)) throw new Error("The trigger is required");
7
+ const type = input.type ?? existing?.type;
8
+ if (type !== "schedule" && type !== "event") throw new Error("The trigger type must be schedule or event");
9
+ if (existing && type !== existing.type) throw new Error("The type of the trigger cannot be changed");
10
+ const previous = existing?.type === type ? existing : void 0;
11
+ const has = (key) => input[key] !== void 0;
12
+ if (type === "event") {
13
+ const event = previous;
14
+ const timezone = has("timezone") ? assertTimezone(input.timezone) : event?.timezone;
15
+ return { type, tokenVersion: event?.tokenVersion ?? 1, ...timezone ? { timezone } : {} };
16
+ }
17
+ const schedule = previous;
18
+ return {
19
+ type,
20
+ recurrence: has("recurrence") || !schedule ? validateRecurrence(input.recurrence) : schedule.recurrence,
21
+ timezone: has("timezone") || !schedule ? assertTimezone(input.timezone) : schedule.timezone
22
+ };
23
+ }
24
+ export {
25
+ readTrigger
26
+ };
@@ -0,0 +1,5 @@
1
+ export * from './module';
2
+ export * from './entities';
3
+ export * from './repositories';
4
+ export * from './runner/automation-runner';
5
+ export * from './utils/automation-event-error';
@@ -13,16 +13,18 @@ var __copyProps = (to, from, except, desc) => {
13
13
  };
14
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var agentic_jobs_exports = {};
17
- module.exports = __toCommonJS(agentic_jobs_exports);
18
- __reExport(agentic_jobs_exports, require("./module"), module.exports);
19
- __reExport(agentic_jobs_exports, require("./entities"), module.exports);
20
- __reExport(agentic_jobs_exports, require("./repositories"), module.exports);
21
- __reExport(agentic_jobs_exports, require("./runner/agentic-job-runner"), module.exports);
16
+ var automations_exports = {};
17
+ module.exports = __toCommonJS(automations_exports);
18
+ __reExport(automations_exports, require("./module"), module.exports);
19
+ __reExport(automations_exports, require("./entities"), module.exports);
20
+ __reExport(automations_exports, require("./repositories"), module.exports);
21
+ __reExport(automations_exports, require("./runner/automation-runner"), module.exports);
22
+ __reExport(automations_exports, require("./utils/automation-event-error"), module.exports);
22
23
  // Annotate the CommonJS export names for ESM import in node:
23
24
  0 && (module.exports = {
24
25
  ...require("./module"),
25
26
  ...require("./entities"),
26
27
  ...require("./repositories"),
27
- ...require("./runner/agentic-job-runner")
28
+ ...require("./runner/automation-runner"),
29
+ ...require("./utils/automation-event-error")
28
30
  });
@@ -0,0 +1,5 @@
1
+ export * from "./module";
2
+ export * from "./entities";
3
+ export * from "./repositories";
4
+ export * from "./runner/automation-runner";
5
+ export * from "./utils/automation-event-error";
@@ -0,0 +1,41 @@
1
+ import 'reflect-metadata';
2
+ import { Params as CParams, Output as COutput } from './use-cases/create-automation.use-case';
3
+ import { Params as UParams, Output as UOutput } from './use-cases/update-automation.use-case';
4
+ import { Params as GParams, Output as GOutput } from './use-cases/get-automation-by-id.use-case';
5
+ import { Params as LParams, Output as LOutput } from './use-cases/list-automations-by-user.use-case';
6
+ import { Params as DParams, Output as DOutput } from './use-cases/delete-automation.use-case';
7
+ import { Params as PParams, Output as POutput } from './use-cases/preview-automation-runs.use-case';
8
+ import { Params as RJParams, Output as RJOutput } from './use-cases/list-automation-runs-by-automation.use-case';
9
+ import { Params as RUParams, Output as RUOutput } from './use-cases/list-automation-runs-by-user.use-case';
10
+ import { Params as CDParams, Output as CDOutput } from './use-cases/claim-due-automations.use-case';
11
+ import { Params as SRParams, Output as SROutput } from './use-cases/start-automation-run.use-case';
12
+ import { Params as FRParams, Output as FROutput } from './use-cases/finish-automation-run.use-case';
13
+ import { Params as SYParams, Output as SYOutput } from './use-cases/sync-automation-run.use-case';
14
+ import { Params as SYSParams, Output as SYSOutput } from './use-cases/sync-automation-runs.use-case';
15
+ import { Params as ACParams, Output as ACOutput } from './use-cases/attach-automation-run-chat.use-case';
16
+ import { Params as RLParams, Output as RLOutput } from './use-cases/renew-automation-lease.use-case';
17
+ import { Params as ITParams, Output as ITOutput } from './use-cases/issue-automation-event-token.use-case';
18
+ import { Params as RTParams, Output as RTOutput } from './use-cases/revoke-automation-event-token.use-case';
19
+ import { Params as ROParams, Output as ROOutput } from './use-cases/rotate-automation-event-tokens.use-case';
20
+ import { Params as REParams, Output as REOutput } from './use-cases/receive-automation-event.use-case';
21
+ import { Params as CQParams, Output as CQOutput } from './use-cases/claim-queued-automation-runs.use-case';
22
+ export declare function createAutomation(props: CParams): Promise<COutput>;
23
+ export declare function updateAutomation(props: UParams): Promise<UOutput>;
24
+ export declare function getAutomationById(props: GParams): Promise<GOutput>;
25
+ export declare function listAutomationsByUser(props: LParams): Promise<LOutput>;
26
+ export declare function deleteAutomation(props: DParams): Promise<DOutput>;
27
+ export declare function previewAutomationRuns(props: PParams): Promise<POutput>;
28
+ export declare function listAutomationRunsByAutomation(props: RJParams): Promise<RJOutput>;
29
+ export declare function listAutomationRunsByUser(props: RUParams): Promise<RUOutput>;
30
+ export declare function claimDueAutomations(props: CDParams): Promise<CDOutput>;
31
+ export declare function startAutomationRun(props: SRParams): Promise<SROutput>;
32
+ export declare function finishAutomationRun(props: FRParams): Promise<FROutput>;
33
+ export declare function syncAutomationRun(props: SYParams): Promise<SYOutput>;
34
+ export declare function syncAutomationRuns(props?: SYSParams): Promise<SYSOutput>;
35
+ export declare function attachAutomationRunChat(props: ACParams): Promise<ACOutput>;
36
+ export declare function renewAutomationLease(props: RLParams): Promise<RLOutput>;
37
+ export declare function issueAutomationEventToken(props: ITParams): Promise<ITOutput>;
38
+ export declare function revokeAutomationEventToken(props: RTParams): Promise<RTOutput>;
39
+ export declare function rotateAutomationEventTokens(props: ROParams): Promise<ROOutput>;
40
+ export declare function receiveAutomationEvent(props: REParams): Promise<REOutput>;
41
+ export declare function claimQueuedAutomationRuns(props: CQParams): Promise<CQOutput>;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var module_exports = {};
20
+ __export(module_exports, {
21
+ attachAutomationRunChat: () => attachAutomationRunChat,
22
+ claimDueAutomations: () => claimDueAutomations,
23
+ claimQueuedAutomationRuns: () => claimQueuedAutomationRuns,
24
+ createAutomation: () => createAutomation,
25
+ deleteAutomation: () => deleteAutomation,
26
+ finishAutomationRun: () => finishAutomationRun,
27
+ getAutomationById: () => getAutomationById,
28
+ issueAutomationEventToken: () => issueAutomationEventToken,
29
+ listAutomationRunsByAutomation: () => listAutomationRunsByAutomation,
30
+ listAutomationRunsByUser: () => listAutomationRunsByUser,
31
+ listAutomationsByUser: () => listAutomationsByUser,
32
+ previewAutomationRuns: () => previewAutomationRuns,
33
+ receiveAutomationEvent: () => receiveAutomationEvent,
34
+ renewAutomationLease: () => renewAutomationLease,
35
+ revokeAutomationEventToken: () => revokeAutomationEventToken,
36
+ rotateAutomationEventTokens: () => rotateAutomationEventTokens,
37
+ startAutomationRun: () => startAutomationRun,
38
+ syncAutomationRun: () => syncAutomationRun,
39
+ syncAutomationRuns: () => syncAutomationRuns,
40
+ updateAutomation: () => updateAutomation
41
+ });
42
+ module.exports = __toCommonJS(module_exports);
43
+ var import_reflect_metadata = require("reflect-metadata");
44
+ var import_tsyringe = require("tsyringe");
45
+ var import_create_automation = require("./use-cases/create-automation.use-case");
46
+ var import_update_automation = require("./use-cases/update-automation.use-case");
47
+ var import_get_automation_by_id = require("./use-cases/get-automation-by-id.use-case");
48
+ var import_list_automations_by_user = require("./use-cases/list-automations-by-user.use-case");
49
+ var import_delete_automation = require("./use-cases/delete-automation.use-case");
50
+ var import_preview_automation_runs = require("./use-cases/preview-automation-runs.use-case");
51
+ var import_list_automation_runs_by_automation = require("./use-cases/list-automation-runs-by-automation.use-case");
52
+ var import_list_automation_runs_by_user = require("./use-cases/list-automation-runs-by-user.use-case");
53
+ var import_claim_due_automations = require("./use-cases/claim-due-automations.use-case");
54
+ var import_start_automation_run = require("./use-cases/start-automation-run.use-case");
55
+ var import_finish_automation_run = require("./use-cases/finish-automation-run.use-case");
56
+ var import_sync_automation_run = require("./use-cases/sync-automation-run.use-case");
57
+ var import_sync_automation_runs = require("./use-cases/sync-automation-runs.use-case");
58
+ var import_attach_automation_run_chat = require("./use-cases/attach-automation-run-chat.use-case");
59
+ var import_renew_automation_lease = require("./use-cases/renew-automation-lease.use-case");
60
+ var import_issue_automation_event_token = require("./use-cases/issue-automation-event-token.use-case");
61
+ var import_revoke_automation_event_token = require("./use-cases/revoke-automation-event-token.use-case");
62
+ var import_rotate_automation_event_tokens = require("./use-cases/rotate-automation-event-tokens.use-case");
63
+ var import_receive_automation_event = require("./use-cases/receive-automation-event.use-case");
64
+ var import_claim_queued_automation_runs = require("./use-cases/claim-queued-automation-runs.use-case");
65
+ async function createAutomation(props) {
66
+ const createAutomationUseCase = import_tsyringe.container.resolve(import_create_automation.CreateAutomationUseCase);
67
+ return createAutomationUseCase.execute(props);
68
+ }
69
+ async function updateAutomation(props) {
70
+ const updateAutomationUseCase = import_tsyringe.container.resolve(import_update_automation.UpdateAutomationUseCase);
71
+ return updateAutomationUseCase.execute(props);
72
+ }
73
+ async function getAutomationById(props) {
74
+ const getAutomationByIdUseCase = import_tsyringe.container.resolve(import_get_automation_by_id.GetAutomationByIdUseCase);
75
+ return getAutomationByIdUseCase.execute(props);
76
+ }
77
+ async function listAutomationsByUser(props) {
78
+ const listAutomationsByUserUseCase = import_tsyringe.container.resolve(import_list_automations_by_user.ListAutomationsByUserUseCase);
79
+ return listAutomationsByUserUseCase.execute(props);
80
+ }
81
+ async function deleteAutomation(props) {
82
+ const deleteAutomationUseCase = import_tsyringe.container.resolve(import_delete_automation.DeleteAutomationUseCase);
83
+ return deleteAutomationUseCase.execute(props);
84
+ }
85
+ async function previewAutomationRuns(props) {
86
+ const previewAutomationRunsUseCase = import_tsyringe.container.resolve(import_preview_automation_runs.PreviewAutomationRunsUseCase);
87
+ return previewAutomationRunsUseCase.execute(props);
88
+ }
89
+ async function listAutomationRunsByAutomation(props) {
90
+ const listAutomationRunsByAutomationUseCase = import_tsyringe.container.resolve(import_list_automation_runs_by_automation.ListAutomationRunsByAutomationUseCase);
91
+ return listAutomationRunsByAutomationUseCase.execute(props);
92
+ }
93
+ async function listAutomationRunsByUser(props) {
94
+ const listAutomationRunsByUserUseCase = import_tsyringe.container.resolve(import_list_automation_runs_by_user.ListAutomationRunsByUserUseCase);
95
+ return listAutomationRunsByUserUseCase.execute(props);
96
+ }
97
+ async function claimDueAutomations(props) {
98
+ const claimDueAutomationsUseCase = import_tsyringe.container.resolve(import_claim_due_automations.ClaimDueAutomationsUseCase);
99
+ return claimDueAutomationsUseCase.execute(props);
100
+ }
101
+ async function startAutomationRun(props) {
102
+ const startAutomationRunUseCase = import_tsyringe.container.resolve(import_start_automation_run.StartAutomationRunUseCase);
103
+ return startAutomationRunUseCase.execute(props);
104
+ }
105
+ async function finishAutomationRun(props) {
106
+ const finishAutomationRunUseCase = import_tsyringe.container.resolve(import_finish_automation_run.FinishAutomationRunUseCase);
107
+ return finishAutomationRunUseCase.execute(props);
108
+ }
109
+ async function syncAutomationRun(props) {
110
+ const syncAutomationRunUseCase = import_tsyringe.container.resolve(import_sync_automation_run.SyncAutomationRunUseCase);
111
+ return syncAutomationRunUseCase.execute(props);
112
+ }
113
+ async function syncAutomationRuns(props = {}) {
114
+ const syncAutomationRunsUseCase = import_tsyringe.container.resolve(import_sync_automation_runs.SyncAutomationRunsUseCase);
115
+ return syncAutomationRunsUseCase.execute(props);
116
+ }
117
+ async function attachAutomationRunChat(props) {
118
+ const attachAutomationRunChatUseCase = import_tsyringe.container.resolve(import_attach_automation_run_chat.AttachAutomationRunChatUseCase);
119
+ return attachAutomationRunChatUseCase.execute(props);
120
+ }
121
+ async function renewAutomationLease(props) {
122
+ const renewAutomationLeaseUseCase = import_tsyringe.container.resolve(import_renew_automation_lease.RenewAutomationLeaseUseCase);
123
+ return renewAutomationLeaseUseCase.execute(props);
124
+ }
125
+ async function issueAutomationEventToken(props) {
126
+ const issueAutomationEventTokenUseCase = import_tsyringe.container.resolve(import_issue_automation_event_token.IssueAutomationEventTokenUseCase);
127
+ return issueAutomationEventTokenUseCase.execute(props);
128
+ }
129
+ async function revokeAutomationEventToken(props) {
130
+ const revokeAutomationEventTokenUseCase = import_tsyringe.container.resolve(import_revoke_automation_event_token.RevokeAutomationEventTokenUseCase);
131
+ return revokeAutomationEventTokenUseCase.execute(props);
132
+ }
133
+ async function rotateAutomationEventTokens(props) {
134
+ const rotateAutomationEventTokensUseCase = import_tsyringe.container.resolve(import_rotate_automation_event_tokens.RotateAutomationEventTokensUseCase);
135
+ return rotateAutomationEventTokensUseCase.execute(props);
136
+ }
137
+ async function receiveAutomationEvent(props) {
138
+ const receiveAutomationEventUseCase = import_tsyringe.container.resolve(import_receive_automation_event.ReceiveAutomationEventUseCase);
139
+ return receiveAutomationEventUseCase.execute(props);
140
+ }
141
+ async function claimQueuedAutomationRuns(props) {
142
+ const claimQueuedAutomationRunsUseCase = import_tsyringe.container.resolve(import_claim_queued_automation_runs.ClaimQueuedAutomationRunsUseCase);
143
+ return claimQueuedAutomationRunsUseCase.execute(props);
144
+ }
145
+ // Annotate the CommonJS export names for ESM import in node:
146
+ 0 && (module.exports = {
147
+ attachAutomationRunChat,
148
+ claimDueAutomations,
149
+ claimQueuedAutomationRuns,
150
+ createAutomation,
151
+ deleteAutomation,
152
+ finishAutomationRun,
153
+ getAutomationById,
154
+ issueAutomationEventToken,
155
+ listAutomationRunsByAutomation,
156
+ listAutomationRunsByUser,
157
+ listAutomationsByUser,
158
+ previewAutomationRuns,
159
+ receiveAutomationEvent,
160
+ renewAutomationLease,
161
+ revokeAutomationEventToken,
162
+ rotateAutomationEventTokens,
163
+ startAutomationRun,
164
+ syncAutomationRun,
165
+ syncAutomationRuns,
166
+ updateAutomation
167
+ });