@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1

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 (390) hide show
  1. package/README.md +462 -3
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
  3. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
  4. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
  5. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
  6. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
  7. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
  8. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
  9. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
  10. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
  11. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
  12. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
  13. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
  14. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
  15. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
  16. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
  17. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
  18. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
  19. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
  20. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
  21. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
  22. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
  23. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
  24. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
  25. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
  26. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
  27. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
  28. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
  29. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
  30. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
  31. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
  32. package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
  33. package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
  34. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
  35. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
  36. package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
  37. package/dist-sdk/elementum-entity-client/errors.js +111 -0
  38. package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
  39. package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
  40. package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
  41. package/dist-sdk/elementum-entity-client/types.js +1 -0
  42. package/dist-sdk/fs/entity.d.ts +104 -0
  43. package/dist-sdk/fs/entity.js +52 -0
  44. package/dist-sdk/pull/util.d.ts +130 -0
  45. package/dist-sdk/pull/util.js +204 -0
  46. package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
  47. package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
  48. package/dist-sdk/src/catalog/factories.d.ts +242 -0
  49. package/dist-sdk/src/catalog/factories.js +265 -0
  50. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  51. package/dist-sdk/src/catalog/from-authoring.js +467 -0
  52. package/dist-sdk/src/catalog/index.d.ts +12 -0
  53. package/dist-sdk/src/catalog/index.js +12 -0
  54. package/dist-sdk/src/catalog/org.d.ts +11 -0
  55. package/dist-sdk/src/catalog/org.js +288 -0
  56. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  57. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  58. package/dist-sdk/src/catalog/render.d.ts +48 -0
  59. package/dist-sdk/src/catalog/render.js +193 -0
  60. package/dist-sdk/src/catalog/token.d.ts +10 -0
  61. package/dist-sdk/src/catalog/token.js +76 -0
  62. package/dist-sdk/src/catalog/types.d.ts +215 -0
  63. package/dist-sdk/src/catalog/types.js +86 -0
  64. package/dist-sdk/src/catalog/write.d.ts +43 -0
  65. package/dist-sdk/src/catalog/write.js +109 -0
  66. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  67. package/dist-sdk/src/core/app-to-ui.js +75 -0
  68. package/dist-sdk/src/core/index.d.ts +10 -0
  69. package/dist-sdk/src/core/index.js +9 -0
  70. package/dist-sdk/src/core/system-fields.d.ts +95 -0
  71. package/dist-sdk/src/core/system-fields.js +153 -0
  72. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  73. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  74. package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
  75. package/dist-sdk/src/core/types/ai-provider.js +8 -0
  76. package/dist-sdk/src/core/types/app.d.ts +857 -0
  77. package/dist-sdk/src/core/types/app.js +210 -0
  78. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  79. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  80. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  81. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  82. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  83. package/dist-sdk/src/core/types/display-block.js +61 -0
  84. package/dist-sdk/src/core/types/group.d.ts +13 -0
  85. package/dist-sdk/src/core/types/group.js +6 -0
  86. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  87. package/dist-sdk/src/core/types/platform.js +1 -0
  88. package/dist-sdk/src/core/types/user.d.ts +20 -0
  89. package/dist-sdk/src/core/types/user.js +8 -0
  90. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  91. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  92. package/dist-sdk/src/engine/build/context.d.ts +67 -0
  93. package/dist-sdk/src/engine/build/context.js +6 -0
  94. package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
  95. package/dist-sdk/src/engine/build/source-context.js +23 -0
  96. package/dist-sdk/src/engine/entity.d.ts +44 -0
  97. package/dist-sdk/src/engine/entity.js +15 -0
  98. package/dist-sdk/src/engine/pull/context.d.ts +38 -0
  99. package/dist-sdk/src/engine/pull/context.js +44 -0
  100. package/dist-sdk/src/engine/pull/org.d.ts +54 -0
  101. package/dist-sdk/src/engine/pull/org.js +134 -0
  102. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  103. package/dist-sdk/src/engine/tf/escape.js +28 -0
  104. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  105. package/dist-sdk/src/engine/tf/expr.js +405 -0
  106. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  107. package/dist-sdk/src/engine/tf/index.js +11 -0
  108. package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
  109. package/dist-sdk/src/engine/tf/labels.js +196 -0
  110. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  111. package/dist-sdk/src/engine/tf/model.js +49 -0
  112. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  113. package/dist-sdk/src/engine/tf/parse.js +189 -0
  114. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  115. package/dist-sdk/src/engine/tf/render.js +102 -0
  116. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  117. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  118. package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
  119. package/dist-sdk/src/entities/access-policy/build.js +7 -0
  120. package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
  121. package/dist-sdk/src/entities/access-policy/filter.js +83 -0
  122. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
  123. package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
  124. package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
  125. package/dist-sdk/src/entities/access-policy/module.js +17 -0
  126. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
  127. package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
  128. package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
  129. package/dist-sdk/src/entities/access-policy/types.js +10 -0
  130. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  131. package/dist-sdk/src/entities/agent/build.js +148 -0
  132. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
  133. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
  134. package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
  135. package/dist-sdk/src/entities/agent/from-tf.js +289 -0
  136. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  137. package/dist-sdk/src/entities/agent/index.js +7 -0
  138. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  139. package/dist-sdk/src/entities/agent/module.js +122 -0
  140. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  141. package/dist-sdk/src/entities/agent/to-tf.js +188 -0
  142. package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
  143. package/dist-sdk/src/entities/agent/tools.js +238 -0
  144. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
  145. package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
  146. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  147. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  148. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
  149. package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
  150. package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
  151. package/dist-sdk/src/entities/agent-tool/types.js +102 -0
  152. package/dist-sdk/src/entities/app/build.d.ts +368 -0
  153. package/dist-sdk/src/entities/app/build.js +372 -0
  154. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
  155. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  156. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  157. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  158. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  159. package/dist-sdk/src/entities/app/from-tf.js +197 -0
  160. package/dist-sdk/src/entities/app/index.d.ts +14 -0
  161. package/dist-sdk/src/entities/app/index.js +11 -0
  162. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  163. package/dist-sdk/src/entities/app/locals.js +31 -0
  164. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  165. package/dist-sdk/src/entities/app/module.js +66 -0
  166. package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
  167. package/dist-sdk/src/entities/app/to-tf.js +212 -0
  168. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  169. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  170. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  171. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  172. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  173. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  174. package/dist-sdk/src/entities/automation/build.d.ts +259 -0
  175. package/dist-sdk/src/entities/automation/build.js +436 -0
  176. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  177. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  178. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
  179. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  180. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
  181. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
  182. package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
  183. package/dist-sdk/src/entities/automation/filter.js +156 -0
  184. package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
  185. package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
  186. package/dist-sdk/src/entities/automation/index.d.ts +22 -0
  187. package/dist-sdk/src/entities/automation/index.js +25 -0
  188. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  189. package/dist-sdk/src/entities/automation/module.js +150 -0
  190. package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
  191. package/dist-sdk/src/entities/automation/operators.js +69 -0
  192. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
  193. package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
  194. package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
  195. package/dist-sdk/src/entities/automation/script-code.js +633 -0
  196. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  197. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  198. package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
  199. package/dist-sdk/src/entities/automation/tasks.js +765 -0
  200. package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
  201. package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
  202. package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
  203. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  204. package/dist-sdk/src/entities/automation/types.d.ts +78 -0
  205. package/dist-sdk/src/entities/automation/types.js +131 -0
  206. package/dist-sdk/src/entities/element/build.d.ts +121 -0
  207. package/dist-sdk/src/entities/element/build.js +110 -0
  208. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  209. package/dist-sdk/src/entities/element/from-tf.js +170 -0
  210. package/dist-sdk/src/entities/element/index.d.ts +12 -0
  211. package/dist-sdk/src/entities/element/index.js +10 -0
  212. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  213. package/dist-sdk/src/entities/element/locals.js +12 -0
  214. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  215. package/dist-sdk/src/entities/element/module.js +65 -0
  216. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  217. package/dist-sdk/src/entities/element/to-tf.js +169 -0
  218. package/dist-sdk/src/entities/field/build.d.ts +112 -0
  219. package/dist-sdk/src/entities/field/build.js +84 -0
  220. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  221. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  222. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  223. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  224. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  225. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  226. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  227. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  228. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  229. package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
  230. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  231. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  232. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  233. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  234. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  235. package/dist-sdk/src/entities/field/calc.js +54 -0
  236. package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
  237. package/dist-sdk/src/entities/field/from-tf.js +184 -0
  238. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  239. package/dist-sdk/src/entities/field/locals.js +24 -0
  240. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  241. package/dist-sdk/src/entities/field/module.js +50 -0
  242. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  243. package/dist-sdk/src/entities/field/options.js +76 -0
  244. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  245. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  246. package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
  247. package/dist-sdk/src/entities/field/to-tf.js +142 -0
  248. package/dist-sdk/src/entities/field/types.d.ts +53 -0
  249. package/dist-sdk/src/entities/field/types.js +68 -0
  250. package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
  251. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  252. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
  253. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
  254. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
  255. package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
  256. package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
  257. package/dist-sdk/src/entities/file-reader/index.js +10 -0
  258. package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
  259. package/dist-sdk/src/entities/file-reader/module.js +115 -0
  260. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
  261. package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
  262. package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
  263. package/dist-sdk/src/entities/file-reader/types.js +30 -0
  264. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  265. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  266. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  267. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  268. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  269. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  270. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  271. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  272. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  273. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  274. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  275. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  276. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  277. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  278. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  279. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  280. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  281. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  282. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  283. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  284. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  285. package/dist-sdk/src/entities/flow/build.js +115 -0
  286. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  287. package/dist-sdk/src/entities/flow/index.js +7 -0
  288. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  289. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  290. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  291. package/dist-sdk/src/entities/flow/util.js +38 -0
  292. package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
  293. package/dist-sdk/src/entities/org/ai-provider.js +46 -0
  294. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  295. package/dist-sdk/src/entities/org/category.js +33 -0
  296. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  297. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  298. package/dist-sdk/src/entities/org/connector.d.ts +12 -0
  299. package/dist-sdk/src/entities/org/connector.js +35 -0
  300. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  301. package/dist-sdk/src/entities/org/group.js +40 -0
  302. package/dist-sdk/src/entities/org/index.d.ts +11 -0
  303. package/dist-sdk/src/entities/org/index.js +11 -0
  304. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  305. package/dist-sdk/src/entities/org/role.js +21 -0
  306. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  307. package/dist-sdk/src/entities/org/user.js +30 -0
  308. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  309. package/dist-sdk/src/entities/search-table/build.js +79 -0
  310. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  311. package/dist-sdk/src/entities/search-table/index.js +5 -0
  312. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  313. package/dist-sdk/src/entities/search-table/module.js +64 -0
  314. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  315. package/dist-sdk/src/entities/shared/context.js +156 -0
  316. package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
  317. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  318. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  319. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  320. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  321. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  322. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  323. package/dist-sdk/src/entities/shared/ref.js +119 -0
  324. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
  325. package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
  326. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  327. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  328. package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
  329. package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
  330. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  331. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  332. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  333. package/dist-sdk/src/entities/skill/build.js +50 -0
  334. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
  335. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
  336. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  337. package/dist-sdk/src/entities/skill/from-tf.js +96 -0
  338. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  339. package/dist-sdk/src/entities/skill/index.js +7 -0
  340. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  341. package/dist-sdk/src/entities/skill/module.js +111 -0
  342. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  343. package/dist-sdk/src/entities/skill/to-tf.js +59 -0
  344. package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
  345. package/dist-sdk/src/entities/skill/tools.js +105 -0
  346. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
  347. package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
  348. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  349. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  350. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
  351. package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
  352. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  353. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  354. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  355. package/dist-sdk/src/entities/table/build.js +339 -0
  356. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  357. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  358. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  359. package/dist-sdk/src/entities/table/fields.js +70 -0
  360. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  361. package/dist-sdk/src/entities/table/filter.js +89 -0
  362. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  363. package/dist-sdk/src/entities/table/index.js +12 -0
  364. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  365. package/dist-sdk/src/entities/table/joins.js +31 -0
  366. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  367. package/dist-sdk/src/entities/table/keys.js +25 -0
  368. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  369. package/dist-sdk/src/entities/table/module.js +25 -0
  370. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  371. package/dist-sdk/src/entities/table/state.js +43 -0
  372. package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
  373. package/dist-sdk/src/entities/view/from-tf.js +235 -0
  374. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  375. package/dist-sdk/src/entities/view/module.js +61 -0
  376. package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
  377. package/dist-sdk/src/entities/view/to-tf.js +171 -0
  378. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  379. package/dist-sdk/src/entities/view/types.js +89 -0
  380. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
  381. package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
  382. package/dist-sdk/src/graph/index.d.ts +91 -0
  383. package/dist-sdk/src/graph/index.js +211 -0
  384. package/dist-sdk/src/graph/modules.d.ts +7 -0
  385. package/dist-sdk/src/graph/modules.js +42 -0
  386. package/dist-sdk/src/graph/types.d.ts +375 -0
  387. package/dist-sdk/src/graph/types.js +102 -0
  388. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  389. package/dist-sdk/src/internal/sdk-package.js +23 -0
  390. package/package.json +201 -8
@@ -0,0 +1,22 @@
1
+ export { automationFromTf, type AutomationFromTfResult } from "./from-tf.js";
2
+ export { automationModule } from "./module.js";
3
+ export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TRIGGER_TYPES, AUTOMATION_TASK_TYPES } from "./types.js";
4
+ export { automationToTf, type AutomationToTfContext, type AutomationToTfResult } from "./to-tf.js";
5
+ /**
6
+ * v2 automation authoring — the typed, chainable builder (validation slice).
7
+ *
8
+ * The typed `ctx` engine is reused from `src/core` (`context` + `ref`); only the
9
+ * builder shell, trigger/task factories, and the token-aware serializer are v2.
10
+ * References inside one automation flow through `ctx` (compile-time-safe);
11
+ * cross-entity references are `CatalogRef` tokens resolved at deploy. Standalone
12
+ * from v1's deploy-wired builder.
13
+ */
14
+ export { chainableTrigger, defineAutomation, defineWorkflow, type AutomationConfigured, type AutomationV2Options, type ChildTask, type OperatorChild, type TaskDef, type TriggerChain, type TriggerDef, type WorkflowBuilder, type WorkflowChain, type WorkflowDef, type WorkflowStarted, type TriggerParamMeta, } from "./build.js";
15
+ export { ScriptCodeError, type ScriptCodeFn, type ScriptInput } from "./script-code.js";
16
+ export { childTask, forEach, forkJoin, switchTask, type ForEachConfig, type ForkJoinBranch, type ForkJoinConfig, type SwitchCase, type SwitchConfig, } from "./operators.js";
17
+ export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, type AttachmentTriggerOptions, type AttachmentTriggerOutput, type approvalProcessStatusUpdatedStatus, type approvalProcessStatusUpdatedTriggerOptions, type CommentAddedTriggerOptions, type CommentAddedTriggerOutput, type ConversationEndConversationType, type ConversationEndTriggerOptions, type ConversationEndTriggerOutput, type DataMineTriggerOptions, type EmailReceivedTriggerOptions, type EmailReceivedTriggerOutput, type RecordTriggerOptions, type RecordTriggerOutput, type ScheduleFrequency, type Weekday, type ScheduleTriggerOptions, type ScheduleTriggerOutput, type SlackMessageTriggerOutput, type SurveyResponseCreateTriggerOptions, type SurveyResponseCreateTriggerOutput, type TemporalTriggerOptions, type TemporalUnit, type WebhookTriggerOptions, type WebhookTriggerOutput, } from "./triggers.js";
18
+ export { aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, createRecord, executeScript, findRelatedRecords, postComment, recordSearch, relateRecords, sendEmail, setVariable, tableRecordsSearch, updateField, type AiAgentOptions, type AiAgentOutput, type AiAgentOutputField, type AiAgentOutputFieldType, type AiClassifyCategorySource, type AiClassifyOptions, type AiClassifyStaticCategory, type AiEmailAnalysisOptions, type AiFileAnalysisOptions, type AiSearchTableOptions, type AiSummarizeOptions, type AiTransformOptions, type ApiRequestHeader, type ApiRequestOptions, type CreateRecordOptions, type CreateRecordOutput, type EmailAttachment, type ExecuteScriptOptions, type FieldAssignment, type FindRelatedRecordsOptions, type PostCommentOptions, type RecordSearchOptions, type RecordSearchOutput, type RelateRecordsOptions, type SendEmailOptions, type SetVariableOptions, type TableRecordsSearchOptions, type TableRecordsSearchOutput, type UpdateFieldOptions, type VariableAssign, type VariableDecl, } from "./tasks.js";
19
+ export { addWatcher, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, calculation, filterTask, generateReport, initiateCall, notification, postTeamsMessage, procedure, recordFieldLocking, saveAttachment, unzip, userGroupSearch, userSearch, type AddWatcherOptions, type ApprovalStatusUpdateOptions, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type CalculationEntry, type CalculationOptions, type FilterTaskOptions, type GenerateReportOptions, type InitiateCallOptions, type NotificationOptions, type PostTeamsMessageOptions, type ProcedureOptions, type RecordFieldLockingOptions, type SaveAttachmentOptions, type UnzipOptions, type UserSearchOptions, } from "./tasks.js";
20
+ export { approvalChainTemplate, approvalChain, bulkExcel, readFile, initiateEmailConversation, runAutomation, sendSurvey, type ApprovalChainOptions, type ApprovalChainTemplateOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, type ReadFileDataSource, type ReadFileOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type RunAutomationInput, type RunAutomationOptions, type SendSurveyOptions, } from "./tasks.js";
21
+ export * as filter from "./filter.js";
22
+ export { type Filter } from "./filter.js";
@@ -0,0 +1,25 @@
1
+ export { automationFromTf } from "./from-tf.js";
2
+ export { automationModule } from "./module.js";
3
+ export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TRIGGER_TYPES, AUTOMATION_TASK_TYPES } from "./types.js";
4
+ export { automationToTf } from "./to-tf.js";
5
+ /**
6
+ * v2 automation authoring — the typed, chainable builder (validation slice).
7
+ *
8
+ * The typed `ctx` engine is reused from `src/core` (`context` + `ref`); only the
9
+ * builder shell, trigger/task factories, and the token-aware serializer are v2.
10
+ * References inside one automation flow through `ctx` (compile-time-safe);
11
+ * cross-entity references are `CatalogRef` tokens resolved at deploy. Standalone
12
+ * from v1's deploy-wired builder.
13
+ */
14
+ export { chainableTrigger, defineAutomation, defineWorkflow, } from "./build.js";
15
+ export { ScriptCodeError } from "./script-code.js";
16
+ export { childTask, forEach, forkJoin, switchTask, } from "./operators.js";
17
+ export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, } from "./triggers.js";
18
+ export { aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, createRecord, executeScript, findRelatedRecords, postComment, recordSearch, relateRecords, sendEmail, setVariable, tableRecordsSearch, updateField, } from "./tasks.js";
19
+ export { addWatcher, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, calculation, filterTask, generateReport, initiateCall, notification, postTeamsMessage, procedure, recordFieldLocking, saveAttachment, unzip, userGroupSearch, userSearch, } from "./tasks.js";
20
+ export { approvalChainTemplate, approvalChain, bulkExcel, readFile, initiateEmailConversation, runAutomation, sendSurvey, } from "./tasks.js";
21
+ export * as filter from "./filter.js";
22
+ // Pull a deployed automation back as editable v2 source. `defineAutomation`
23
+ // is a plain factory returning a builder-chain object (not an Object.assign-able
24
+ // callable), so `fromJSON` ships as a standalone named export rather than a
25
+ // `defineAutomation.fromJSON` attachment.
@@ -0,0 +1,3 @@
1
+ /** The automation entity's registry entry (see src/graph/). */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ export declare const automationModule: EntityKindModule;
@@ -0,0 +1,150 @@
1
+ /** The automation entity's registry entry (see src/graph/). */
2
+ import { sanitizeName, tfLabelToTsLabel } from "../../engine/tf/index.js";
3
+ import { NO_DATA, } from "../../graph/types.js";
4
+ import { renderAutomationCatalogEntry } from "./catalog-render.js";
5
+ import { printAutomationV2 } from "./deserializer/print-automation.js";
6
+ import { automationFromTf, automationOwnedAddresses } from "./from-tf.js";
7
+ import { automationToTf } from "./to-tf.js";
8
+ import { ALL_AUTOMATION_SUB_TYPES, AUTOMATION_RESOURCE_TYPE, WORKFLOW_PUBLISH_RESOURCE_TYPE, } from "./types.js";
9
+ function isConfigured(value) {
10
+ return (typeof value === "object" &&
11
+ value !== null &&
12
+ typeof value.ref === "function" &&
13
+ typeof value.def === "function");
14
+ }
15
+ function automationStubRef(refName, parent) {
16
+ return { __kind: "automation", refName, name: refName, parent, trigger: {}, outputs: {} };
17
+ }
18
+ function automationRefFromAuthoring(args) {
19
+ const { refName, parent, defaultExport, namedExports } = args;
20
+ if (isConfigured(defaultExport)) {
21
+ const catalogRef = defaultExport.ref(refName);
22
+ if (catalogRef.__kind !== "automation")
23
+ return undefined;
24
+ return catalogRef;
25
+ }
26
+ if (typeof defaultExport !== "object" ||
27
+ defaultExport === null ||
28
+ defaultExport.kind !== "automation") {
29
+ return undefined;
30
+ }
31
+ const entity = defaultExport;
32
+ const entityRefName = entity.refName === "" ? refName : entity.refName;
33
+ const entityParent = entity.parent === "" ? parent : entity.parent;
34
+ const maybeRefName = entity.ref?.name;
35
+ const payloadName = entity.payload?.name;
36
+ const name = typeof maybeRefName === "string"
37
+ ? maybeRefName
38
+ : typeof payloadName === "string"
39
+ ? payloadName
40
+ : entityRefName;
41
+ const triggerParamNames = Array.isArray(namedExports.triggerParamNames)
42
+ ? namedExports.triggerParamNames
43
+ : [];
44
+ const outputPropertyNames = Array.isArray(namedExports.outputPropertyNames)
45
+ ? namedExports.outputPropertyNames
46
+ : [];
47
+ const trigger = triggerParamNames.length > 0
48
+ ? Object.fromEntries(triggerParamNames.map((n) => [n, { __kind: "triggerParameter", refName: n, name: n, parent: entityRefName }]))
49
+ : undefined;
50
+ const outputs = outputPropertyNames.length > 0
51
+ ? Object.fromEntries(outputPropertyNames.map((n) => [n, { __kind: "outputProperty", refName: n, name: n, parent: entityRefName }]))
52
+ : undefined;
53
+ return {
54
+ __kind: "automation",
55
+ refName: entityRefName,
56
+ name,
57
+ parent: entityParent,
58
+ ...(trigger !== undefined ? { trigger } : {}),
59
+ ...(outputs !== undefined ? { outputs } : {}),
60
+ };
61
+ }
62
+ function extractAutomations(ownBlocks, stream, ctx) {
63
+ const items = [];
64
+ const skipped = [];
65
+ const diagnostics = [];
66
+ for (const autoBlock of ownBlocks) {
67
+ const autoLabel = autoBlock.label ?? "";
68
+ try {
69
+ const extracted = automationFromTf({ blocks: [...stream.allBlocks] }, autoLabel, ctx.appRefName);
70
+ items.push(extracted.ast);
71
+ }
72
+ catch (err) {
73
+ // Report the automation's FULL graph (trigger/tasks/branches/publish),
74
+ // not just its root - otherwise those children's otherwise-adoptable
75
+ // resource TYPES get imported into state anyway, and build (which
76
+ // never wrote this automation to source) can't reproduce them, so
77
+ // `plan` shows them as destroy-on-apply. See automationOwnedAddresses.
78
+ skipped.push(...automationOwnedAddresses({ blocks: [...stream.allBlocks] }, autoLabel));
79
+ diagnostics.push(err instanceof Error ? err.message : String(err));
80
+ }
81
+ }
82
+ return { items, skipped, diagnostics };
83
+ }
84
+ export const automationModule = {
85
+ kind: "automation",
86
+ stream: { role: "streamMember" },
87
+ authoring: { unit: "ownFile", bag: "automations" },
88
+ parents: [
89
+ { parent: "app", child: "automation" },
90
+ { parent: "element", child: "automation" },
91
+ ],
92
+ resource: {
93
+ shape: "composite",
94
+ adoptable: true,
95
+ members: [
96
+ { role: "skeleton", resourceType: AUTOMATION_RESOURCE_TYPE, implemented: true },
97
+ { role: "publish", resourceType: WORKFLOW_PUBLISH_RESOURCE_TYPE, implemented: true },
98
+ ...ALL_AUTOMATION_SUB_TYPES.map((t) => ({
99
+ role: t.resourceType.endsWith("_trigger") ? "trigger" : t.resourceType === "elementum_switch_case" || t.resourceType === "elementum_fork_join_branch" ? "branch" : "task",
100
+ resourceType: t.resourceType,
101
+ implemented: t.implemented === true,
102
+ })),
103
+ ],
104
+ },
105
+ data: NO_DATA,
106
+ canvas: {
107
+ participates: true,
108
+ label: "Automations",
109
+ glyph: "⚡",
110
+ component: "automationCard",
111
+ toView: (instance) => {
112
+ const a = instance;
113
+ return { name: a.name, status: a.status, taskCount: a.tasks.length };
114
+ },
115
+ },
116
+ lifecycle: {
117
+ participates: true,
118
+ extractOwnFile: extractAutomations,
119
+ printOwnFile: (item, opts) => {
120
+ const automation = item;
121
+ const refName = tfLabelToTsLabel(sanitizeName(automation.name));
122
+ return {
123
+ refName,
124
+ source: printAutomationV2(automation, {
125
+ refName,
126
+ appRefName: opts.appRefName,
127
+ ...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
128
+ }),
129
+ };
130
+ },
131
+ toTf: (entity, ctx) => automationToTf(entity, {
132
+ appRefName: ctx.appRefName,
133
+ appTfLabel: ctx.appTfLabel,
134
+ fieldAddresses: ctx.fieldAddresses ?? new Map(),
135
+ fieldNames: ctx.fieldNames ?? new Map(),
136
+ fieldMetadata: ctx.fieldMetadata ?? new Map(),
137
+ orgRefs: ctx.orgRefs,
138
+ }),
139
+ },
140
+ catalog: {
141
+ participates: true,
142
+ refKind: "automation",
143
+ catalogBag: "automations",
144
+ renderOrder: 10,
145
+ catalogRoot: "app",
146
+ renderEntry: renderAutomationCatalogEntry,
147
+ stubRef: automationStubRef,
148
+ refFromAuthoring: automationRefFromAuthoring,
149
+ },
150
+ };
@@ -0,0 +1,93 @@
1
+ /**
2
+ * v2 operator tasks — `forEach` / `switch` / `forkJoin`. Unlike leaf tasks these
3
+ * carry **nested child task lists** (`operatorChildren`), which the builder emits
4
+ * as the wire task's `children`. The typed `ctx` (the forEach item proxy, the
5
+ * inner context) is reused from `core/context` — same as v1.
6
+ *
7
+ * Child tasks are `{ name, def }` pairs; each `def` is any task factory's output
8
+ * (including nested operators). The callbacks receive an inner `ctx` so child
9
+ * tasks can reference the trigger and outer task outputs.
10
+ */
11
+ import type { Context, ForEachItem } from "../shared/context.js";
12
+ import type { Ref } from "../shared/ref.js";
13
+ import { type ChildTask, type TaskDef } from "./build.js";
14
+ import type { Filter } from "./filter.js";
15
+ type Empty = Record<string, never>;
16
+ /**
17
+ * Convenience: name a child task. Equivalent to `{ name, def }`.
18
+ *
19
+ * `displayName` is only needed when adopting a platform-authored task whose
20
+ * wire `name` differs from its `refKey` (e.g. a UI-built "For Each" task,
21
+ * whose slugged refKey is "For_Each"); omit it otherwise.
22
+ *
23
+ * For a nested `executeScript` (`childTask(name, executeScript({...}))`),
24
+ * `def.config.code` was already resolved by the time this runs — the
25
+ * low-level `executeScript()` factory has no way to know its own task name
26
+ * (only the enclosing `childTask()` call does), so it can't consult
27
+ * `tryExtractFromCurrentSource` itself. Here — where `name` finally IS known
28
+ * — swap in the byte-exact body from the tracked automation source when one
29
+ * is found, overriding whatever `extractScriptBody`'s `toString()` fallback
30
+ * already computed. See `script-code.ts` for why that fallback can reformat
31
+ * a pulled script's exact text.
32
+ */
33
+ export declare function childTask(name: string, def: TaskDef<unknown>, displayName?: string): ChildTask;
34
+ export interface ForEachConfig<TTrigger, TTasks extends Record<string, unknown>, TItem> {
35
+ /** The collection to iterate (e.g. `ctx.tasks.find.records`). */
36
+ readonly collection: Ref<readonly TItem[]>;
37
+ /**
38
+ * Child tasks executed per item. `item` is a ref to the whole item with typed
39
+ * field drilling (`item.fieldName`); `innerCtx` exposes the trigger + outer tasks.
40
+ */
41
+ readonly tasks: (item: ForEachItem<TItem>, innerCtx: Context<TTrigger, TTasks>) => readonly ChildTask[];
42
+ }
43
+ export declare function forEach<TTrigger, TTasks extends Record<string, unknown>, TItem = unknown>(_ctx: Context<TTrigger, TTasks>, config: ForEachConfig<TTrigger, TTasks, TItem>): TaskDef<Empty>;
44
+ export interface SwitchCase<TTrigger, TTasks extends Record<string, unknown>> {
45
+ readonly label: string;
46
+ /**
47
+ * Condition for this case, built with the `filter.*` DSL
48
+ * (`@elementumai/edk/automations`). Omit for a condition-free fallthrough
49
+ * case (e.g. a labeled "otherwise"/"default" branch) — it matches whenever
50
+ * no earlier case matches.
51
+ *
52
+ * Switch conditions have no row in scope, so every `filter.*` comparison
53
+ * (`eq`/`gt`/`like`/`isNull`/`between`/…) accepts a task/trigger `Ref` in
54
+ * place of a field — e.g. `filter.lt(ctx.tasks.search.totalCount, 1)` —
55
+ * in addition to the usual `FieldRef` token.
56
+ */
57
+ readonly condition?: Filter;
58
+ readonly tasks: (innerCtx: Context<TTrigger, TTasks>) => readonly ChildTask[];
59
+ }
60
+ export interface SwitchConfig<TTrigger, TTasks extends Record<string, unknown>> {
61
+ /** Ordered cases — first match wins. */
62
+ readonly cases: readonly SwitchCase<TTrigger, TTasks>[];
63
+ /**
64
+ * Tasks when no case matches (the default/else branch). Plain function form
65
+ * matches the platform's usual "Default" display label; pass `{ label,
66
+ * tasks }` to preserve a manually renamed default branch (e.g. "Default
67
+ * Path") through a pull/build round trip.
68
+ */
69
+ readonly defaultTasks?: ((innerCtx: Context<TTrigger, TTasks>) => readonly ChildTask[]) | {
70
+ readonly label?: string;
71
+ readonly tasks: (innerCtx: Context<TTrigger, TTasks>) => readonly ChildTask[];
72
+ /**
73
+ * Internal round-trip detail, set only by `edk pull`: which wire
74
+ * shape the platform is currently using to mark this branch as the
75
+ * default (`is_default = true` vs. an explicit
76
+ * `filter = {type:"true"}` — both are live-confirmed on real orgs
77
+ * for the same case pattern, see #157). Leave unset when
78
+ * hand-authoring a new automation; it defaults to `is_default`.
79
+ */
80
+ readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
81
+ };
82
+ }
83
+ export declare function switchTask<TTrigger, TTasks extends Record<string, unknown>>(_ctx: Context<TTrigger, TTasks>, config: SwitchConfig<TTrigger, TTasks>): TaskDef<Empty>;
84
+ export interface ForkJoinBranch<TTrigger, TTasks extends Record<string, unknown>> {
85
+ readonly label: string;
86
+ readonly tasks: (innerCtx: Context<TTrigger, TTasks>) => readonly ChildTask[];
87
+ }
88
+ export interface ForkJoinConfig<TTrigger, TTasks extends Record<string, unknown>> {
89
+ /** Parallel branches, each executed concurrently. */
90
+ readonly branches: readonly ForkJoinBranch<TTrigger, TTasks>[];
91
+ }
92
+ export declare function forkJoin<TTrigger, TTasks extends Record<string, unknown>>(_ctx: Context<TTrigger, TTasks>, config: ForkJoinConfig<TTrigger, TTasks>): TaskDef<Empty>;
93
+ export {};
@@ -0,0 +1,69 @@
1
+ import { buildContext, createForEachItemProxy } from "../shared/context.js";
2
+ import { FOR_EACH_PLACEHOLDER } from "./build.js";
3
+ import { tryExtractFromCurrentSource } from "./script-code.js";
4
+ /**
5
+ * Convenience: name a child task. Equivalent to `{ name, def }`.
6
+ *
7
+ * `displayName` is only needed when adopting a platform-authored task whose
8
+ * wire `name` differs from its `refKey` (e.g. a UI-built "For Each" task,
9
+ * whose slugged refKey is "For_Each"); omit it otherwise.
10
+ *
11
+ * For a nested `executeScript` (`childTask(name, executeScript({...}))`),
12
+ * `def.config.code` was already resolved by the time this runs — the
13
+ * low-level `executeScript()` factory has no way to know its own task name
14
+ * (only the enclosing `childTask()` call does), so it can't consult
15
+ * `tryExtractFromCurrentSource` itself. Here — where `name` finally IS known
16
+ * — swap in the byte-exact body from the tracked automation source when one
17
+ * is found, overriding whatever `extractScriptBody`'s `toString()` fallback
18
+ * already computed. See `script-code.ts` for why that fallback can reformat
19
+ * a pulled script's exact text.
20
+ */
21
+ export function childTask(name, def, displayName) {
22
+ if (def.key === "executeScript") {
23
+ const body = tryExtractFromCurrentSource(name);
24
+ if (body !== undefined && body !== def.config["code"]) {
25
+ return { name, def: { ...def, config: { ...def.config, code: body } }, displayName };
26
+ }
27
+ }
28
+ return { name, def, displayName };
29
+ }
30
+ export function forEach(_ctx, config) {
31
+ const item = createForEachItemProxy(FOR_EACH_PLACEHOLDER);
32
+ const innerCtx = buildContext([]);
33
+ return {
34
+ key: "forEach",
35
+ config: { forEach: config.collection },
36
+ operatorChildren: [{ label: null, tasks: config.tasks(item, innerCtx) }],
37
+ };
38
+ }
39
+ export function switchTask(_ctx, config) {
40
+ if (config.cases.length === 0)
41
+ throw new Error("switch requires at least one case");
42
+ const innerCtx = buildContext([]);
43
+ const operatorChildren = config.cases.map((c) => ({
44
+ label: c.label,
45
+ ...(c.condition !== undefined ? { filter: c.condition } : {}),
46
+ tasks: c.tasks(innerCtx),
47
+ }));
48
+ if (config.defaultTasks) {
49
+ const isPlainFn = typeof config.defaultTasks === "function";
50
+ const tasksFn = isPlainFn ? config.defaultTasks : config.defaultTasks.tasks;
51
+ const defaultLabel = isPlainFn ? undefined : config.defaultTasks.label;
52
+ const defaultFilterMode = isPlainFn ? undefined : config.defaultTasks.defaultFilterMode;
53
+ operatorChildren.push({
54
+ label: null,
55
+ ...(defaultLabel !== undefined ? { defaultLabel } : {}),
56
+ ...(defaultFilterMode !== undefined ? { defaultFilterMode } : {}),
57
+ tasks: tasksFn(innerCtx),
58
+ });
59
+ }
60
+ return { key: "switch", config: {}, operatorChildren };
61
+ }
62
+ export function forkJoin(_ctx, config) {
63
+ const innerCtx = buildContext([]);
64
+ return {
65
+ key: "forkJoin",
66
+ config: {},
67
+ operatorChildren: config.branches.map((b) => ({ label: b.label, tasks: b.tasks(innerCtx) })),
68
+ };
69
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Single-scalar-output task kinds whose EDK factory exposes the result as
3
+ * `output` (`TaskDef<{ output: unknown }>`), but whose platform wire name
4
+ * differs. aiSummarize/aiTransform were "confirmed against real pulled wire
5
+ * data" per the original note, naming their output `response`; documentModel
6
+ * (rawText data source) names it `text`. aiClassify's `Response` is confirmed
7
+ * directly against a live-deployed task's own `refs` map (Preston High
8
+ * integration run, item 235) — that map is Title-Case (`Reason`, `Response`,
9
+ * `Success`), so the wire name here must match that casing exactly, not the
10
+ * lowercase property name. The aiSummarize/aiTransform `response` entries
11
+ * predate that discovery and have never been exercised by a fixture or live
12
+ * run that references their `.output` from a downstream task/output — their
13
+ * casing is UNVERIFIED and may have the same bug.
14
+ *
15
+ * Used by `build.ts` (forward: `output` → wire name) and `from-tf.ts`
16
+ * (inverse: wire name → `output`) — kept dependency-free so importing it from
17
+ * either side can never introduce a cycle.
18
+ */
19
+ export declare const OUTPUT_KEY_WIRE_NAME: Readonly<Record<string, string>>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Single-scalar-output task kinds whose EDK factory exposes the result as
3
+ * `output` (`TaskDef<{ output: unknown }>`), but whose platform wire name
4
+ * differs. aiSummarize/aiTransform were "confirmed against real pulled wire
5
+ * data" per the original note, naming their output `response`; documentModel
6
+ * (rawText data source) names it `text`. aiClassify's `Response` is confirmed
7
+ * directly against a live-deployed task's own `refs` map (Preston High
8
+ * integration run, item 235) — that map is Title-Case (`Reason`, `Response`,
9
+ * `Success`), so the wire name here must match that casing exactly, not the
10
+ * lowercase property name. The aiSummarize/aiTransform `response` entries
11
+ * predate that discovery and have never been exercised by a fixture or live
12
+ * run that references their `.output` from a downstream task/output — their
13
+ * casing is UNVERIFIED and may have the same bug.
14
+ *
15
+ * Used by `build.ts` (forward: `output` → wire name) and `from-tf.ts`
16
+ * (inverse: wire name → `output`) — kept dependency-free so importing it from
17
+ * either side can never introduce a cycle.
18
+ */
19
+ export const OUTPUT_KEY_WIRE_NAME = {
20
+ aiSummarize: "response",
21
+ aiTransform: "response",
22
+ aiClassify: "Response",
23
+ documentModel: "text",
24
+ };
@@ -0,0 +1,51 @@
1
+ /** The shape the platform passes to a script: inputs under `parameters`. */
2
+ export interface ScriptInput<I extends Record<string, unknown> = Record<string, unknown>> {
3
+ readonly parameters: I;
4
+ }
5
+ export type ScriptCodeFn<I extends Record<string, unknown> = Record<string, unknown>, R = Record<string, unknown>> = (input: ScriptInput<I>) => R;
6
+ export declare class ScriptCodeError extends Error {
7
+ constructor(message: string);
8
+ }
9
+ /**
10
+ * Extract the platform script body from an authored code function. Accepts the
11
+ * shapes a transpiler emits for `(input) => …`: arrow with block body, arrow
12
+ * with expression body (wrapped into a `return`), and `function` declarations.
13
+ */
14
+ export declare function extractScriptBody(fn: (...args: never[]) => unknown): string;
15
+ /**
16
+ * Infer the executeScript output schema (property name → authoring type
17
+ * alias) from the script body's `return {...}` object literals — the runtime
18
+ * half of what the `code` function's TS return type already gives the type
19
+ * system. Same best-effort contract as the closure scan:
20
+ *
21
+ * - every `return`ed object literal contributes its top-level keys; multiple
22
+ * returns merge (a key typed differently across branches widens to "text")
23
+ * - value types come from LITERAL values only: string/template → "text",
24
+ * integral number → "integer", other number → "number", true/false →
25
+ * "boolean"; any other expression defaults to "text"
26
+ * - a return that is NOT a statically enumerable object literal (returning a
27
+ * variable, a call, a literal with spread/computed keys) makes the whole
28
+ * inference bail — returns undefined, meaning NO schema is emitted. Using
29
+ * `result.<prop>` refs downstream then fails at build with the explicit
30
+ * `outputs:` fix-it. The explicit `outputs` option always overrides.
31
+ *
32
+ * The scan is context-aware (skips comments, strings, and template literals
33
+ * with `${}` nesting) so braces inside them don't derail the literal walk.
34
+ */
35
+ export declare function inferOutputSchema(body: string): Record<string, string> | undefined;
36
+ /**
37
+ * Best-effort free-identifier scan: strip comments/strings/templates, collect
38
+ * identifier tokens that are not property accesses, object keys, declarations,
39
+ * params, keywords, or known script globals.
40
+ */
41
+ export declare function freeIdentifiers(body: string, params: ReadonlySet<string>): string[];
42
+ /**
43
+ * Look up task `name`'s `code:` body verbatim from the automation file
44
+ * `elementum build` is currently importing (tracked engine-side by
45
+ * `withSourceText` around each own-file-child's `jiti.import()` —
46
+ * `src/engine/build/build.ts`/`source-context.ts`), or `undefined` if
47
+ * there's no tracked source (not running under `elementum build`, e.g. an
48
+ * automation constructed directly in a test) or the name/shape wasn't found
49
+ * by the scan (falls back to `extractScriptBody`).
50
+ */
51
+ export declare function tryExtractFromCurrentSource(name: string): string | undefined;