@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.0-preview.11

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 (360) hide show
  1. package/README.md +408 -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/factories.d.ts +189 -0
  47. package/dist-sdk/src/catalog/factories.js +202 -0
  48. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  49. package/dist-sdk/src/catalog/from-authoring.js +462 -0
  50. package/dist-sdk/src/catalog/index.d.ts +11 -0
  51. package/dist-sdk/src/catalog/index.js +11 -0
  52. package/dist-sdk/src/catalog/org.d.ts +11 -0
  53. package/dist-sdk/src/catalog/org.js +211 -0
  54. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  55. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  56. package/dist-sdk/src/catalog/render.d.ts +36 -0
  57. package/dist-sdk/src/catalog/render.js +176 -0
  58. package/dist-sdk/src/catalog/token.d.ts +10 -0
  59. package/dist-sdk/src/catalog/token.js +62 -0
  60. package/dist-sdk/src/catalog/types.d.ts +158 -0
  61. package/dist-sdk/src/catalog/types.js +83 -0
  62. package/dist-sdk/src/catalog/write.d.ts +43 -0
  63. package/dist-sdk/src/catalog/write.js +109 -0
  64. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  65. package/dist-sdk/src/core/app-to-ui.js +75 -0
  66. package/dist-sdk/src/core/index.d.ts +10 -0
  67. package/dist-sdk/src/core/index.js +9 -0
  68. package/dist-sdk/src/core/system-fields.d.ts +93 -0
  69. package/dist-sdk/src/core/system-fields.js +151 -0
  70. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  71. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  72. package/dist-sdk/src/core/types/ai-provider.d.ts +36 -0
  73. package/dist-sdk/src/core/types/ai-provider.js +32 -0
  74. package/dist-sdk/src/core/types/app.d.ts +838 -0
  75. package/dist-sdk/src/core/types/app.js +210 -0
  76. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  77. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  78. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  79. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  80. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  81. package/dist-sdk/src/core/types/display-block.js +61 -0
  82. package/dist-sdk/src/core/types/group.d.ts +13 -0
  83. package/dist-sdk/src/core/types/group.js +6 -0
  84. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  85. package/dist-sdk/src/core/types/platform.js +1 -0
  86. package/dist-sdk/src/core/types/user.d.ts +20 -0
  87. package/dist-sdk/src/core/types/user.js +8 -0
  88. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  89. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  90. package/dist-sdk/src/engine/build/context.d.ts +49 -0
  91. package/dist-sdk/src/engine/build/context.js +6 -0
  92. package/dist-sdk/src/engine/entity.d.ts +44 -0
  93. package/dist-sdk/src/engine/entity.js +15 -0
  94. package/dist-sdk/src/engine/pull/context.d.ts +23 -0
  95. package/dist-sdk/src/engine/pull/context.js +44 -0
  96. package/dist-sdk/src/engine/pull/org.d.ts +44 -0
  97. package/dist-sdk/src/engine/pull/org.js +104 -0
  98. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  99. package/dist-sdk/src/engine/tf/escape.js +28 -0
  100. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  101. package/dist-sdk/src/engine/tf/expr.js +405 -0
  102. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  103. package/dist-sdk/src/engine/tf/index.js +11 -0
  104. package/dist-sdk/src/engine/tf/labels.d.ts +31 -0
  105. package/dist-sdk/src/engine/tf/labels.js +125 -0
  106. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  107. package/dist-sdk/src/engine/tf/model.js +49 -0
  108. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  109. package/dist-sdk/src/engine/tf/parse.js +189 -0
  110. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  111. package/dist-sdk/src/engine/tf/render.js +102 -0
  112. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  113. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  114. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  115. package/dist-sdk/src/entities/agent/build.js +148 -0
  116. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +18 -0
  117. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +177 -0
  118. package/dist-sdk/src/entities/agent/from-tf.d.ts +50 -0
  119. package/dist-sdk/src/entities/agent/from-tf.js +169 -0
  120. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  121. package/dist-sdk/src/entities/agent/index.js +7 -0
  122. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  123. package/dist-sdk/src/entities/agent/module.js +116 -0
  124. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  125. package/dist-sdk/src/entities/agent/to-tf.js +136 -0
  126. package/dist-sdk/src/entities/agent/tools.d.ts +205 -0
  127. package/dist-sdk/src/entities/agent/tools.js +199 -0
  128. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +63 -0
  129. package/dist-sdk/src/entities/agent-tool/from-tf.js +169 -0
  130. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  131. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  132. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +38 -0
  133. package/dist-sdk/src/entities/agent-tool/to-tf.js +164 -0
  134. package/dist-sdk/src/entities/agent-tool/types.d.ts +42 -0
  135. package/dist-sdk/src/entities/agent-tool/types.js +70 -0
  136. package/dist-sdk/src/entities/app/build.d.ts +318 -0
  137. package/dist-sdk/src/entities/app/build.js +325 -0
  138. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +165 -0
  139. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  140. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  141. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  142. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  143. package/dist-sdk/src/entities/app/from-tf.js +180 -0
  144. package/dist-sdk/src/entities/app/index.d.ts +11 -0
  145. package/dist-sdk/src/entities/app/index.js +10 -0
  146. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  147. package/dist-sdk/src/entities/app/locals.js +31 -0
  148. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  149. package/dist-sdk/src/entities/app/module.js +59 -0
  150. package/dist-sdk/src/entities/app/to-tf.d.ts +28 -0
  151. package/dist-sdk/src/entities/app/to-tf.js +183 -0
  152. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  153. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  154. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  155. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  156. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  157. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  158. package/dist-sdk/src/entities/automation/build.d.ts +215 -0
  159. package/dist-sdk/src/entities/automation/build.js +424 -0
  160. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  161. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  162. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +135 -0
  163. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  164. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +40 -0
  165. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1040 -0
  166. package/dist-sdk/src/entities/automation/filter.d.ts +81 -0
  167. package/dist-sdk/src/entities/automation/filter.js +146 -0
  168. package/dist-sdk/src/entities/automation/from-tf.d.ts +36 -0
  169. package/dist-sdk/src/entities/automation/from-tf.js +252 -0
  170. package/dist-sdk/src/entities/automation/index.d.ts +18 -0
  171. package/dist-sdk/src/entities/automation/index.js +21 -0
  172. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  173. package/dist-sdk/src/entities/automation/module.js +153 -0
  174. package/dist-sdk/src/entities/automation/operators.d.ts +66 -0
  175. package/dist-sdk/src/entities/automation/operators.js +43 -0
  176. package/dist-sdk/src/entities/automation/script-code.d.ts +62 -0
  177. package/dist-sdk/src/entities/automation/script-code.js +366 -0
  178. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  179. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  180. package/dist-sdk/src/entities/automation/tasks.d.ts +535 -0
  181. package/dist-sdk/src/entities/automation/tasks.js +697 -0
  182. package/dist-sdk/src/entities/automation/to-tf.d.ts +38 -0
  183. package/dist-sdk/src/entities/automation/to-tf.js +266 -0
  184. package/dist-sdk/src/entities/automation/triggers.d.ts +197 -0
  185. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  186. package/dist-sdk/src/entities/automation/types.d.ts +53 -0
  187. package/dist-sdk/src/entities/automation/types.js +101 -0
  188. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +76 -0
  189. package/dist-sdk/src/entities/automation/value-ref-tf.js +190 -0
  190. package/dist-sdk/src/entities/element/build.d.ts +108 -0
  191. package/dist-sdk/src/entities/element/build.js +109 -0
  192. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  193. package/dist-sdk/src/entities/element/from-tf.js +155 -0
  194. package/dist-sdk/src/entities/element/index.d.ts +9 -0
  195. package/dist-sdk/src/entities/element/index.js +9 -0
  196. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  197. package/dist-sdk/src/entities/element/locals.js +12 -0
  198. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  199. package/dist-sdk/src/entities/element/module.js +63 -0
  200. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  201. package/dist-sdk/src/entities/element/to-tf.js +151 -0
  202. package/dist-sdk/src/entities/field/build.d.ts +69 -0
  203. package/dist-sdk/src/entities/field/build.js +74 -0
  204. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  205. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  206. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  207. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  208. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  209. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  210. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  211. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  212. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  213. package/dist-sdk/src/entities/field/calc/runtime.js +170 -0
  214. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  215. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  216. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  217. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  218. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  219. package/dist-sdk/src/entities/field/calc.js +54 -0
  220. package/dist-sdk/src/entities/field/from-tf.d.ts +29 -0
  221. package/dist-sdk/src/entities/field/from-tf.js +73 -0
  222. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  223. package/dist-sdk/src/entities/field/locals.js +24 -0
  224. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  225. package/dist-sdk/src/entities/field/module.js +49 -0
  226. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  227. package/dist-sdk/src/entities/field/options.js +76 -0
  228. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  229. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  230. package/dist-sdk/src/entities/field/to-tf.d.ts +55 -0
  231. package/dist-sdk/src/entities/field/to-tf.js +97 -0
  232. package/dist-sdk/src/entities/field/types.d.ts +27 -0
  233. package/dist-sdk/src/entities/field/types.js +46 -0
  234. package/dist-sdk/src/entities/file-reader/build.d.ts +124 -0
  235. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  236. package/dist-sdk/src/entities/file-reader/index.d.ts +5 -0
  237. package/dist-sdk/src/entities/file-reader/index.js +5 -0
  238. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  239. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  240. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  241. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  242. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  243. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  244. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  245. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  246. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  247. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  248. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  249. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  250. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  251. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  252. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  253. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  254. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  255. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  256. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  257. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  258. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  259. package/dist-sdk/src/entities/flow/build.js +115 -0
  260. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  261. package/dist-sdk/src/entities/flow/index.js +7 -0
  262. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  263. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  264. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  265. package/dist-sdk/src/entities/flow/util.js +38 -0
  266. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  267. package/dist-sdk/src/entities/org/category.js +33 -0
  268. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  269. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  270. package/dist-sdk/src/entities/org/connector.d.ts +5 -0
  271. package/dist-sdk/src/entities/org/connector.js +37 -0
  272. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  273. package/dist-sdk/src/entities/org/group.js +31 -0
  274. package/dist-sdk/src/entities/org/index.d.ts +10 -0
  275. package/dist-sdk/src/entities/org/index.js +10 -0
  276. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  277. package/dist-sdk/src/entities/org/role.js +21 -0
  278. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  279. package/dist-sdk/src/entities/org/user.js +21 -0
  280. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  281. package/dist-sdk/src/entities/search-table/build.js +79 -0
  282. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  283. package/dist-sdk/src/entities/search-table/index.js +5 -0
  284. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  285. package/dist-sdk/src/entities/search-table/module.js +64 -0
  286. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  287. package/dist-sdk/src/entities/shared/context.js +156 -0
  288. package/dist-sdk/src/entities/shared/filters/ast.d.ts +242 -0
  289. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  290. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  291. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  292. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  293. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  294. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  295. package/dist-sdk/src/entities/shared/ref.js +119 -0
  296. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  297. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  298. package/dist-sdk/src/entities/shared/types/field-types.d.ts +49 -0
  299. package/dist-sdk/src/entities/shared/types/field-types.js +48 -0
  300. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  301. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  302. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  303. package/dist-sdk/src/entities/skill/build.js +50 -0
  304. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +20 -0
  305. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +96 -0
  306. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  307. package/dist-sdk/src/entities/skill/from-tf.js +95 -0
  308. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  309. package/dist-sdk/src/entities/skill/index.js +7 -0
  310. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  311. package/dist-sdk/src/entities/skill/module.js +106 -0
  312. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  313. package/dist-sdk/src/entities/skill/to-tf.js +58 -0
  314. package/dist-sdk/src/entities/skill/tools.d.ts +71 -0
  315. package/dist-sdk/src/entities/skill/tools.js +88 -0
  316. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +47 -0
  317. package/dist-sdk/src/entities/skill-tool/from-tf.js +121 -0
  318. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  319. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  320. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +32 -0
  321. package/dist-sdk/src/entities/skill-tool/to-tf.js +107 -0
  322. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  323. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  324. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  325. package/dist-sdk/src/entities/table/build.js +339 -0
  326. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  327. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  328. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  329. package/dist-sdk/src/entities/table/fields.js +70 -0
  330. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  331. package/dist-sdk/src/entities/table/filter.js +89 -0
  332. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  333. package/dist-sdk/src/entities/table/index.js +12 -0
  334. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  335. package/dist-sdk/src/entities/table/joins.js +31 -0
  336. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  337. package/dist-sdk/src/entities/table/keys.js +25 -0
  338. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  339. package/dist-sdk/src/entities/table/module.js +25 -0
  340. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  341. package/dist-sdk/src/entities/table/state.js +43 -0
  342. package/dist-sdk/src/entities/view/from-tf.d.ts +25 -0
  343. package/dist-sdk/src/entities/view/from-tf.js +233 -0
  344. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  345. package/dist-sdk/src/entities/view/module.js +61 -0
  346. package/dist-sdk/src/entities/view/to-tf.d.ts +63 -0
  347. package/dist-sdk/src/entities/view/to-tf.js +156 -0
  348. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  349. package/dist-sdk/src/entities/view/types.js +89 -0
  350. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +14 -0
  351. package/dist-sdk/src/graph/deferred-catalog-render.js +37 -0
  352. package/dist-sdk/src/graph/index.d.ts +83 -0
  353. package/dist-sdk/src/graph/index.js +207 -0
  354. package/dist-sdk/src/graph/modules.d.ts +7 -0
  355. package/dist-sdk/src/graph/modules.js +37 -0
  356. package/dist-sdk/src/graph/types.d.ts +301 -0
  357. package/dist-sdk/src/graph/types.js +102 -0
  358. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  359. package/dist-sdk/src/internal/sdk-package.js +23 -0
  360. package/package.json +173 -8
@@ -0,0 +1,81 @@
1
+ /**
2
+ * v2 filter helpers — build the platform's wire `Filter` shape (mirroring
3
+ * `core/filters/types`).
4
+ *
5
+ * The left-hand side of every operator accepts either:
6
+ * - a `FieldRef` catalog token (`app.fields.x`) — the wire `field:` slot,
7
+ * resolved to a field id at deploy by `resolvePayload`; or
8
+ * - a `Ref` (`ctx.trigger.x`, `ctx.tasks.y.z`) — the wire `leftValue:` slot,
9
+ * for row-less contexts (switch/operator conditions) where there's no
10
+ * record to project a field off.
11
+ * Both are detected at call time, so one function (`filter.eq`, `filter.gt`,
12
+ * …) covers both shapes — authors never need to know which slot the platform
13
+ * ends up using. When the left side is a `Ref`, the comparison's value type
14
+ * defaults per-operator (`"TEXT"` for equality/string ops, `"NUMBER"` for
15
+ * ordering ops) and can be overridden with the trailing `leftType` parameter;
16
+ * a `FieldRef` left side always supplies its own type from `fieldType`.
17
+ *
18
+ * Values may be literals, `Ref`s (`ctx.trigger.x`, `ctx.tasks.y.z`), or another
19
+ * `FieldRef`: a ref compares the field against a referenced value at run time,
20
+ * serialized to the platform's `REFERENCE` value shape; a field value serializes
21
+ * to the platform's `FIELD` value shape for field-to-field comparisons. The
22
+ * reference-value conversion is shared with `core/filters` so the two DSLs can't
23
+ * drift.
24
+ */
25
+ import type { FieldRef } from "../../catalog/index.js";
26
+ import { type LikeMode, type ValueType } from "../shared/filters/index.js";
27
+ import { type Ref } from "../shared/ref.js";
28
+ /** A wire filter (may embed `FieldRef` tokens at `field` positions). */
29
+ export type Filter = Record<string, unknown>;
30
+ type Primitive = string | number | boolean | null;
31
+ /**
32
+ * A filter value: a literal, or a `Ref` to a trigger/task/forEach output. A ref
33
+ * serializes to the platform's `REFERENCE` value shape, with `realType` taken
34
+ * from the compared field's `fieldType` (or the operator's `leftType` when the
35
+ * left side is itself a `Ref`).
36
+ */
37
+ export type FilterValue = Primitive | Ref<unknown> | FieldRef;
38
+ /** Either side of a filter: a catalog field token, or a task/trigger/… output ref. */
39
+ export type LeftRef = FieldRef | Ref<unknown>;
40
+ /** Match every record (the minimal valid filter). */
41
+ export declare function whereTrue(): Filter;
42
+ /** Match no record. */
43
+ export declare function whereFalse(): Filter;
44
+ export declare function eq(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
45
+ export declare function notEq(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
46
+ export declare function gt(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
47
+ export declare function gte(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
48
+ export declare function lt(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
49
+ export declare function lte(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
50
+ export declare function like(left: LeftRef, v: string | Ref<unknown>, options?: {
51
+ not?: boolean;
52
+ caseInsensitive?: boolean;
53
+ mode?: LikeMode;
54
+ }, leftType?: ValueType): Filter;
55
+ export declare function isNull(left: LeftRef, options?: {
56
+ not?: boolean;
57
+ }, leftType?: ValueType): Filter;
58
+ export declare function isNotNull(left: LeftRef, leftType?: ValueType): Filter;
59
+ export declare function inList(left: LeftRef, values: readonly FilterValue[], leftType?: ValueType): Filter;
60
+ export declare function between(left: LeftRef, low: FilterValue, high: FilterValue, options?: {
61
+ not?: boolean;
62
+ }, leftType?: ValueType): Filter;
63
+ /**
64
+ * CONSECUTIVE_RANGE filter — field falls within a relative calendar range
65
+ * (`count` `unit`s, shifted `offset` `unit`s back from now). `semantic`
66
+ * selects whether the range snaps to calendar-unit boundaries (`true`) or
67
+ * is a rolling window measured from the current moment (`false`, the
68
+ * default). `unit` is a platform-defined calendar-unit string (e.g.
69
+ * `"QUARTER"`) — not validated here.
70
+ */
71
+ export declare function consecutiveRange(left: LeftRef, options: {
72
+ unit: string;
73
+ count: number;
74
+ offset: number;
75
+ semantic?: boolean;
76
+ }, leftType?: ValueType): Filter;
77
+ export declare function contains(left: LeftRef, values: readonly FilterValue[], leftType?: ValueType): Filter;
78
+ export declare function overlaps(left: LeftRef, values: readonly FilterValue[], leftType?: ValueType): Filter;
79
+ export declare function and(...children: Filter[]): Filter;
80
+ export declare function or(...children: Filter[]): Filter;
81
+ export {};
@@ -0,0 +1,146 @@
1
+ import { fieldTypeToValueType, refDataToFilterReference } from "../shared/filters/index.js";
2
+ import { isRef } from "../shared/ref.js";
3
+ /**
4
+ * True when `left` is a genuine `Ref` (task/trigger/… output) rather than a
5
+ * field. Note this is *not* "is a `FieldRef`" — an unresolved-field
6
+ * placeholder (a bare uuid string, `"<uuid>" as any`) is neither a `Ref` nor
7
+ * a real `FieldRef`, but must still take the `{ field }` path (matching its
8
+ * pre-refactor behavior) since it stands in for a field, not a ref.
9
+ */
10
+ function isRefLeft(left) {
11
+ return isRef(left);
12
+ }
13
+ function isFieldValue(value) {
14
+ return typeof value === "object" && value !== null && !isRef(value) && value.__kind === "field";
15
+ }
16
+ /** The wire LHS descriptor: `{ field }` for a FieldRef (or field placeholder), `{ leftValue }` for a Ref. */
17
+ function leftDescriptor(left, defaultType, leftType) {
18
+ if (isRefLeft(left)) {
19
+ return {
20
+ leftValue: {
21
+ type: "REFERENCE",
22
+ realType: leftType ?? defaultType,
23
+ value: refDataToFilterReference(left.__data),
24
+ },
25
+ };
26
+ }
27
+ return { field: left };
28
+ }
29
+ /** The value type to compare against — from the FieldRef's fieldType, or the operator's (possibly overridden) default when the LHS is a Ref. */
30
+ function leftValueType(left, defaultType, leftType) {
31
+ return isRefLeft(left) ? (leftType ?? defaultType) : fieldTypeToValueType(left.fieldType);
32
+ }
33
+ /** Map a filter value to the platform's `Value` wire shape, typed `vt`. */
34
+ function value(vt, v) {
35
+ if (isRef(v)) {
36
+ // A `static` ref (`val(…)`) is a literal in disguise — unwrap it so it
37
+ // emits as a plain typed value rather than a REFERENCE the platform
38
+ // doesn't expect for literals.
39
+ if (v.__data.kind === "static")
40
+ return value(vt, v.__data.value);
41
+ return { type: "REFERENCE", realType: vt, value: refDataToFilterReference(v.__data) };
42
+ }
43
+ if (isFieldValue(v))
44
+ return { type: "FIELD", value: v };
45
+ if (v === null)
46
+ return { type: "NULL" };
47
+ if (typeof v === "number")
48
+ return { type: "NUMBER", value: v };
49
+ if (typeof v === "boolean")
50
+ return { type: "BOOLEAN", value: v };
51
+ return { type: "TEXT", value: v };
52
+ }
53
+ /** Match every record (the minimal valid filter). */
54
+ export function whereTrue() {
55
+ return { type: "TRUE" };
56
+ }
57
+ /** Match no record. */
58
+ export function whereFalse() {
59
+ return { type: "FALSE" };
60
+ }
61
+ export function eq(left, v, leftType) {
62
+ const vt = leftValueType(left, "TEXT", leftType);
63
+ return { type: "EQUALS", ...leftDescriptor(left, "TEXT", leftType), value: value(vt, v) };
64
+ }
65
+ export function notEq(left, v, leftType) {
66
+ const vt = leftValueType(left, "TEXT", leftType);
67
+ return { type: "EQUALS", ...leftDescriptor(left, "TEXT", leftType), value: value(vt, v), not: true };
68
+ }
69
+ export function gt(left, v, leftType) {
70
+ const vt = leftValueType(left, "NUMBER", leftType);
71
+ return { type: "GREATER_THAN", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
72
+ }
73
+ export function gte(left, v, leftType) {
74
+ const vt = leftValueType(left, "NUMBER", leftType);
75
+ return { type: "GREATER_THAN_EQUALS", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
76
+ }
77
+ export function lt(left, v, leftType) {
78
+ const vt = leftValueType(left, "NUMBER", leftType);
79
+ return { type: "LESS_THAN", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
80
+ }
81
+ export function lte(left, v, leftType) {
82
+ const vt = leftValueType(left, "NUMBER", leftType);
83
+ return { type: "LESS_THAN_EQUALS", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
84
+ }
85
+ export function like(left, v, options, leftType) {
86
+ const vt = leftValueType(left, "TEXT", leftType);
87
+ return {
88
+ type: "LIKE",
89
+ ...leftDescriptor(left, "TEXT", leftType),
90
+ value: value(vt, v),
91
+ ...(options?.not ? { not: true } : {}),
92
+ ...(options?.caseInsensitive ? { caseInsensitive: true } : {}),
93
+ ...(options?.mode ? { mode: options.mode } : {}),
94
+ };
95
+ }
96
+ export function isNull(left, options, leftType) {
97
+ return { type: "IS_NULL", ...leftDescriptor(left, "TEXT", leftType), ...(options?.not ? { not: true } : {}) };
98
+ }
99
+ export function isNotNull(left, leftType) {
100
+ return isNull(left, { not: true }, leftType);
101
+ }
102
+ export function inList(left, values, leftType) {
103
+ const vt = leftValueType(left, "TEXT", leftType);
104
+ return { type: "IN", ...leftDescriptor(left, "TEXT", leftType), values: values.map((v) => value(vt, v)) };
105
+ }
106
+ export function between(left, low, high, options, leftType) {
107
+ const vt = leftValueType(left, "NUMBER", leftType);
108
+ return {
109
+ type: "BETWEEN",
110
+ ...leftDescriptor(left, "NUMBER", leftType),
111
+ values: [value(vt, low), value(vt, high)],
112
+ ...(options?.not ? { not: true } : {}),
113
+ };
114
+ }
115
+ /**
116
+ * CONSECUTIVE_RANGE filter — field falls within a relative calendar range
117
+ * (`count` `unit`s, shifted `offset` `unit`s back from now). `semantic`
118
+ * selects whether the range snaps to calendar-unit boundaries (`true`) or
119
+ * is a rolling window measured from the current moment (`false`, the
120
+ * default). `unit` is a platform-defined calendar-unit string (e.g.
121
+ * `"QUARTER"`) — not validated here.
122
+ */
123
+ export function consecutiveRange(left, options, leftType) {
124
+ return {
125
+ type: "CONSECUTIVE_RANGE",
126
+ ...leftDescriptor(left, "DATETIME", leftType),
127
+ unit: options.unit,
128
+ count: options.count,
129
+ offset: options.offset,
130
+ semantic: options.semantic ?? false,
131
+ };
132
+ }
133
+ export function contains(left, values, leftType) {
134
+ const vt = leftValueType(left, "TEXT", leftType);
135
+ return { type: "CONTAINS", ...leftDescriptor(left, "TEXT", leftType), values: values.map((v) => value(vt, v)) };
136
+ }
137
+ export function overlaps(left, values, leftType) {
138
+ const vt = leftValueType(left, "TEXT", leftType);
139
+ return { type: "OVERLAPS", ...leftDescriptor(left, "TEXT", leftType), values: values.map((v) => value(vt, v)) };
140
+ }
141
+ export function and(...children) {
142
+ return { type: "AND", children };
143
+ }
144
+ export function or(...children) {
145
+ return { type: "OR", children };
146
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Automation extraction (Phase 1). `automationFromTf` consumes the composite
3
+ * HCL blocks for ONE automation (its `elementum_automation` + trigger + task
4
+ * blocks + `elementum_workflow_publish`) and produces the `AutomationAst` the
5
+ * existing `printAutomationV2` renders to editable `.ts`.
6
+ *
7
+ * Task ORDER is reconstructed by walking the `parent` chain from the trigger:
8
+ * the first task's `parent` is the trigger, each subsequent task's `parent` is
9
+ * its predecessor. Unimplemented trigger/task kinds are REPORTED (plan §6),
10
+ * never silently dropped — but note a kind we can't reconstruct also can't be
11
+ * adopted (see module.ts), so in a full pull they never reach here.
12
+ *
13
+ * Per the tranche's typing decision: rather than a name-allowlist drift-guard
14
+ * (the agent-tool `KNOWN_TOOL_ATTRS` pattern), each IMPLEMENTED kind has its own
15
+ * small typed extractor naming the wire fields it reads. The declared-only kinds
16
+ * carry no extractor — they are metadata for reporting, never parsed.
17
+ */
18
+ import { type TfBlock } from "../../engine/tf/index.js";
19
+ import type { AutomationAst } from "./deserializer/ast.js";
20
+ export interface AutomationFromTfContext {
21
+ /** The owning app's refName — becomes `AutomationAst.ownerHandle` (catalog.<owner>). */
22
+ readonly ownerHandle: string;
23
+ readonly diagnostics: string[];
24
+ }
25
+ export interface AutomationFromTfResult {
26
+ readonly automation?: AutomationAst;
27
+ readonly skippedReason?: string;
28
+ }
29
+ /**
30
+ * Reconstruct one automation. `blocks` are the family blocks that belong to it
31
+ * (already grouped by the caller: same `automation` ref / workflow_publish
32
+ * depends_on set). Returns `{ automation }` or `{ skippedReason }`.
33
+ */
34
+ export declare function automationFromTf(blocks: readonly TfBlock[], ctx: AutomationFromTfContext): AutomationFromTfResult;
35
+ /** Recognizes the blocks that make up automation families (for the pull partition). */
36
+ export declare function isAutomationFamilyType(type: string | undefined): boolean;
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Automation extraction (Phase 1). `automationFromTf` consumes the composite
3
+ * HCL blocks for ONE automation (its `elementum_automation` + trigger + task
4
+ * blocks + `elementum_workflow_publish`) and produces the `AutomationAst` the
5
+ * existing `printAutomationV2` renders to editable `.ts`.
6
+ *
7
+ * Task ORDER is reconstructed by walking the `parent` chain from the trigger:
8
+ * the first task's `parent` is the trigger, each subsequent task's `parent` is
9
+ * its predecessor. Unimplemented trigger/task kinds are REPORTED (plan §6),
10
+ * never silently dropped — but note a kind we can't reconstruct also can't be
11
+ * adopted (see module.ts), so in a full pull they never reach here.
12
+ *
13
+ * Per the tranche's typing decision: rather than a name-allowlist drift-guard
14
+ * (the agent-tool `KNOWN_TOOL_ATTRS` pattern), each IMPLEMENTED kind has its own
15
+ * small typed extractor naming the wire fields it reads. The declared-only kinds
16
+ * carry no extractor — they are metadata for reporting, never parsed.
17
+ */
18
+ import { isTfExpr, sanitizeName } from "../../engine/tf/index.js";
19
+ import { tfRefToAst } from "./value-ref-tf.js";
20
+ import { AUTOMATION_RESOURCE_TYPE, AUTOMATION_SUB_TYPE_BY_RESOURCE, WORKFLOW_PUBLISH_RESOURCE_TYPE, } from "./types.js";
21
+ /** The wire discriminant → the printer's factory name (TASK_FACTORY_V2 keys). */
22
+ const FACTORY_BY_TYPE_KEY = {
23
+ executeScript: "executeScript",
24
+ variable: "setVariable",
25
+ };
26
+ function str(v) {
27
+ return typeof v === "string" ? v : undefined;
28
+ }
29
+ /** Per-implemented-kind typed arg extraction (the from-tf half of the bridge). */
30
+ function taskArgs(typeKey, attrs, refCtx) {
31
+ switch (typeKey) {
32
+ case "executeScript": {
33
+ const args = { code: str(attrs["code"]) ?? "" };
34
+ const rawInputs = Array.isArray(attrs["inputs"]) ? attrs["inputs"] : [];
35
+ if (rawInputs.length > 0) {
36
+ const inputs = {};
37
+ for (const entry of rawInputs) {
38
+ const inputName = str(entry?.name);
39
+ if (inputName === undefined)
40
+ continue;
41
+ const converted = tfRefToAst((entry.value ?? ""), refCtx);
42
+ if ("unsupported" in converted)
43
+ return { unsupported: `input "${inputName}": ${converted.unsupported}` };
44
+ inputs[inputName] = converted.ast;
45
+ }
46
+ args["inputs"] = inputs;
47
+ }
48
+ const rawSchema = attrs["output_schema"];
49
+ if (rawSchema !== undefined) {
50
+ // Emitted as jsonencode({object:{properties:[{string:{name}},...]}}) —
51
+ // invert to the authoring alias record ({NAME: "text"|...}).
52
+ const schema = (isTfExpr(rawSchema) && rawSchema.$expr === "jsonencode" ? rawSchema.value : rawSchema);
53
+ const aliasByTag = { string: "text", integer: "integer", number: "number", bool: "boolean" };
54
+ const outputs = {};
55
+ for (const prop of schema?.object?.properties ?? []) {
56
+ const tag = Object.keys(prop)[0];
57
+ const propName = tag !== undefined ? prop[tag]?.name : undefined;
58
+ if (tag !== undefined && typeof propName === "string")
59
+ outputs[propName] = aliasByTag[tag] ?? "text";
60
+ }
61
+ if (Object.keys(outputs).length > 0)
62
+ args["outputs"] = outputs;
63
+ }
64
+ return { args };
65
+ }
66
+ case "variable": {
67
+ // One variable per tf task: variable_name/variable_type/value.
68
+ const decl = {
69
+ name: str(attrs["variable_name"]) ?? "",
70
+ type: str(attrs["variable_type"]) ?? "TEXT",
71
+ };
72
+ if (attrs["value"] !== undefined) {
73
+ const converted = tfRefToAst(attrs["value"], refCtx);
74
+ if ("unsupported" in converted)
75
+ return { unsupported: `variable value: ${converted.unsupported}` };
76
+ decl["value"] = converted.ast;
77
+ }
78
+ return { args: { create: [decl] } };
79
+ }
80
+ default:
81
+ return { args: {} };
82
+ }
83
+ }
84
+ /** Wire parameter type ("TEXT") → the authoring alias ("text"). */
85
+ function paramTypeAlias(wireType) {
86
+ const lower = wireType.toLowerCase();
87
+ return lower === "bool" ? "boolean" : lower;
88
+ }
89
+ /** Build the `TriggerAst` for an implemented trigger block. */
90
+ function triggerAst(typeKey, attrs) {
91
+ switch (typeKey) {
92
+ case "onDemand": {
93
+ const params = Array.isArray(attrs["parameters"]) ? attrs["parameters"] : [];
94
+ const inputs = params
95
+ .map((p) => {
96
+ const name = str(p["name"]);
97
+ if (name === undefined)
98
+ return undefined;
99
+ return {
100
+ name,
101
+ type: paramTypeAlias(str(p["type"]) ?? "TEXT"),
102
+ ...(p["required"] === true ? { required: true } : {}),
103
+ ...(p["multiple"] === true ? { multiple: true } : {}),
104
+ ...(str(p["default_value"]) !== undefined ? { defaultValue: str(p["default_value"]) } : {}),
105
+ };
106
+ })
107
+ .filter((p) => p !== undefined);
108
+ return {
109
+ kind: "onDemand",
110
+ inputs,
111
+ ...(attrs["show_triggered_by"] === true ? { showTriggeredBy: true } : {}),
112
+ };
113
+ }
114
+ default:
115
+ return undefined;
116
+ }
117
+ }
118
+ /**
119
+ * Reconstruct one automation. `blocks` are the family blocks that belong to it
120
+ * (already grouped by the caller: same `automation` ref / workflow_publish
121
+ * depends_on set). Returns `{ automation }` or `{ skippedReason }`.
122
+ */
123
+ export function automationFromTf(blocks, ctx) {
124
+ const automation = blocks.find((b) => b.type === AUTOMATION_RESOURCE_TYPE);
125
+ if (automation === undefined || automation.label === undefined) {
126
+ return { skippedReason: "no elementum_automation block in the group" };
127
+ }
128
+ const autoLabel = automation.label;
129
+ const name = str(automation.attrs["name"]) ?? autoLabel;
130
+ const where = `automation "${name}"`;
131
+ // Trigger — exactly one per automation.
132
+ const triggerBlock = blocks.find((b) => {
133
+ const row = b.type !== undefined ? AUTOMATION_SUB_TYPE_BY_RESOURCE.get(b.type) : undefined;
134
+ return row !== undefined && b.type?.endsWith("_trigger");
135
+ });
136
+ if (triggerBlock === undefined || triggerBlock.type === undefined) {
137
+ return { skippedReason: `${where}: no trigger block` };
138
+ }
139
+ const triggerRow = AUTOMATION_SUB_TYPE_BY_RESOURCE.get(triggerBlock.type);
140
+ if (triggerRow.implemented !== true) {
141
+ ctx.diagnostics.push(`${where}: trigger kind ${triggerBlock.type} is not carried yet; skipped`);
142
+ return { skippedReason: `${where}: unimplemented trigger ${triggerBlock.type}` };
143
+ }
144
+ const trigger = triggerAst(triggerRow.typeKey, triggerBlock.attrs);
145
+ if (trigger === undefined)
146
+ return { skippedReason: `${where}: no triggerAst for ${triggerRow.typeKey}` };
147
+ // Tasks — walk the parent chain from the trigger to recover order.
148
+ const taskBlocks = blocks.filter((b) => b.type?.endsWith("_task"));
149
+ // Recover each task's authored refKey. The tf label is snake_case (ei's
150
+ // labeling rule), so it is LOSSY for caps/spaces — but the block's `name`
151
+ // attribute carries the exact authored name, and for EDK-authored tasks
152
+ // name == refKey. Adopt `name` as the refKey whenever the label provably
153
+ // derives from it (sanitizeName(name) == label suffix); otherwise keep the
154
+ // label-suffix refKey and surface `name` as the displayName (a platform-
155
+ // authored task whose name doesn't map to its label).
156
+ const refKeyByLabel = new Map();
157
+ for (const b of taskBlocks) {
158
+ if (b.label === undefined)
159
+ continue;
160
+ const suffix = b.label.startsWith(`${autoLabel}_`) ? b.label.slice(autoLabel.length + 1) : b.label;
161
+ const taskName = str(b.attrs["name"]);
162
+ refKeyByLabel.set(b.label, taskName !== undefined && sanitizeName(taskName) === suffix ? taskName : suffix);
163
+ }
164
+ const refCtx = {
165
+ autoLabel,
166
+ isTriggerType: (type) => type.endsWith("_trigger") && AUTOMATION_SUB_TYPE_BY_RESOURCE.has(type),
167
+ refKeyByLabel,
168
+ };
169
+ const childrenOf = (parentType, parentLabel) => taskBlocks.filter((b) => {
170
+ const p = b.attrs["parent"];
171
+ return (isTfExpr(p) && p.$expr === "resource-attr" && p.type === parentType && p.label === parentLabel);
172
+ });
173
+ const tasks = [];
174
+ let curType = triggerBlock.type;
175
+ let curLabel = autoLabel;
176
+ const seen = new Set();
177
+ for (;;) {
178
+ const next = childrenOf(curType, curLabel);
179
+ if (next.length === 0)
180
+ break;
181
+ if (next.length > 1) {
182
+ ctx.diagnostics.push(`${where}: task "${curLabel}" has multiple children (branch/operator), not carried yet; stopping chain`);
183
+ }
184
+ const block = next[0];
185
+ const addr = `${block.type}.${block.label}`;
186
+ if (seen.has(addr)) {
187
+ ctx.diagnostics.push(`${where}: cyclic parent chain at ${addr}; stopping`);
188
+ break;
189
+ }
190
+ seen.add(addr);
191
+ const row = block.type !== undefined ? AUTOMATION_SUB_TYPE_BY_RESOURCE.get(block.type) : undefined;
192
+ if (row === undefined || row.implemented !== true || FACTORY_BY_TYPE_KEY[row.typeKey] === undefined) {
193
+ ctx.diagnostics.push(`${where}: task ${addr} of an unimplemented kind; skipped`);
194
+ curType = block.type;
195
+ curLabel = block.label;
196
+ continue;
197
+ }
198
+ const refKey = refKeyByLabel.get(block.label ?? "") ?? (block.label ?? "");
199
+ const displayName = str(block.attrs["name"]);
200
+ const extracted = taskArgs(row.typeKey, block.attrs, refCtx);
201
+ if ("unsupported" in extracted) {
202
+ ctx.diagnostics.push(`${where}: task ${addr}: ${extracted.unsupported}; skipped`);
203
+ curType = block.type;
204
+ curLabel = block.label;
205
+ continue;
206
+ }
207
+ const call = {
208
+ factory: FACTORY_BY_TYPE_KEY[row.typeKey],
209
+ refKey,
210
+ args: extracted.args,
211
+ ...(displayName !== undefined && displayName !== refKey ? { displayName } : {}),
212
+ };
213
+ tasks.push(call);
214
+ curType = block.type;
215
+ curLabel = block.label;
216
+ }
217
+ // Workflow outputs live on the publish block ([{name, value: refs expr}]).
218
+ const publish = blocks.find((b) => b.type === WORKFLOW_PUBLISH_RESOURCE_TYPE);
219
+ const workflowRevision = publish !== undefined ? str(publish.attrs["workflow_revision"]) : undefined;
220
+ const outputs = [];
221
+ const rawOutputs = publish !== undefined && Array.isArray(publish.attrs["outputs"]) ? publish.attrs["outputs"] : [];
222
+ for (const o of rawOutputs) {
223
+ const outName = str(o?.name);
224
+ if (outName === undefined)
225
+ continue;
226
+ const converted = tfRefToAst((o.value ?? ""), refCtx);
227
+ if ("unsupported" in converted) {
228
+ ctx.diagnostics.push(`${where}: output "${outName}": ${converted.unsupported}; skipped`);
229
+ continue;
230
+ }
231
+ outputs.push({ name: outName, value: converted.ast });
232
+ }
233
+ return {
234
+ automation: {
235
+ ownerHandle: ctx.ownerHandle,
236
+ name,
237
+ status: "DRAFT",
238
+ ...(workflowRevision !== undefined ? { workflowRevision } : {}),
239
+ trigger,
240
+ tasks,
241
+ ...(outputs.length > 0 ? { outputs } : {}),
242
+ },
243
+ };
244
+ }
245
+ /** Recognizes the blocks that make up automation families (for the pull partition). */
246
+ export function isAutomationFamilyType(type) {
247
+ if (type === undefined)
248
+ return false;
249
+ return (type === AUTOMATION_RESOURCE_TYPE ||
250
+ type === WORKFLOW_PUBLISH_RESOURCE_TYPE ||
251
+ AUTOMATION_SUB_TYPE_BY_RESOURCE.has(type));
252
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * v2 automation authoring — the typed, chainable builder (validation slice).
3
+ *
4
+ * The typed `ctx` engine is reused from `src/core` (`context` + `ref`); only the
5
+ * builder shell, trigger/task factories, and the token-aware serializer are v2.
6
+ * References inside one automation flow through `ctx` (compile-time-safe);
7
+ * cross-entity references are `CatalogRef` tokens resolved at deploy. Standalone
8
+ * from v1's deploy-wired builder.
9
+ */
10
+ 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";
11
+ export { ScriptCodeError, type ScriptCodeFn, type ScriptInput } from "./script-code.js";
12
+ export { childTask, forEach, forkJoin, switchTask, type ForEachConfig, type ForkJoinBranch, type ForkJoinConfig, type SwitchCase, type SwitchConfig, } from "./operators.js";
13
+ 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";
14
+ 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";
15
+ 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";
16
+ 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";
17
+ export * as filter from "./filter.js";
18
+ export { type Filter } from "./filter.js";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * v2 automation authoring — the typed, chainable builder (validation slice).
3
+ *
4
+ * The typed `ctx` engine is reused from `src/core` (`context` + `ref`); only the
5
+ * builder shell, trigger/task factories, and the token-aware serializer are v2.
6
+ * References inside one automation flow through `ctx` (compile-time-safe);
7
+ * cross-entity references are `CatalogRef` tokens resolved at deploy. Standalone
8
+ * from v1's deploy-wired builder.
9
+ */
10
+ export { chainableTrigger, defineAutomation, defineWorkflow, } from "./build.js";
11
+ export { ScriptCodeError } from "./script-code.js";
12
+ export { childTask, forEach, forkJoin, switchTask, } from "./operators.js";
13
+ export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, } from "./triggers.js";
14
+ export { aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, createRecord, executeScript, findRelatedRecords, postComment, recordSearch, relateRecords, sendEmail, setVariable, tableRecordsSearch, updateField, } from "./tasks.js";
15
+ export { addWatcher, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, calculation, filterTask, generateReport, initiateCall, notification, postTeamsMessage, procedure, recordFieldLocking, saveAttachment, unzip, userGroupSearch, userSearch, } from "./tasks.js";
16
+ export { approvalChainTemplate, approvalChain, bulkExcel, readFile, initiateEmailConversation, runAutomation, sendSurvey, } from "./tasks.js";
17
+ export * as filter from "./filter.js";
18
+ // Pull a deployed automation back as editable v2 source. `defineAutomation`
19
+ // is a plain factory returning a builder-chain object (not an Object.assign-able
20
+ // callable), so `fromJSON` ships as a standalone named export rather than a
21
+ // `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;