@elementumai/edk 0.9.2 → 0.9.5

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 (296) hide show
  1. package/README.md +34 -26
  2. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +1 -1
  3. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
  4. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
  5. package/dist-sdk/pull/util.d.ts +1 -1
  6. package/dist-sdk/pull/util.js +3 -3
  7. package/dist-sdk/src/catalog/factories.d.ts +49 -10
  8. package/dist-sdk/src/catalog/factories.js +94 -13
  9. package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
  10. package/dist-sdk/src/catalog/from-authoring.js +7 -7
  11. package/dist-sdk/src/catalog/index.d.ts +2 -2
  12. package/dist-sdk/src/catalog/index.js +1 -1
  13. package/dist-sdk/src/catalog/org.js +62 -4
  14. package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
  15. package/dist-sdk/src/catalog/render-helpers.js +1 -1
  16. package/dist-sdk/src/catalog/render.d.ts +1 -0
  17. package/dist-sdk/src/catalog/render.js +2 -2
  18. package/dist-sdk/src/catalog/token.js +11 -4
  19. package/dist-sdk/src/catalog/types.d.ts +33 -4
  20. package/dist-sdk/src/catalog/types.js +5 -0
  21. package/dist-sdk/src/core/index.d.ts +10 -10
  22. package/dist-sdk/src/core/index.js +9 -9
  23. package/dist-sdk/src/core/render-tree.d.ts +1 -1
  24. package/dist-sdk/src/core/render-tree.js +1 -2
  25. package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
  26. package/dist-sdk/src/core/types/ai-provider.js +1 -1
  27. package/dist-sdk/src/core/types/app.d.ts +66 -30
  28. package/dist-sdk/src/core/types/app.js +2 -2
  29. package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
  30. package/dist-sdk/src/core/types/aspect-category.js +4 -4
  31. package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
  32. package/dist-sdk/src/core/types/cloud-link.js +3 -3
  33. package/dist-sdk/src/core/types/display-block.d.ts +2 -2
  34. package/dist-sdk/src/core/types/display-block.js +2 -2
  35. package/dist-sdk/src/core/types/group.d.ts +1 -1
  36. package/dist-sdk/src/core/types/group.js +1 -1
  37. package/dist-sdk/src/core/types/user.d.ts +1 -1
  38. package/dist-sdk/src/core/types/user.js +1 -1
  39. package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
  40. package/dist-sdk/src/engine/build/context.d.ts +20 -13
  41. package/dist-sdk/src/engine/entity.d.ts +1 -1
  42. package/dist-sdk/src/engine/pull/context.d.ts +34 -0
  43. package/dist-sdk/src/engine/pull/context.js +14 -0
  44. package/dist-sdk/src/engine/pull/org.d.ts +9 -0
  45. package/dist-sdk/src/engine/pull/org.js +33 -0
  46. package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
  47. package/dist-sdk/src/engine/pull/ref-only.js +204 -0
  48. package/dist-sdk/src/engine/tf/expr.d.ts +6 -2
  49. package/dist-sdk/src/engine/tf/expr.js +18 -13
  50. package/dist-sdk/src/engine/tf/index.d.ts +1 -1
  51. package/dist-sdk/src/engine/tf/index.js +1 -1
  52. package/dist-sdk/src/engine/tf/model.d.ts +8 -1
  53. package/dist-sdk/src/engine/tf/model.js +4 -0
  54. package/dist-sdk/src/engine/tf/parse.js +13 -2
  55. package/dist-sdk/src/engine/tf/render.js +4 -0
  56. package/dist-sdk/src/entities/access-policy/build.d.ts +4 -5
  57. package/dist-sdk/src/entities/access-policy/build.js +1 -1
  58. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +4 -4
  59. package/dist-sdk/src/entities/access-policy/from-tf.js +12 -13
  60. package/dist-sdk/src/entities/access-policy/principal.d.ts +14 -4
  61. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +14 -2
  62. package/dist-sdk/src/entities/access-policy/to-tf.js +36 -6
  63. package/dist-sdk/src/entities/agent/build.d.ts +3 -3
  64. package/dist-sdk/src/entities/agent/build.js +5 -5
  65. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +6 -1
  66. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -18
  67. package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
  68. package/dist-sdk/src/entities/agent/from-tf.js +12 -4
  69. package/dist-sdk/src/entities/agent/index.d.ts +2 -2
  70. package/dist-sdk/src/entities/agent/index.js +1 -1
  71. package/dist-sdk/src/entities/agent/module.js +2 -0
  72. package/dist-sdk/src/entities/agent/to-tf.d.ts +5 -2
  73. package/dist-sdk/src/entities/agent/to-tf.js +56 -8
  74. package/dist-sdk/src/entities/agent/tools.d.ts +38 -23
  75. package/dist-sdk/src/entities/agent/tools.js +21 -7
  76. package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
  77. package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
  78. package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
  79. package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
  80. package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
  81. package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
  82. package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
  83. package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
  84. package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
  85. package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
  86. package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
  87. package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
  88. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -7
  89. package/dist-sdk/src/entities/agent-tool/from-tf.js +48 -6
  90. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +10 -2
  91. package/dist-sdk/src/entities/agent-tool/to-tf.js +76 -28
  92. package/dist-sdk/src/entities/agent-tool/types.d.ts +0 -1
  93. package/dist-sdk/src/entities/agent-tool/types.js +10 -37
  94. package/dist-sdk/src/entities/app/build.d.ts +97 -42
  95. package/dist-sdk/src/entities/app/build.js +25 -14
  96. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +32 -24
  97. package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +1 -1
  98. package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +2 -0
  99. package/dist-sdk/src/entities/app/index.d.ts +11 -8
  100. package/dist-sdk/src/entities/app/index.js +10 -7
  101. package/dist-sdk/src/entities/app/module.js +2 -2
  102. package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
  103. package/dist-sdk/src/entities/app/to-tf.js +22 -6
  104. package/dist-sdk/src/entities/approval-chain/build.d.ts +1 -1
  105. package/dist-sdk/src/entities/approval-chain/build.js +5 -5
  106. package/dist-sdk/src/entities/approval-chain/index.d.ts +1 -1
  107. package/dist-sdk/src/entities/approval-chain/index.js +1 -1
  108. package/dist-sdk/src/entities/approval-chain/printer.js +2 -2
  109. package/dist-sdk/src/entities/automation/build.d.ts +172 -94
  110. package/dist-sdk/src/entities/automation/build.js +159 -68
  111. package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
  112. package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
  113. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +11 -4
  114. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
  115. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +164 -198
  116. package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -2
  117. package/dist-sdk/src/entities/automation/from-tf.js +510 -80
  118. package/dist-sdk/src/entities/automation/index.d.ts +9 -12
  119. package/dist-sdk/src/entities/automation/index.js +11 -13
  120. package/dist-sdk/src/entities/automation/module.js +74 -6
  121. package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
  122. package/dist-sdk/src/entities/automation/operators.js +10 -37
  123. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
  124. package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
  125. package/dist-sdk/src/entities/automation/script-code.js +13 -22
  126. package/dist-sdk/src/entities/automation/serialize.js +1 -1
  127. package/dist-sdk/src/entities/automation/tasks.d.ts +153 -89
  128. package/dist-sdk/src/entities/automation/tasks.js +64 -11
  129. package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -1
  130. package/dist-sdk/src/entities/automation/to-tf.js +342 -71
  131. package/dist-sdk/src/entities/automation/triggers.d.ts +17 -10
  132. package/dist-sdk/src/entities/automation/triggers.js +7 -1
  133. package/dist-sdk/src/entities/automation/types.d.ts +3 -2
  134. package/dist-sdk/src/entities/automation/types.js +3 -2
  135. package/dist-sdk/src/entities/chart/build.d.ts +95 -0
  136. package/dist-sdk/src/entities/chart/build.js +42 -0
  137. package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
  138. package/dist-sdk/src/entities/chart/from-tf.js +269 -0
  139. package/dist-sdk/src/entities/chart/index.d.ts +4 -0
  140. package/dist-sdk/src/entities/chart/index.js +3 -0
  141. package/dist-sdk/src/entities/chart/module.d.ts +3 -0
  142. package/dist-sdk/src/entities/chart/module.js +61 -0
  143. package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
  144. package/dist-sdk/src/entities/chart/printer.js +104 -0
  145. package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
  146. package/dist-sdk/src/entities/chart/to-tf.js +150 -0
  147. package/dist-sdk/src/entities/chart/types.d.ts +53 -0
  148. package/dist-sdk/src/entities/chart/types.js +22 -0
  149. package/dist-sdk/src/entities/dashboard/build.d.ts +34 -7
  150. package/dist-sdk/src/entities/dashboard/build.js +16 -1
  151. package/dist-sdk/src/entities/dashboard/from-tf.js +22 -4
  152. package/dist-sdk/src/entities/dashboard/to-tf.d.ts +16 -3
  153. package/dist-sdk/src/entities/dashboard/to-tf.js +37 -10
  154. package/dist-sdk/src/entities/datamine/module.js +1 -1
  155. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +4 -3
  156. package/dist-sdk/src/entities/dynamic-layout/build.js +1 -1
  157. package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
  158. package/dist-sdk/src/entities/dynamic-layout/dialect.js +43 -5
  159. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +12 -6
  160. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +10 -10
  161. package/dist-sdk/src/entities/element/build.d.ts +25 -32
  162. package/dist-sdk/src/entities/element/build.js +15 -32
  163. package/dist-sdk/src/entities/element/index.d.ts +7 -5
  164. package/dist-sdk/src/entities/element/index.js +7 -4
  165. package/dist-sdk/src/entities/element/module.js +7 -3
  166. package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
  167. package/dist-sdk/src/entities/element/to-tf.js +7 -3
  168. package/dist-sdk/src/entities/field/build.d.ts +51 -24
  169. package/dist-sdk/src/entities/field/build.js +31 -6
  170. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
  171. package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
  172. package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
  173. package/dist-sdk/src/entities/field/calc/date.js +120 -29
  174. package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
  175. package/dist-sdk/src/entities/field/calc/index.js +82 -139
  176. package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
  177. package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
  178. package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
  179. package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
  180. package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
  181. package/dist-sdk/src/entities/field/calc/text.js +43 -31
  182. package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
  183. package/dist-sdk/src/entities/field/calc/types.js +1 -22
  184. package/dist-sdk/src/entities/field/calc.d.ts +71 -48
  185. package/dist-sdk/src/entities/field/calc.js +5 -15
  186. package/dist-sdk/src/entities/field/calculation-types.js +10 -3
  187. package/dist-sdk/src/entities/field/from-tf.js +156 -10
  188. package/dist-sdk/src/entities/field/locals.d.ts +11 -3
  189. package/dist-sdk/src/entities/field/locals.js +15 -2
  190. package/dist-sdk/src/entities/field/module.js +23 -6
  191. package/dist-sdk/src/entities/field/record-shape.d.ts +24 -10
  192. package/dist-sdk/src/entities/field/to-tf.d.ts +40 -1
  193. package/dist-sdk/src/entities/field/to-tf.js +293 -35
  194. package/dist-sdk/src/entities/field/types.d.ts +1 -1
  195. package/dist-sdk/src/entities/field/types.js +7 -1
  196. package/dist-sdk/src/entities/file-reader/build.d.ts +5 -0
  197. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +1 -1
  198. package/dist-sdk/src/entities/org/cloud-link.js +4 -5
  199. package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
  200. package/dist-sdk/src/entities/org/email-alias.js +12 -0
  201. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  202. package/dist-sdk/src/entities/org/index.js +1 -0
  203. package/dist-sdk/src/entities/org/phone-provider.js +4 -7
  204. package/dist-sdk/src/entities/organization/build.d.ts +214 -2
  205. package/dist-sdk/src/entities/organization/build.js +145 -4
  206. package/dist-sdk/src/entities/organization/index.d.ts +1 -1
  207. package/dist-sdk/src/entities/organization/index.js +1 -1
  208. package/dist-sdk/src/entities/organization/module.js +4 -1
  209. package/dist-sdk/src/entities/organization/to-tf.d.ts +1 -0
  210. package/dist-sdk/src/entities/organization/to-tf.js +118 -1
  211. package/dist-sdk/src/entities/phone-service/build.d.ts +1 -1
  212. package/dist-sdk/src/entities/phone-service/build.js +2 -2
  213. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +5 -3
  214. package/dist-sdk/src/entities/phone-service/index.d.ts +1 -1
  215. package/dist-sdk/src/entities/phone-service/index.js +1 -1
  216. package/dist-sdk/src/entities/phone-service/types.js +1 -1
  217. package/dist-sdk/src/entities/record-create-form/to-tf.js +9 -1
  218. package/dist-sdk/src/entities/relationship/to-tf.d.ts +1 -0
  219. package/dist-sdk/src/entities/relationship/to-tf.js +5 -13
  220. package/dist-sdk/src/entities/search-table/build.d.ts +4 -4
  221. package/dist-sdk/src/entities/search-table/build.js +13 -13
  222. package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
  223. package/dist-sdk/src/entities/search-table/index.js +2 -2
  224. package/dist-sdk/src/entities/search-table/printer.js +5 -5
  225. package/dist-sdk/src/entities/service-account/to-tf.d.ts +21 -0
  226. package/dist-sdk/src/entities/service-account/to-tf.js +32 -1
  227. package/dist-sdk/src/entities/shared/context.d.ts +25 -24
  228. package/dist-sdk/src/entities/shared/context.js +36 -35
  229. package/dist-sdk/src/entities/shared/filters/ast.d.ts +10 -3
  230. package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
  231. package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -1
  232. package/dist-sdk/src/entities/shared/filters/index.js +11 -4
  233. package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
  234. package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
  235. package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
  236. package/dist-sdk/src/entities/shared/ref.js +8 -3
  237. package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
  238. package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
  239. package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
  240. package/dist-sdk/src/entities/skill/build.d.ts +2 -2
  241. package/dist-sdk/src/entities/skill/build.js +3 -3
  242. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +1 -1
  243. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +26 -7
  244. package/dist-sdk/src/entities/skill/index.d.ts +1 -1
  245. package/dist-sdk/src/entities/skill/index.js +1 -1
  246. package/dist-sdk/src/entities/skill/module.js +2 -2
  247. package/dist-sdk/src/entities/skill/to-tf.d.ts +1 -1
  248. package/dist-sdk/src/entities/skill/to-tf.js +2 -2
  249. package/dist-sdk/src/entities/skill/tools.d.ts +4 -3
  250. package/dist-sdk/src/entities/skill/tools.js +4 -3
  251. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +13 -0
  252. package/dist-sdk/src/entities/skill-tool/from-tf.js +42 -0
  253. package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -6
  254. package/dist-sdk/src/entities/table/build.d.ts +1 -1
  255. package/dist-sdk/src/entities/table/build.js +9 -9
  256. package/dist-sdk/src/entities/table/catalog-render.js +9 -1
  257. package/dist-sdk/src/entities/table/deserializer/normalize.js +4 -4
  258. package/dist-sdk/src/entities/table/fields/types.d.ts +1 -1
  259. package/dist-sdk/src/entities/table/fields/types.js +1 -1
  260. package/dist-sdk/src/entities/table/index.d.ts +2 -2
  261. package/dist-sdk/src/entities/table/index.js +3 -3
  262. package/dist-sdk/src/entities/table/module.js +1 -1
  263. package/dist-sdk/src/entities/table/to-tf.js +22 -30
  264. package/dist-sdk/src/entities/task/build.d.ts +1 -1
  265. package/dist-sdk/src/entities/task/build.js +5 -5
  266. package/dist-sdk/src/entities/task/index.d.ts +1 -1
  267. package/dist-sdk/src/entities/task/index.js +1 -1
  268. package/dist-sdk/src/entities/view/build.d.ts +46 -0
  269. package/dist-sdk/src/entities/view/build.js +19 -0
  270. package/dist-sdk/src/entities/view/from-tf.js +68 -18
  271. package/dist-sdk/src/entities/view/module.d.ts +6 -13
  272. package/dist-sdk/src/entities/view/module.js +7 -14
  273. package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
  274. package/dist-sdk/src/entities/view/sharing.js +6 -0
  275. package/dist-sdk/src/entities/view/to-tf.d.ts +21 -19
  276. package/dist-sdk/src/entities/view/to-tf.js +61 -26
  277. package/dist-sdk/src/entities/view/types.js +3 -0
  278. package/dist-sdk/src/entities/visual-flow/build.d.ts +1 -1
  279. package/dist-sdk/src/entities/visual-flow/build.js +8 -8
  280. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
  281. package/dist-sdk/src/entities/visual-flow/index.js +1 -1
  282. package/dist-sdk/src/entities/visual-flow/module.js +1 -1
  283. package/dist-sdk/src/entities/visual-flow/printer.js +3 -3
  284. package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +1 -0
  285. package/dist-sdk/src/entities/visual-flow/to-tf.js +3 -7
  286. package/dist-sdk/src/entities/widget/to-tf.d.ts +1 -0
  287. package/dist-sdk/src/entities/widget/to-tf.js +9 -7
  288. package/dist-sdk/src/graph/index.d.ts +5 -1
  289. package/dist-sdk/src/graph/index.js +4 -1
  290. package/dist-sdk/src/graph/modules.js +6 -1
  291. package/dist-sdk/src/graph/types.d.ts +52 -1
  292. package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
  293. package/dist-sdk/src/internal/safe-identifier.js +13 -0
  294. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  295. package/dist-sdk/src/internal/sdk-package.js +1 -0
  296. package/package.json +12 -3
@@ -1,11 +1,12 @@
1
- import type { AutomationCatalogRef, CatalogRef } from "../../catalog/index.js";
1
+ import type { AppOrElementRef, AutomationCatalogRef } from "../../catalog/index.js";
2
+ import { type DeployableEntity, type EntityDeployOptions, type RecordFieldContext } from "../../engine/entity.js";
3
+ import type { RecordShape } from "../field/record-shape.js";
2
4
  import type { ServiceAccountRef } from "../service-account/ref.js";
3
- import { type Context } from "../shared/context.js";
5
+ import { type Context, type ForEachItem } from "../shared/context.js";
4
6
  import { type Ref, type Simplify, type ValueOrRef } from "../shared/ref.js";
5
- import { type DeployableEntity, type EntityDeployOptions, type RecordFieldContext } from "../../engine/entity.js";
6
7
  import type { Filter } from "./filter.js";
7
8
  import { type ScriptInput } from "./script-code.js";
8
- /** Structural empty object — neutral element for the `&`-accumulated task map. */
9
+ /** Structural empty object — neutral element for the accumulated action map. */
9
10
  type EmptyObject = {
10
11
  [K in never]: never;
11
12
  };
@@ -27,10 +28,10 @@ export interface TriggerDef<TOutput> {
27
28
  /** The owning app's refName, when this trigger's `record` output is app-field-typed. */
28
29
  readonly __recordApp?: string;
29
30
  }
30
- /** A named child task inside an operator (forEach/switch/forkJoin) branch. */
31
- export interface ChildTask {
31
+ /** A named nested action entry inside an operator (forEach/switch/forkJoin) branch. */
32
+ export interface NestedActionEntry {
32
33
  readonly name: string;
33
- readonly def: TaskDef<unknown>;
34
+ readonly def: ActionDef<unknown>;
34
35
  /** Display name distinct from `refKey` (`name`), when adopting a platform-authored task. */
35
36
  readonly displayName?: string;
36
37
  readonly hclParent?: string;
@@ -43,7 +44,7 @@ export interface ChildTask {
43
44
  export interface OperatorChild {
44
45
  readonly label: string | null;
45
46
  readonly filter?: Filter;
46
- readonly tasks: readonly ChildTask[];
47
+ readonly tasks: readonly NestedActionEntry[];
47
48
  /**
48
49
  * The switch default branch's actual display label, when it deviates from
49
50
  * the platform's usual "Default" (e.g. a manually renamed "Default Path").
@@ -63,18 +64,17 @@ export interface OperatorChild {
63
64
  readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
64
65
  }
65
66
  /**
66
- * A task definition produced by a factory. `key` is the one-of discriminator the
67
- * platform expects (e.g. `"recordSearch"`); `config` is that task's inner body
68
- * (minus `name`, which the builder injects from the `.task(name, …)` call —
69
- * mirroring v1, where the task name lives inside the body). The wire task becomes
67
+ * An action definition produced by an internal or nested-action factory. `key`
68
+ * is the platform one-of discriminator (e.g. `"recordSearch"`); `config` is
69
+ * the action's inner body. The wire task becomes
70
70
  * `{ [key]: { name, ...config } }`. Operators additionally carry
71
71
  * `operatorChildren`, emitted as the wire task's `children`.
72
72
  */
73
- export interface TaskDef<TOutput> {
73
+ export interface ActionDef<TOutput> {
74
74
  readonly key: string;
75
75
  readonly config: Record<string, unknown>;
76
76
  readonly operatorChildren?: readonly OperatorChild[];
77
- /** Phantom — the typed shape exposed as `ctx.tasks.<name>`. */
77
+ /** Phantom — the typed shape exposed as `ctx.actions.<name>`. */
78
78
  readonly __output?: TOutput;
79
79
  /** The owning app's refName, when this task's `record`/`records` output is app-field-typed. */
80
80
  readonly __recordApp?: string;
@@ -82,11 +82,11 @@ export interface TaskDef<TOutput> {
82
82
  /** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
83
83
  export declare const FOR_EACH_PLACEHOLDER = "__forEach__";
84
84
  /**
85
- * The finalized workflow body `defineAutomation` embeds — the wire trigger, the
86
- * serialized task list, and the optional output properties. Produced by
87
- * {@link WorkflowChain.__finalize}; not authored by hand.
85
+ * The finalized automation body `automation` embeds — the wire trigger,
86
+ * serialized platform task list, and optional output properties. Produced by
87
+ * {@link ActionChain.__finalize}; not authored by hand.
88
88
  */
89
- export interface WorkflowDef {
89
+ export interface ActionSequenceDef {
90
90
  readonly trigger: unknown;
91
91
  readonly tasks: Record<string, unknown>[];
92
92
  readonly outputProperties?: {
@@ -95,19 +95,19 @@ export interface WorkflowDef {
95
95
  value: unknown;
96
96
  }>;
97
97
  };
98
- /** See {@link RecordFieldContext}. Omitted when no trigger/task in this workflow is record-bearing. */
98
+ /** See {@link RecordFieldContext}. Omitted when no trigger/action in this automation is record-bearing. */
99
99
  readonly recordFieldContext?: RecordFieldContext;
100
100
  }
101
101
  /**
102
- * The minimal contract `defineAutomation`'s `workflow:` field accepts: anything
103
- * that can finalize itself to a {@link WorkflowDef}. A `defineWorkflow()` chain
104
- * satisfies this once a trigger is set ({@link WorkflowBuilder}). The pre-trigger
105
- * stage ({@link WorkflowStarted}) does not, so a triggerless workflow is a
102
+ * The minimal contract `automation`'s `actions:` field accepts: anything
103
+ * that can finalize itself to a {@link ActionSequenceDef}. A `actions()` chain
104
+ * satisfies this once a trigger is set ({@link ActionBuilder}). The pre-trigger
105
+ * stage ({@link ActionsStarted}) does not, so a triggerless automation is a
106
106
  * compile error at the assignment.
107
107
  */
108
- export interface WorkflowChain {
109
- /** @internal — consumed by `defineAutomation`; not part of the authoring API. */
110
- __finalize(): WorkflowDef;
108
+ export interface ActionChain {
109
+ /** @internal — consumed by `automation`; not part of the authoring API. */
110
+ __finalize(): ActionSequenceDef;
111
111
  /** @internal — onDemand parameter metadata; empty for non-onDemand triggers. */
112
112
  __triggerParams(): readonly TriggerParamMeta[];
113
113
  /** @internal — output property names declared via `.outputs()`; empty if none. */
@@ -119,38 +119,26 @@ type OutputValue = Ref<unknown> | string | number | boolean | null;
119
119
  type ResolvedRefs<I> = {
120
120
  [K in keyof I]: I[K] extends Ref<infer T> ? T : I[K];
121
121
  };
122
+ /** Static options or options computed from the typed outputs available so far. */
123
+ export type ActionOptions<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TOptions> = TOptions | ((ctx: Context<TTrigger, TActions, TVars>) => TOptions);
124
+ /** One context object for nested actions; forEach bodies add the current item. */
125
+ export type NestedActionContext<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = Context<TTrigger, TActions, TVars> & ([TItem] extends [never] ? Record<never, never> : {
126
+ readonly item: ForEachItem<TItem>;
127
+ });
128
+ type BuilderActionOptions<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem, TOptions> = TOptions | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => TOptions);
129
+ type BuilderMode = "root" | "nested";
130
+ type WithAction<TMode extends BuilderMode, TItem, TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TName extends string, TOutput> = FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, TOutput>>, TVars>;
122
131
  /**
123
- * A workflow with a trigger set. `.task()` accumulates typed task outputs;
124
- * `.outputs()` declares the automation-level output properties (optional).
125
- * Assign the chain straight to `defineAutomation`'s `workflow:` field.
126
- *
127
- * v3 fluent surface: trigger factories return this builder directly
128
- * (`onDemand({...}).executeScript(...)`), and the Phase-1 task kinds have
129
- * dedicated methods whose options take ctx-lambdas. The generic `.task()` stays
130
- * as the escape hatch for every other kind.
132
+ * An automation body with a trigger set. Every implemented platform action is
133
+ * exposed as a direct method; there is intentionally no generic escape hatch.
134
+ * Options may be passed directly or returned from a typed context callback.
131
135
  */
132
- /** Reject `executeScript` TaskDefs through generic `.task()` — use fluent `.executeScript`. */
133
- type NotExecuteScriptTask<D> = D extends {
134
- readonly key: "executeScript";
135
- } ? never : D;
136
- export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject> extends WorkflowChain {
136
+ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject, TMode extends BuilderMode = "root", TItem = never> {
137
137
  /**
138
- * Generic task escape hatch for every kind except `executeScript` — use
139
- * {@link WorkflowBuilder.executeScript} for scripts (function-form `code`).
140
- */
141
- task<TName extends string, TOutput>(name: TName, fn: (ctx: Context<TTrigger, TTasks, TVars>) => NotExecuteScriptTask<TaskDef<TOutput>>,
142
- /**
143
- * Display name distinct from `refKey` — only needed when adopting a
144
- * platform-authored task whose wire `name` differs from its `refKey`
145
- * (e.g. a UI-built "For Each" task, whose slugged refKey is "For_Each").
146
- * Omit for normally-authored tasks; the wire name defaults to `refKey`.
147
- */
148
- displayName?: string, hclParent?: "trigger" | string): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, TOutput>>, TVars>;
149
- /**
150
- * Fluent executeScript (v3). `inputs` is a ctx-lambda mapping input names to
138
+ * `inputs` is a ctx-lambda mapping input names to
151
139
  * refs/values; `code` is ALWAYS a FUNCTION — the TS contract is the
152
140
  * authoring surface (typed `input.parameters` from `inputs`; the return
153
- * type flows to `ctx.tasks.<name>.result.*` downstream; no raw-string
141
+ * type flows to `ctx.actions.<name>.result.*` downstream; no raw-string
154
142
  * alternative — #125). Under `elementum build`, the body ships byte-exact
155
143
  * from the automation file's own untranspiled source (see
156
144
  * `tryExtractFromCurrentSource` in `script-code.ts`) rather than from the
@@ -164,13 +152,13 @@ export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown
164
152
  * text). Pass `outputs` only to override: a non-text property whose value
165
153
  * isn't a literal, or a return the scan can't enumerate. Pass `outputs:
166
154
  * null` (rather than omitting it) to explicitly suppress inference — the
167
- * printer does this for pulled tasks whose platform resource genuinely
155
+ * printer does this for pulled actions whose platform resource genuinely
168
156
  * carries no `output_schema`, so a rebuild doesn't invent one and drift
169
157
  * from state.
170
158
  */
171
- executeScript<TName extends string, I extends Record<string, ValueOrRef<unknown>> = Record<string, never>, R extends Record<string, unknown> = Record<string, unknown>>(name: TName, opts: {
172
- readonly inputs?: (ctx: Context<TTrigger, TTasks, TVars>) => I;
173
- readonly code: (input: ScriptInput<ResolvedRefs<I>>) => R;
159
+ executeScript<TName extends string, I extends Record<string, ValueOrRef<unknown>>, R extends Record<string, unknown> = Record<string, unknown>>(name: TName, opts: {
160
+ readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
161
+ readonly code: (input: ScriptInput<ResolvedRefs<NoInfer<I>>>) => R;
174
162
  /**
175
163
  * Override the inferred output schema: property name → `"text" |
176
164
  * "integer" | "number" | "decimal" | "boolean"`. `null` explicitly
@@ -178,73 +166,163 @@ export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown
178
166
  * infers from the code body.
179
167
  */
180
168
  readonly outputs?: Record<string, string> | null;
181
- }): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, {
169
+ }, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
182
170
  result: R;
183
171
  textResult: string;
184
- }>>, TVars>;
172
+ }>;
185
173
  /**
186
- * Fluent setVariable (v3): one variable, NAMED THE SAME as its task — read
174
+ * Fluent setVariable: one variable, named the same as its action — read
187
175
  * it downstream as `ctx.variables.<name>`, the variable's typed ref
188
176
  * (`Ref<string>` for the default TEXT type). (The variable name is
189
- * platform-visible and must be workflow-unique — ei's export resolves
190
- * variable refs by name per workflow — so it mirrors the task name rather
177
+ * platform-visible and must be automation-unique — ei's export resolves
178
+ * variable refs by name per automation — so it mirrors the action name rather
191
179
  * than a fixed "value".) `value` is a ctx-lambda returning a ref, template,
192
180
  * or literal (`(ctx) => "static"` for constants — the lambda form keeps
193
181
  * `ctx` fully typed; a bare `ValueOrRef<unknown>` union would collapse to
194
182
  * `unknown` and erase it).
195
183
  */
196
184
  setVariable<TName extends string, TType extends string = "TEXT">(name: TName, opts: {
197
- readonly value: (ctx: Context<TTrigger, TTasks, TVars>) => ValueOrRef<unknown>;
185
+ readonly value: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => ValueOrRef<unknown>;
198
186
  /** Platform variable type (default "TEXT"). */
199
187
  readonly type?: TType;
200
- }): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, Record<string, never>>>, Simplify<TVars & Record<TName, VariableValueOf<TType>>>>;
201
- /**
202
- * Declare the workflow's output properties — a map of output name → value,
203
- * where each value is a typed ctx ref (`ctx.tasks.x.y`, `ctx.trigger.z`) or a
204
- * literal. The ctx sees the trigger and every task, since outputs are read
205
- * after the workflow runs.
206
- */
207
- outputs(fn: (ctx: Context<TTrigger, TTasks, TVars>) => Record<string, OutputValue>): WorkflowBuilder<TTrigger, TTasks, TVars>;
188
+ }, displayName?: string, hclParent?: "trigger" | string): FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, Record<string, never>>>, Simplify<TVars & Record<TName, VariableValueOf<TType>>>>;
189
+ setVariable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SetVariableOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
190
+ recordSearch<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
191
+ tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").TableRecordsSearchOutput<A>>;
192
+ createRecord<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CreateRecordOutput<A>>;
193
+ updateField<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
194
+ record: RecordShape<A>;
195
+ }>;
196
+ findRelatedRecords<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
197
+ relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
198
+ sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
199
+ postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
200
+ notification<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").NotificationOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
201
+ aiAgent<TName extends string, const S extends Record<string, import("./tasks.js").AiAgentOutputField> | undefined = undefined>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiAgentOptions<S>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiAgentOutput<S>>;
202
+ aiClassify<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiClassifyOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
203
+ output: unknown;
204
+ }>;
205
+ aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
206
+ output: unknown;
207
+ }>;
208
+ aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
209
+ output: unknown;
210
+ }>;
211
+ aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiSearchTableOutput>;
212
+ aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
213
+ output: unknown;
214
+ }>;
215
+ apiRequest<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApiRequestOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
216
+ response: unknown;
217
+ }>;
218
+ calculation<TName extends string, const Values extends import("./tasks.js").CalculationValues>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CalculationOptions<Values>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationValueOutputs<Values>>;
219
+ calculation<TName extends string, const Entries extends readonly import("./tasks.js").CalculationEntry[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyCalculationOptions<Entries>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationOutputs<Entries>>;
220
+ procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ProcedureOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
221
+ output: unknown;
222
+ }>;
223
+ runAutomation<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RunAutomationOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
224
+ output: unknown;
225
+ }>;
226
+ readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
227
+ output: unknown;
228
+ }>;
229
+ approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
230
+ approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
231
+ addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
232
+ saveAttachment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SaveAttachmentOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
233
+ userSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserSearchOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput>;
234
+ initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
235
+ recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
236
+ forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
237
+ switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
238
+ forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
239
+ }
240
+ /** Internal finalizer returned by every operator-body builder. */
241
+ export interface NestedActionChain {
242
+ /** @internal — consumed by the enclosing operator. */
243
+ __children(): readonly NestedActionEntry[];
244
+ }
245
+ type FluentActionBuilder<TMode extends BuilderMode, TItem, TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>> = TMode extends "root" ? ActionBuilder<TTrigger, TActions, TVars> : NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
246
+ /** Top-level automation action chain. */
247
+ export type ActionBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject> = ActionMethods<TTrigger, TActions, TVars, "root", never> & ActionChain & {
248
+ outputs(fn: (ctx: Context<TTrigger, TActions, TVars>) => Record<string, OutputValue>): ActionBuilder<TTrigger, TActions, TVars>;
249
+ };
250
+ /** Fluent actions inside one operator body or branch. */
251
+ export type NestedActionBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject, TItem = never> = ActionMethods<TTrigger, TActions, TVars, "nested", TItem> & NestedActionChain;
252
+ /** A forEach body builder. Its action context adds `ctx.item`. */
253
+ export type ForEachBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
254
+ /** A switch-case/default body builder. */
255
+ export type SwitchCaseBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
256
+ /** A forkJoin branch body builder. */
257
+ export type ForkJoinBranchBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
258
+ export interface ForEachConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TEnclosingItem, TItem> {
259
+ readonly collection: Ref<readonly TItem[]> | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TEnclosingItem>) => Ref<readonly TItem[]>);
260
+ readonly actions: (actions: ForEachBuilder<TTrigger, TActions, TVars, NoInfer<TItem>>) => NestedActionChain;
261
+ }
262
+ export interface SwitchCase<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
263
+ readonly label: string;
264
+ readonly condition?: Filter;
265
+ readonly actions: (actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
266
+ }
267
+ export interface SwitchConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
268
+ readonly cases: readonly SwitchCase<TTrigger, TActions, TVars, TItem>[];
269
+ readonly defaultActions?: ((actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain) | {
270
+ readonly label?: string;
271
+ readonly actions: (actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
272
+ readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
273
+ };
274
+ }
275
+ export interface ForkJoinBranch<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
276
+ readonly label: string;
277
+ readonly actions: (actions: ForkJoinBranchBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
278
+ }
279
+ export interface ForkJoinConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
280
+ readonly branches: readonly ForkJoinBranch<TTrigger, TActions, TVars, TItem>[];
208
281
  }
209
282
  /** Platform variable type → the TS value type its `ctx.variables.<name>` ref carries. */
210
283
  type VariableValueOf<T extends string> = T extends "TEXT" ? string : T extends "NUMBER" | "DECIMAL" | "INTEGER" ? number : T extends "BOOLEAN" ? boolean : unknown;
211
- /** The pre-trigger stage — a trigger must be set before tasks or outputs. */
212
- export interface WorkflowStarted {
213
- trigger<TOutput>(trigger: TriggerDef<TOutput>): WorkflowBuilder<TOutput, EmptyObject>;
284
+ /** The pre-trigger stage — a trigger must be set before actions or outputs. */
285
+ export interface ActionsStarted {
286
+ trigger<TOutput>(trigger: TriggerDef<TOutput>): ActionBuilder<TOutput, EmptyObject>;
214
287
  }
215
288
  /**
216
- * A trigger that is ALSO the start of a workflow chain (v3): assign it to
217
- * `workflow:` and chain tasks directly — `onDemand({}).executeScript(...)` —
218
- * or keep the legacy `defineWorkflow().trigger(...)` form; both accept it.
289
+ * A trigger that is also the start of an action chain: assign it to `actions:`
290
+ * and chain methods directly, or use `actions().trigger(...)`.
219
291
  */
220
- export type TriggerChain<TOutput> = TriggerDef<TOutput> & WorkflowBuilder<TOutput, EmptyObject>;
292
+ export type TriggerChain<TOutput> = TriggerDef<TOutput> & ActionBuilder<TOutput, EmptyObject>;
221
293
  /** Wrap a TriggerDef so it doubles as the chain start. Used by the trigger factories. */
222
294
  export declare function chainableTrigger<TOutput>(trigger: TriggerDef<TOutput>): TriggerChain<TOutput>;
223
295
  /**
224
- * Begin a workflow body. Set a trigger, chain `.task(...)`, optionally close
225
- * with `.outputs(...)`, then assign the result to `defineAutomation`'s
226
- * `workflow:` field — no terminal `.build()`.
296
+ * Begin an automation body. Set a trigger, chain direct action methods,
297
+ * optionally close with `.outputs()`, then assign it to `actions:`.
227
298
  */
228
- export declare function defineWorkflow(): WorkflowStarted;
229
- export interface AutomationV2Options extends EntityDeployOptions {
299
+ export declare function actions(): ActionsStarted;
300
+ /** User-authorable automation lifecycle states. */
301
+ export declare const automationStatus: {
302
+ readonly draft: "DRAFT";
303
+ readonly inactive: "INACTIVE";
304
+ readonly active: "ACTIVE";
305
+ };
306
+ export type AutomationStatus = (typeof automationStatus)[keyof typeof automationStatus];
307
+ export interface AutomationOptions extends EntityDeployOptions {
230
308
  /** The automation's display name. Changing it updates the existing automation. */
231
309
  readonly name: string;
232
- /** Explicit SemVer publish gate. Bump only when this workflow should become live. */
233
- readonly workflowRevision: string;
310
+ /** Explicit SemVer publish gate. Bump only when this automation should become live. */
311
+ readonly revision: string;
234
312
  /** Optional platform description, preserved by the Terraform authoring path. */
235
313
  readonly description?: string;
236
- /** Whether this workflow may trigger other automations. */
314
+ /** Whether this automation may trigger other automations. */
237
315
  readonly triggersOtherAutomations?: boolean;
238
- /** The app that owns this automation. */
239
- readonly app: CatalogRef<"app">;
240
- readonly status?: "DRAFT" | "INACTIVE" | "ACTIVE";
241
- /** App-owned identity used to execute this workflow. */
316
+ /** The app or element that owns this automation. */
317
+ readonly app: AppOrElementRef;
318
+ readonly status?: AutomationStatus;
319
+ /** App-owned identity used to execute this automation. */
242
320
  readonly serviceAccount?: ServiceAccountRef;
243
- /** The workflow body — a `defineWorkflow()` chain with a trigger set. */
244
- readonly workflow: WorkflowChain;
321
+ /** The trigger plus fluent action chain. */
322
+ readonly actions: ActionChain;
245
323
  }
246
324
  /**
247
- * The configured result of `defineAutomation` — its reference surface (`ref()`)
325
+ * The configured result of `automation` — its reference surface (`ref()`)
248
326
  * and its deployable entity (`def()`). Both take `refName` as a **call-time
249
327
  * argument** (the file's own name, never stored on the entity) — see
250
328
  * `AppConfigured` in `src/aspects/build.ts` for the design rationale.
@@ -259,5 +337,5 @@ export interface AutomationConfigured {
259
337
  * automation plans as an update rather than a create. Returns an
260
338
  * `AutomationConfigured` with `ref(refName)` and `def(refName)`.
261
339
  */
262
- export declare function defineAutomation(opts: AutomationV2Options): AutomationConfigured;
340
+ export declare function automation(opts: AutomationOptions): AutomationConfigured;
263
341
  export {};