@elementumai/edk 0.8.2-alpha.5 → 0.9.2

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 (372) hide show
  1. package/README.md +18 -14
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
  3. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
  4. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
  5. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +2 -10
  6. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
  7. package/dist-sdk/fs/entity.d.ts +2 -2
  8. package/dist-sdk/fs/entity.js +1 -1
  9. package/dist-sdk/pull/missing-report.d.ts +81 -0
  10. package/dist-sdk/pull/missing-report.js +52 -0
  11. package/dist-sdk/src/catalog/factories.d.ts +53 -19
  12. package/dist-sdk/src/catalog/factories.js +51 -12
  13. package/dist-sdk/src/catalog/from-authoring.js +13 -3
  14. package/dist-sdk/src/catalog/index.d.ts +2 -2
  15. package/dist-sdk/src/catalog/index.js +1 -1
  16. package/dist-sdk/src/catalog/org.js +1 -0
  17. package/dist-sdk/src/catalog/render.js +6 -0
  18. package/dist-sdk/src/catalog/token.js +7 -0
  19. package/dist-sdk/src/catalog/types.d.ts +34 -23
  20. package/dist-sdk/src/catalog/types.js +7 -4
  21. package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
  22. package/dist-sdk/src/core/app-to-ui.js +7 -9
  23. package/dist-sdk/src/core/index.d.ts +1 -0
  24. package/dist-sdk/src/core/index.js +1 -0
  25. package/dist-sdk/src/core/platform-id.d.ts +11 -0
  26. package/dist-sdk/src/core/platform-id.js +8 -0
  27. package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +2 -2
  28. package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +6 -8
  29. package/dist-sdk/src/core/types/app.d.ts +13 -23
  30. package/dist-sdk/src/core/types/app.js +0 -1
  31. package/dist-sdk/src/engine/build/context.d.ts +3 -3
  32. package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
  33. package/dist-sdk/src/engine/pull/attrs.js +17 -0
  34. package/dist-sdk/src/engine/pull/context.d.ts +39 -0
  35. package/dist-sdk/src/engine/pull/org.d.ts +1 -0
  36. package/dist-sdk/src/engine/pull/org.js +2 -0
  37. package/dist-sdk/src/engine/tf/expr.d.ts +1 -1
  38. package/dist-sdk/src/engine/tf/expr.js +10 -3
  39. package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
  40. package/dist-sdk/src/entities/access-policy/build.d.ts +4 -13
  41. package/dist-sdk/src/entities/access-policy/build.js +1 -1
  42. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +12 -38
  43. package/dist-sdk/src/entities/access-policy/from-tf.js +16 -74
  44. package/dist-sdk/src/entities/access-policy/principal.d.ts +29 -0
  45. package/dist-sdk/src/entities/access-policy/principal.js +13 -0
  46. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +20 -5
  47. package/dist-sdk/src/entities/access-policy/to-tf.js +26 -54
  48. package/dist-sdk/src/entities/agent/build.d.ts +39 -8
  49. package/dist-sdk/src/entities/agent/build.js +36 -15
  50. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +5 -0
  51. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +121 -36
  52. package/dist-sdk/src/entities/agent/from-tf.js +5 -8
  53. package/dist-sdk/src/entities/agent/index.d.ts +5 -2
  54. package/dist-sdk/src/entities/agent/index.js +4 -2
  55. package/dist-sdk/src/entities/agent/module.js +5 -2
  56. package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
  57. package/dist-sdk/src/entities/agent/run-as.js +1 -0
  58. package/dist-sdk/src/entities/agent/to-tf.d.ts +2 -1
  59. package/dist-sdk/src/entities/agent/to-tf.js +2 -1
  60. package/dist-sdk/src/entities/agent/tools.d.ts +60 -48
  61. package/dist-sdk/src/entities/agent/tools.js +44 -38
  62. package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
  63. package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
  64. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +17 -8
  65. package/dist-sdk/src/entities/agent-tool/from-tf.js +127 -37
  66. package/dist-sdk/src/entities/agent-tool/module.js +6 -0
  67. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +5 -5
  68. package/dist-sdk/src/entities/agent-tool/to-tf.js +93 -20
  69. package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -5
  70. package/dist-sdk/src/entities/agent-tool/types.js +36 -8
  71. package/dist-sdk/src/entities/app/build.d.ts +137 -25
  72. package/dist-sdk/src/entities/app/build.js +104 -53
  73. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +173 -1
  74. package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
  75. package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +68 -0
  76. package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
  77. package/dist-sdk/src/entities/app/display-blocks.js +1 -1
  78. package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
  79. package/dist-sdk/src/entities/app/from-tf.js +30 -2
  80. package/dist-sdk/src/entities/app/index.d.ts +13 -4
  81. package/dist-sdk/src/entities/app/index.js +8 -1
  82. package/dist-sdk/src/entities/app/module.js +27 -2
  83. package/dist-sdk/src/entities/app/to-tf.js +75 -1
  84. package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
  85. package/dist-sdk/src/entities/approval-chain/build.js +49 -49
  86. package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
  87. package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
  88. package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
  89. package/dist-sdk/src/entities/approval-chain/index.js +2 -3
  90. package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
  91. package/dist-sdk/src/entities/approval-chain/module.js +51 -0
  92. package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
  93. package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
  94. package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
  95. package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
  96. package/dist-sdk/src/entities/automation/build.d.ts +10 -6
  97. package/dist-sdk/src/entities/automation/build.js +5 -4
  98. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +10 -8
  99. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +51 -114
  100. package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
  101. package/dist-sdk/src/entities/automation/filter.js +1 -197
  102. package/dist-sdk/src/entities/automation/from-tf.d.ts +4 -0
  103. package/dist-sdk/src/entities/automation/from-tf.js +202 -119
  104. package/dist-sdk/src/entities/automation/index.d.ts +4 -2
  105. package/dist-sdk/src/entities/automation/index.js +3 -1
  106. package/dist-sdk/src/entities/automation/module.js +10 -4
  107. package/dist-sdk/src/entities/automation/script-code.js +94 -6
  108. package/dist-sdk/src/entities/automation/tasks.d.ts +20 -19
  109. package/dist-sdk/src/entities/automation/tasks.js +2 -2
  110. package/dist-sdk/src/entities/automation/to-tf.d.ts +34 -2
  111. package/dist-sdk/src/entities/automation/to-tf.js +273 -98
  112. package/dist-sdk/src/entities/automation/triggers.d.ts +18 -17
  113. package/dist-sdk/src/entities/automation/triggers.js +1 -1
  114. package/dist-sdk/src/entities/dashboard/build.d.ts +17 -0
  115. package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
  116. package/dist-sdk/src/entities/dashboard/from-tf.js +95 -0
  117. package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
  118. package/dist-sdk/src/entities/dashboard/module.js +16 -0
  119. package/dist-sdk/src/entities/dashboard/to-tf.d.ts +30 -0
  120. package/dist-sdk/src/entities/dashboard/to-tf.js +94 -0
  121. package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
  122. package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
  123. package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
  124. package/dist-sdk/src/entities/data-lookup/module.js +22 -0
  125. package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
  126. package/dist-sdk/src/entities/datamine/build.js +1 -0
  127. package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
  128. package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
  129. package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
  130. package/dist-sdk/src/entities/datamine/module.js +23 -0
  131. package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
  132. package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
  133. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +303 -0
  134. package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
  135. package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
  136. package/dist-sdk/src/entities/dynamic-layout/dialect.js +9 -0
  137. package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
  138. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +233 -0
  139. package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
  140. package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
  141. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
  142. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
  143. package/dist-sdk/src/entities/element/build.d.ts +31 -14
  144. package/dist-sdk/src/entities/element/build.js +12 -4
  145. package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
  146. package/dist-sdk/src/entities/element/from-tf.js +31 -2
  147. package/dist-sdk/src/entities/element/index.d.ts +8 -3
  148. package/dist-sdk/src/entities/element/index.js +4 -1
  149. package/dist-sdk/src/entities/element/module.js +19 -2
  150. package/dist-sdk/src/entities/element/to-tf.js +57 -1
  151. package/dist-sdk/src/entities/field/build.d.ts +4 -3
  152. package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
  153. package/dist-sdk/src/entities/field/calculation-types.js +42 -0
  154. package/dist-sdk/src/entities/field/from-tf.js +90 -11
  155. package/dist-sdk/src/entities/field/module.d.ts +1 -0
  156. package/dist-sdk/src/entities/field/module.js +5 -2
  157. package/dist-sdk/src/entities/field/record-shape.d.ts +1 -1
  158. package/dist-sdk/src/entities/field/to-tf.d.ts +1 -1
  159. package/dist-sdk/src/entities/field/to-tf.js +22 -6
  160. package/dist-sdk/src/entities/field/types.js +3 -0
  161. package/dist-sdk/src/entities/file-reader/build.d.ts +66 -19
  162. package/dist-sdk/src/entities/file-reader/build.js +49 -4
  163. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
  164. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +11 -9
  165. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
  166. package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
  167. package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
  168. package/dist-sdk/src/entities/file-reader/index.js +3 -3
  169. package/dist-sdk/src/entities/file-reader/module.js +6 -5
  170. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
  171. package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
  172. package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
  173. package/dist-sdk/src/entities/file-reader/types.js +4 -5
  174. package/dist-sdk/src/entities/org/category.js +4 -5
  175. package/dist-sdk/src/entities/org/group.js +4 -5
  176. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  177. package/dist-sdk/src/entities/org/index.js +1 -0
  178. package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
  179. package/dist-sdk/src/entities/org/phone-provider.js +33 -0
  180. package/dist-sdk/src/entities/org/role.d.ts +3 -3
  181. package/dist-sdk/src/entities/org/role.js +9 -6
  182. package/dist-sdk/src/entities/organization/build.d.ts +29 -0
  183. package/dist-sdk/src/entities/organization/build.js +24 -0
  184. package/dist-sdk/src/entities/organization/index.d.ts +2 -0
  185. package/dist-sdk/src/entities/organization/index.js +2 -0
  186. package/dist-sdk/src/entities/organization/module.d.ts +2 -0
  187. package/dist-sdk/src/entities/organization/module.js +18 -0
  188. package/dist-sdk/src/entities/organization/to-tf.d.ts +6 -0
  189. package/dist-sdk/src/entities/organization/to-tf.js +37 -0
  190. package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
  191. package/dist-sdk/src/entities/phone-service/build.js +31 -0
  192. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
  193. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +54 -0
  194. package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
  195. package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
  196. package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
  197. package/dist-sdk/src/entities/phone-service/index.js +2 -0
  198. package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
  199. package/dist-sdk/src/entities/phone-service/module.js +55 -0
  200. package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
  201. package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
  202. package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
  203. package/dist-sdk/src/entities/phone-service/types.js +22 -0
  204. package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
  205. package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
  206. package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
  207. package/dist-sdk/src/entities/record-create-form/module.js +24 -0
  208. package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
  209. package/dist-sdk/src/entities/record-create-form/to-tf.js +80 -0
  210. package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
  211. package/dist-sdk/src/entities/relationship/build.js +1 -0
  212. package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
  213. package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
  214. package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
  215. package/dist-sdk/src/entities/relationship/module.js +16 -0
  216. package/dist-sdk/src/entities/relationship/to-tf.d.ts +31 -0
  217. package/dist-sdk/src/entities/relationship/to-tf.js +153 -0
  218. package/dist-sdk/src/entities/role/build.d.ts +65 -0
  219. package/dist-sdk/src/entities/role/build.js +33 -0
  220. package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
  221. package/dist-sdk/src/entities/role/from-tf.js +138 -0
  222. package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
  223. package/dist-sdk/src/entities/role/to-tf.js +69 -0
  224. package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
  225. package/dist-sdk/src/entities/search-table/build.js +110 -56
  226. package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
  227. package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
  228. package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
  229. package/dist-sdk/src/entities/search-table/index.js +2 -2
  230. package/dist-sdk/src/entities/search-table/module.js +88 -10
  231. package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
  232. package/dist-sdk/src/entities/search-table/printer.js +52 -0
  233. package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
  234. package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
  235. package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
  236. package/dist-sdk/src/entities/search-table/types.js +21 -0
  237. package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
  238. package/dist-sdk/src/entities/service-account/build.js +9 -0
  239. package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
  240. package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
  241. package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
  242. package/dist-sdk/src/entities/service-account/module.js +21 -0
  243. package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
  244. package/dist-sdk/src/entities/service-account/ref.js +5 -0
  245. package/dist-sdk/src/entities/service-account/to-tf.d.ts +11 -0
  246. package/dist-sdk/src/entities/service-account/to-tf.js +72 -0
  247. package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
  248. package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
  249. package/dist-sdk/src/entities/shared/filters/ast.d.ts +21 -79
  250. package/dist-sdk/src/entities/shared/filters/ast.js +5 -2
  251. package/dist-sdk/src/entities/shared/filters/index.d.ts +94 -206
  252. package/dist-sdk/src/entities/shared/filters/index.js +189 -341
  253. package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
  254. package/dist-sdk/src/entities/shared/filters/print.js +122 -0
  255. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
  256. package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
  257. package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
  258. package/dist-sdk/src/entities/shared/filters/types.js +2 -3
  259. package/dist-sdk/src/entities/skill/build.d.ts +2 -2
  260. package/dist-sdk/src/entities/skill/build.js +4 -3
  261. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +10 -0
  262. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +74 -32
  263. package/dist-sdk/src/entities/skill/index.d.ts +2 -1
  264. package/dist-sdk/src/entities/skill/index.js +2 -1
  265. package/dist-sdk/src/entities/skill/module.js +6 -0
  266. package/dist-sdk/src/entities/skill/to-tf.d.ts +5 -1
  267. package/dist-sdk/src/entities/skill/to-tf.js +18 -0
  268. package/dist-sdk/src/entities/skill/tools.d.ts +46 -31
  269. package/dist-sdk/src/entities/skill/tools.js +33 -20
  270. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -1
  271. package/dist-sdk/src/entities/skill-tool/from-tf.js +76 -8
  272. package/dist-sdk/src/entities/skill-tool/module.js +9 -0
  273. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
  274. package/dist-sdk/src/entities/skill-tool/to-tf.js +94 -42
  275. package/dist-sdk/src/entities/skill-tool/types.js +18 -1
  276. package/dist-sdk/src/entities/table/build.d.ts +64 -23
  277. package/dist-sdk/src/entities/table/build.js +33 -18
  278. package/dist-sdk/src/entities/table/catalog-render.js +6 -0
  279. package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
  280. package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
  281. package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
  282. package/dist-sdk/src/entities/table/fields/types.js +12 -0
  283. package/dist-sdk/src/entities/table/fields.d.ts +107 -47
  284. package/dist-sdk/src/entities/table/fields.js +76 -55
  285. package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
  286. package/dist-sdk/src/entities/table/from-tf.js +261 -0
  287. package/dist-sdk/src/entities/table/index.d.ts +7 -5
  288. package/dist-sdk/src/entities/table/index.js +7 -7
  289. package/dist-sdk/src/entities/table/joins.d.ts +22 -9
  290. package/dist-sdk/src/entities/table/joins.js +8 -16
  291. package/dist-sdk/src/entities/table/module.d.ts +2 -1
  292. package/dist-sdk/src/entities/table/module.js +13 -6
  293. package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
  294. package/dist-sdk/src/entities/table/to-tf.js +230 -0
  295. package/dist-sdk/src/entities/task/build.d.ts +43 -0
  296. package/dist-sdk/src/entities/task/build.js +17 -0
  297. package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
  298. package/dist-sdk/src/entities/task/from-tf.js +38 -0
  299. package/dist-sdk/src/entities/task/index.d.ts +1 -0
  300. package/dist-sdk/src/entities/task/index.js +1 -0
  301. package/dist-sdk/src/entities/task/module.d.ts +3 -0
  302. package/dist-sdk/src/entities/task/module.js +12 -0
  303. package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
  304. package/dist-sdk/src/entities/task/to-tf.js +49 -0
  305. package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
  306. package/dist-sdk/src/entities/view/from-tf.js +209 -25
  307. package/dist-sdk/src/entities/view/module.js +5 -1
  308. package/dist-sdk/src/entities/view/to-tf.d.ts +49 -7
  309. package/dist-sdk/src/entities/view/to-tf.js +155 -18
  310. package/dist-sdk/src/entities/view/types.d.ts +8 -0
  311. package/dist-sdk/src/entities/view/types.js +43 -0
  312. package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
  313. package/dist-sdk/src/entities/visual-flow/build.js +72 -0
  314. package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
  315. package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
  316. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
  317. package/dist-sdk/src/entities/visual-flow/index.js +1 -0
  318. package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
  319. package/dist-sdk/src/entities/visual-flow/module.js +41 -0
  320. package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
  321. package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
  322. package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +14 -0
  323. package/dist-sdk/src/entities/visual-flow/to-tf.js +101 -0
  324. package/dist-sdk/src/entities/widget/build.d.ts +55 -0
  325. package/dist-sdk/src/entities/widget/build.js +1 -0
  326. package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
  327. package/dist-sdk/src/entities/widget/from-tf.js +209 -0
  328. package/dist-sdk/src/entities/widget/module.d.ts +3 -0
  329. package/dist-sdk/src/entities/widget/module.js +16 -0
  330. package/dist-sdk/src/entities/widget/to-tf.d.ts +44 -0
  331. package/dist-sdk/src/entities/widget/to-tf.js +204 -0
  332. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
  333. package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
  334. package/dist-sdk/src/graph/index.d.ts +7 -0
  335. package/dist-sdk/src/graph/index.js +4 -18
  336. package/dist-sdk/src/graph/modules.js +30 -1
  337. package/dist-sdk/src/graph/types.d.ts +55 -7
  338. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  339. package/dist-sdk/src/internal/sdk-package.js +4 -2
  340. package/package.json +30 -15
  341. package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
  342. package/dist-sdk/src/entities/access-policy/filter.js +0 -83
  343. package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
  344. package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
  345. package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
  346. package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
  347. package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
  348. package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
  349. package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
  350. package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
  351. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
  352. package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
  353. package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
  354. package/dist-sdk/src/entities/flow/activities/form.js +0 -36
  355. package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
  356. package/dist-sdk/src/entities/flow/activities/index.js +0 -13
  357. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
  358. package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
  359. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
  360. package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
  361. package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
  362. package/dist-sdk/src/entities/flow/build.d.ts +0 -38
  363. package/dist-sdk/src/entities/flow/build.js +0 -115
  364. package/dist-sdk/src/entities/flow/index.d.ts +0 -8
  365. package/dist-sdk/src/entities/flow/index.js +0 -7
  366. package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
  367. package/dist-sdk/src/entities/flow/serialize.js +0 -94
  368. package/dist-sdk/src/entities/flow/util.d.ts +0 -27
  369. package/dist-sdk/src/entities/flow/util.js +0 -38
  370. package/dist-sdk/src/entities/table/filter.d.ts +0 -41
  371. package/dist-sdk/src/entities/table/filter.js +0 -89
  372. /package/dist-sdk/src/entities/{flow/activities/types.js → dashboard/build.js} +0 -0
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @elementumai/edk
2
2
 
3
3
  Statically typed TypeScript SDK for authoring Elementum apps, elements,
4
- automations, agents, skills, flows, search tables, and related configuration as
4
+ automations, agents, skills, search tables, and related configuration as
5
5
  code. `@elementumai/edk` is SDK-only; the standalone `elementum` CLI is
6
6
  distributed separately as part of the signed toolchain.
7
7
 
@@ -90,7 +90,9 @@ cd <instance>/<organization>
90
90
  elementum --profile=<profile> init
91
91
  ```
92
92
 
93
- `pull org --data-only` bootstraps and refreshes org reference identities. It
93
+ `pull org --data-only` bootstraps and refreshes org reference identities. Plain
94
+ `pull org` additionally writes editable `organization.ts`, adopts supported
95
+ org-owned resources, and keeps the generated `org.ts` catalog separate. It
94
96
  creates the package/workspace scaffolding, `org.ts`, the `@catalog` path alias,
95
97
  and the Terraform input/output skeleton:
96
98
 
@@ -100,6 +102,7 @@ and the Terraform input/output skeleton:
100
102
  <instance>/
101
103
  <organization>/
102
104
  org.ts
105
+ organization.ts # editable org resources after plain `pull org`
103
106
  tsconfig.json
104
107
  backend.tf # optional locking backend; user-owned and committed
105
108
  terraform.tfstate # committed local state when backend.tf is absent
@@ -156,6 +159,7 @@ elementum update [--check | --dry-run] [--channel stable|preview] [--version <se
156
159
  elementum migrate backend [orgRoot] [--check | --dry-run | --auto-approve] [--reconfigure]
157
160
  elementum migrate provider-source [orgRoot] [--check | --dry-run | --auto-approve]
158
161
 
162
+ elementum pull org [--root <orgRoot>] [--no-adopt]
159
163
  elementum pull org --data-only [--root <orgRoot>]
160
164
  elementum pull app <namespace> [--root <orgRoot>] [--no-adopt]
161
165
  elementum pull element <namespace> [--root <orgRoot>] [--no-adopt]
@@ -229,7 +233,7 @@ Canvas is an offline, live-reloading view of authored source:
229
233
 
230
234
  ```sh
231
235
  elementum canvas <instance>/<organization>
232
- elementum canvas apps/myApp/flows/someFlow.ts
236
+ elementum canvas apps/myApp/automations/someAutomation.ts
233
237
  ```
234
238
 
235
239
  A directory target opens the workspace explorer at `http://localhost:3456`,
@@ -254,13 +258,12 @@ import {
254
258
  import {
255
259
  agentCreateRecord,
256
260
  agentRunAutomation,
257
- agentSearchAspect,
261
+ agentSearchRecords,
258
262
  defineAgent,
259
263
  } from "@elementumai/edk/agents";
260
264
  import { defineSkill } from "@elementumai/edk/agents/skills";
261
- import { defineFlow } from "@elementumai/edk/flows";
262
- import { defineSearchTable } from "@elementumai/edk/searchTables";
263
- import { defineApprovalChain } from "@elementumai/edk/approvalChains";
265
+ import { defineLinkedSearchTable, defineSearchTable, searchTableDuration } from "@elementumai/edk/searchTables";
266
+ import { defineApprovalProcess } from "@elementumai/edk/approvalProcesses";
264
267
  import { defineTable } from "@elementumai/edk/tables";
265
268
  import { eq } from "@elementumai/edk/core/filters";
266
269
  import catalog from "@catalog";
@@ -303,10 +306,11 @@ Terraform mappings land.
303
306
  ```ts
304
307
  import { defineAutomation, onDemand } from "@elementumai/edk/automations";
305
308
  import { template } from "@elementumai/edk/core";
309
+ import catalog from "@catalog";
306
310
 
307
311
  export default defineAutomation({
308
312
  name: "Greet New Student",
309
- parent: "students",
313
+ app: catalog.students,
310
314
  workflowRevision: "1.0.0",
311
315
  workflow: onDemand({ STUDENT_NAME: "text" })
312
316
  .setVariable("GREETING", {
@@ -324,7 +328,7 @@ export default defineAutomation({
324
328
  });
325
329
  ```
326
330
 
327
- The file path supplies the automation ref; `parent` is the owning app ref.
331
+ The file path supplies the automation ref; `app` is the strongly typed owning app ref.
328
332
  `workflowRevision` is required SemVer and is the explicit publish gate. Editing
329
333
  tasks or triggers updates the draft; bump the revision only when that draft
330
334
  should be published.
@@ -335,21 +339,21 @@ Agents live under `apps/<appRef>/agents/<agentRef>.ts`. Their connector comes
335
339
  from the org catalog, while app and field targets come from `@catalog`:
336
340
 
337
341
  ```ts
338
- import { agentSearchAspect, defineAgent } from "@elementumai/edk/agents";
342
+ import { agentSearchRecords, defineAgent } from "@elementumai/edk/agents";
339
343
  import catalog from "@catalog";
340
344
  import { org } from "../../../org.js";
341
345
 
342
346
  export default defineAgent({
343
347
  name: "Support Agent",
344
- parent: "support",
348
+ app: catalog.support,
345
349
  connector: org.connectors.claudeSonnet,
346
350
  description: "Finds support records.",
347
351
  instructions: "Search records and summarize the next action.",
348
352
  tools: [
349
- agentSearchAspect({
353
+ agentSearchRecords({
350
354
  name: "find_records",
351
355
  description: "Searches support records.",
352
- aspect: catalog.support,
356
+ app: catalog.support,
353
357
  queryDescription: "Describe the record to find.",
354
358
  fields: [
355
359
  {
@@ -362,7 +366,7 @@ export default defineAgent({
362
366
  });
363
367
  ```
364
368
 
365
- The Terraform path currently round-trips create-record, search-aspect, and
369
+ The Terraform path currently round-trips create-record, record-search, and
366
370
  run-automation agent tools. Unsupported tools and runtime-only knobs are
367
371
  reported as build diagnostics instead of being emitted as partial resources.
368
372
  Authored tool names use 1–64 letters, digits, or underscores, with no doubled
@@ -148,13 +148,13 @@ export interface AgentTool {
148
148
  readonly fields?: readonly AgentToolField[];
149
149
  /**
150
150
  * Wire `Filter` — the platform's polymorphic filter JSON, typed
151
- * against the same `FilterExpr` source authors use. The serializer's
151
+ * against the same canonical `Filter` source authors use. The serializer's
152
152
  * `structuredClone` pass-through means wire and source shapes are
153
153
  * structurally identical; the deserializer walks this through
154
- * `pull/normalize-filter.ts:normalizeFilter` to produce a `FilterAst`
154
+ * `pull/normalize-filter.ts:normalizeFilter` to resolve references in place
155
155
  * the printer can render as a typed `(row) => ...` callback.
156
156
  */
157
- readonly filter?: import("../../../../src/entities/shared/filters/types.js").FilterExpr;
157
+ readonly filter?: import("../../../../src/entities/shared/filters/types.js").Filter;
158
158
  /**
159
159
  * Wire `Sort` shape — `{ orders: [{ field: <fieldId>, direction }] }`.
160
160
  * Authored as `SortOrder | readonly SortOrder[]` on the EDK side and
@@ -35,5 +35,5 @@
35
35
  export type { AgentAspectInput, AgentAspectUpdateInput, AgentFieldUpdateInput, ApprovalChainTemplate, Aspect, AspectCategory, AspectCloudConnection, AspectDefinitionInput, AspectDisplayBlockInput, AspectDisplayBlockPullResponse, AspectDocumentModel, AspectDocumentModelField, AspectField, AspectFieldCalculation, AspectFieldCalculationIncludeType, AspectFieldCalculationReferencedField, AspectFieldPullResponse, AspectFieldResult, AspectFlow, AspectOperationSummary, AspectPicklistDynamicConfigRef, AspectPullInput, AspectPullResponse, AspectSearchTable, AspectSearchTableField, AspectStage, AspectTypeWire, CloudMappingInput, CloudOptionsInput, ComposeAspectWireResponse, DeployedAspect, DisplayBlockPropertiesInput, PicklistValue, RecordCreateTypesInput, ServiceConfigInput, SnowflakeMappingInput, SnowflakeOptionsInput, UpdateAspectWireResponse, } from "./aspect.js";
36
36
  export type { AspectFieldBaseInput } from "./field-base.js";
37
37
  export type { AspectFieldQrFormat, AspectNumericFieldFormat, AspectReferenceFieldFormat, CurrencyCode, } from "./format.js";
38
- export type { AspectDynamicPicklistValuesRenderType, PicklistConfigInput, PicklistDynamicConfigInput, PicklistDynamicParentMapping, PicklistFilterInput, PicklistSortInput, PicklistStaticConfigInput, PicklistValueExInput, } from "./picklist-config.js";
38
+ export type { AspectDynamicPicklistValuesRenderType, PicklistConfigInput, PicklistDynamicConfigInput, PicklistDynamicParentMapping, PicklistSortInput, PicklistStaticConfigInput, PicklistValueExInput, } from "./picklist-config.js";
39
39
  export type { AspectAttachmentFieldInput, AspectBooleanFieldInput, AspectCalculatedFieldInput, AspectDateFieldInput, AspectDateTimeFieldInput, AspectDecimalFieldInput, AspectFieldCalculationIncludeTypeInput, AspectFieldCalculationInput, AspectFieldCalculationParameterInput, AspectFieldInput, AspectFieldInputKey, AspectGroupFieldInput, AspectHandleFieldInput, AspectHtmlFieldInput, AspectJsonFieldInput, AspectMultiPicklistFieldInput, AspectNumberFieldInput, AspectPicklistBaseFieldInput, AspectPicklistFieldInput, AspectTextFieldInput, AspectUserFieldInput, } from "./field-types.js";
@@ -8,15 +8,7 @@
8
8
  * paths intentionally not surfaced — see comments on
9
9
  * `PicklistConfigInput`.
10
10
  */
11
- /**
12
- * Free-form filter shape forwarded verbatim to ultron's `Filter` wire
13
- * type. The EDK has its own filter authoring system under
14
- * `src/core/filters/` that emits this shape; tightening this slot to
15
- * the EDK's `FilterExpr` would couple the entity-client to the core
16
- * filter module, so we leave it loose here and let the serializer-side
17
- * helpers project on this slot when needed.
18
- */
19
- export type PicklistFilterInput = Readonly<Record<string, unknown>>;
11
+ import type { Filter } from "../../../../src/entities/shared/filters/types.js";
20
12
  /** Free-form sort spec forwarded verbatim to ultron's `Sort` type. */
21
13
  export type PicklistSortInput = Readonly<Record<string, unknown>>;
22
14
  /**
@@ -44,7 +36,7 @@ export interface PicklistDynamicParentMapping {
44
36
  */
45
37
  export interface PicklistStaticConfigInput {
46
38
  readonly parentFieldId?: string;
47
- readonly filter?: PicklistFilterInput;
39
+ readonly filter?: Filter;
48
40
  readonly sort?: PicklistSortInput;
49
41
  }
50
42
  /**
@@ -61,7 +53,7 @@ export interface PicklistDynamicConfigInput {
61
53
  readonly parentMappings?: readonly PicklistDynamicParentMapping[];
62
54
  readonly autoRelate?: boolean;
63
55
  readonly valuesRenderType?: AspectDynamicPicklistValuesRenderType;
64
- readonly filter?: PicklistFilterInput;
56
+ readonly filter?: Filter;
65
57
  readonly sort?: PicklistSortInput;
66
58
  }
67
59
  /**
@@ -16,6 +16,7 @@
16
16
  * "View" variants. Each field documents which endpoints drive it.
17
17
  */
18
18
  import type { AutomationOwnerType, Owner } from "../../../../fs/entity.js";
19
+ import type { Filter } from "../../../../src/entities/shared/filters/types.js";
19
20
  import type { WorkflowFieldType } from "../../../../src/entities/shared/types/field-types.js";
20
21
  export interface TriggerParameter {
21
22
  readonly id: string;
@@ -77,15 +78,6 @@ export interface WorkflowTask {
77
78
  readonly child?: boolean;
78
79
  readonly [key: string]: unknown;
79
80
  }
80
- /**
81
- * Filter shape carried on a SWITCH child case. The full-state response
82
- * embeds the same `FilterReference` payload mobius persists; the
83
- * deserializer walks it for embedded value/task references.
84
- */
85
- export type WorkflowFilter = {
86
- readonly type: string;
87
- readonly [key: string]: unknown;
88
- };
89
81
  /**
90
82
  * A switch case / forEach body — the grouped child structure mobius
91
83
  * returns under each operator task on the full-state view.
@@ -98,7 +90,7 @@ export type WorkflowFilter = {
98
90
  */
99
91
  export interface WorkflowOperatorChildView {
100
92
  readonly label: string | null;
101
- readonly filter?: WorkflowFilter;
93
+ readonly filter?: Filter;
102
94
  readonly tasks: readonly WorkflowTaskView[];
103
95
  }
104
96
  /**
@@ -103,7 +103,7 @@ export interface SkillTool {
103
103
  readonly displayName?: string;
104
104
  };
105
105
  readonly fields?: readonly SkillToolField[];
106
- readonly filter?: import("../../../../src/entities/shared/filters/types.js").FilterExpr;
106
+ readonly filter?: import("../../../../src/entities/shared/filters/types.js").Filter;
107
107
  readonly filterVariables?: readonly SkillToolFilterVariable[];
108
108
  readonly sort?: {
109
109
  readonly orders: ReadonlyArray<{
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * An EDK entity is one of the top-level objects defined under
15
15
  * `elementum-entity-client/clients/<x>/`: agent, aspect (app),
16
- * automation, skill, flow, user, group. Each is the canonical shape
16
+ * automation, skill, user, group. Each is the canonical shape
17
17
  * for that thing as it exists in the user's Elementum org. The
18
18
  * `entityType` discriminator is added by the client function on the
19
19
  * way out (it's not on antman's wire) so downstream code can
@@ -28,7 +28,7 @@
28
28
  * Adding a new client (e.g. once wolverine flows ship) means
29
29
  * extending this union and the `WritableEdkEntityType` filter below.
30
30
  */
31
- export type EdkEntityType = "agent" | "approvalChain" | "aspect" | "automation" | "flow" | "group" | "searchTable" | "skill" | "table" | "user";
31
+ export type EdkEntityType = "agent" | "approvalChain" | "aspect" | "automation" | "group" | "searchTable" | "skill" | "table" | "user";
32
32
  /**
33
33
  * Entity types that have a `generated/` source representation. Users
34
34
  * and groups are discovery-only — they don't get pulled or authored —
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * An EDK entity is one of the top-level objects defined under
15
15
  * `elementum-entity-client/clients/<x>/`: agent, aspect (app),
16
- * automation, skill, flow, user, group. Each is the canonical shape
16
+ * automation, skill, user, group. Each is the canonical shape
17
17
  * for that thing as it exists in the user's Elementum org. The
18
18
  * `entityType` discriminator is added by the client function on the
19
19
  * way out (it's not on antman's wire) so downstream code can
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Generic, cross-entity "what the pull couldn't resolve" mechanism.
3
+ *
4
+ * Every pull flow (automation, skill, flow, agent, …) threads a single
5
+ * `MissingDataCollector` through its stages. Each stage records what
6
+ * it couldn't resolve — an aspect antman returned 404 for, a field ref
7
+ * that wasn't in any app's field bag, a task type this EDK version
8
+ * doesn't support, a missing AI provider connector, whatever. The
9
+ * orchestrator snapshots the collector at the end and surfaces the
10
+ * report alongside the file paths it wrote.
11
+ *
12
+ * The design principle: never abort a pull because one piece of data
13
+ * is missing. Deliver every file the collected data supports, and
14
+ * hand the agent a structured report so it can tell the user
15
+ * precisely what's missing and why. Broken imports, fabricated
16
+ * handles, and silent omissions are all ruled out by construction —
17
+ * callers must either (a) emit real data from the catalog or (b)
18
+ * record a miss and degrade the output honestly.
19
+ *
20
+ * `MissingCategory` is a flat string union. Top-level entity misses
21
+ * reuse `EdkEntityType` directly (a missing aspect is `"aspect"`, a
22
+ * missing referenced skill is `"skill"`); other misses use bare
23
+ * strings (`"task"`, `"trigger"`, `"fieldRef"`, `"valueRef"`). A
24
+ * compile-time check below guards against drift — if `EdkEntityType`
25
+ * ever gains a value that overlaps with the bare strings, the build
26
+ * fails.
27
+ */
28
+ import type { EdkEntityType } from "../fs/entity.js";
29
+ /**
30
+ * Closed set of category labels for missed data. Top-level entity
31
+ * misses reuse `EdkEntityType`; everything else uses bare strings.
32
+ */
33
+ export type MissingCategory = EdkEntityType | "task" | "trigger" | "fieldRef" | "valueRef" | "stage" | "displayBlock";
34
+ /**
35
+ * A single item of data the pull flow couldn't resolve. Generic
36
+ * across entity types so every pull can report its own categories
37
+ * without adding new machinery.
38
+ */
39
+ export interface MissingItem {
40
+ /** What kind of thing is missing. Closed union — see `MissingCategory`. */
41
+ readonly category: MissingCategory;
42
+ /**
43
+ * The unresolved identifier. Usually a UUID, sometimes a refKey or
44
+ * type name (e.g. a `WorkflowTaskType` we don't support).
45
+ */
46
+ readonly id: string;
47
+ /**
48
+ * Human-readable explanation of why the item couldn't be resolved.
49
+ * Surfaces in the agent-facing output; write it as something the
50
+ * agent can relay to a user without translation.
51
+ */
52
+ readonly reason: string;
53
+ /**
54
+ * Optional: where in the source entity the miss occurred — a task
55
+ * refKey, `"trigger"`, `"automation owner"`, etc. Helps the agent
56
+ * point the user at the right part of the pulled bundle.
57
+ */
58
+ readonly context?: string;
59
+ }
60
+ /**
61
+ * Snapshot of everything the pull couldn't resolve. Returned from the
62
+ * orchestrator as part of the `PullResult`.
63
+ */
64
+ export interface MissingDataReport {
65
+ readonly items: readonly MissingItem[];
66
+ /** True iff no items were recorded — the pull completed cleanly. */
67
+ readonly isEmpty: boolean;
68
+ }
69
+ /**
70
+ * Mutable collector threaded through a single pull call. Every stage
71
+ * (`buildAppCatalog`, `deserializeAutomation`, the printer) receives
72
+ * the same instance and appends to it; the orchestrator snapshots via
73
+ * `build()` just before returning.
74
+ */
75
+ export declare class MissingDataCollector {
76
+ private readonly items;
77
+ record(item: MissingItem): void;
78
+ build(): MissingDataReport;
79
+ }
80
+ /** An empty report, useful as a default in call sites that don't collect. */
81
+ export declare const EMPTY_MISSING_REPORT: MissingDataReport;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Generic, cross-entity "what the pull couldn't resolve" mechanism.
3
+ *
4
+ * Every pull flow (automation, skill, flow, agent, …) threads a single
5
+ * `MissingDataCollector` through its stages. Each stage records what
6
+ * it couldn't resolve — an aspect antman returned 404 for, a field ref
7
+ * that wasn't in any app's field bag, a task type this EDK version
8
+ * doesn't support, a missing AI provider connector, whatever. The
9
+ * orchestrator snapshots the collector at the end and surfaces the
10
+ * report alongside the file paths it wrote.
11
+ *
12
+ * The design principle: never abort a pull because one piece of data
13
+ * is missing. Deliver every file the collected data supports, and
14
+ * hand the agent a structured report so it can tell the user
15
+ * precisely what's missing and why. Broken imports, fabricated
16
+ * handles, and silent omissions are all ruled out by construction —
17
+ * callers must either (a) emit real data from the catalog or (b)
18
+ * record a miss and degrade the output honestly.
19
+ *
20
+ * `MissingCategory` is a flat string union. Top-level entity misses
21
+ * reuse `EdkEntityType` directly (a missing aspect is `"aspect"`, a
22
+ * missing referenced skill is `"skill"`); other misses use bare
23
+ * strings (`"task"`, `"trigger"`, `"fieldRef"`, `"valueRef"`). A
24
+ * compile-time check below guards against drift — if `EdkEntityType`
25
+ * ever gains a value that overlaps with the bare strings, the build
26
+ * fails.
27
+ */
28
+ const _categoryOverlapCheck = true;
29
+ void _categoryOverlapCheck;
30
+ /**
31
+ * Mutable collector threaded through a single pull call. Every stage
32
+ * (`buildAppCatalog`, `deserializeAutomation`, the printer) receives
33
+ * the same instance and appends to it; the orchestrator snapshots via
34
+ * `build()` just before returning.
35
+ */
36
+ export class MissingDataCollector {
37
+ items = [];
38
+ record(item) {
39
+ this.items.push(item);
40
+ }
41
+ build() {
42
+ return {
43
+ items: this.items.slice(),
44
+ isEmpty: this.items.length === 0,
45
+ };
46
+ }
47
+ }
48
+ /** An empty report, useful as a default in call sites that don't collect. */
49
+ export const EMPTY_MISSING_REPORT = {
50
+ items: Object.freeze([]),
51
+ isEmpty: true,
52
+ };
@@ -19,7 +19,7 @@
19
19
  * nothing reads those interim values.
20
20
  */
21
21
  import type { AiProviderLlmModel, AiProviderType } from "./ai-provider-models.js";
22
- import type { AgentRef, AiProviderRef, ApprovalChainRef, AutomationCatalogRef, CatalogRef, CategoryRef, CloudLinkRef, ConnectorRef, GroupRef, FileReaderCatalogRef, DocumentModelFieldRef, FieldRef, FlowRef, OutputPropertyRef, SearchTableRef, SkillRef, TableColumnRef, TableRef, TriggerParameterRef } from "./types.js";
22
+ import type { AgentRef, AiProviderRef, ApprovalChainRef, AutomationCatalogRef, CatalogRef, CategoryRef, CloudLinkRef, ConnectorRef, DatamineRef, GroupRef, PhoneProviderRef, PhoneServiceRef, FileReaderCatalogRef, DocumentModelFieldRef, FieldRef, OutputPropertyRef, SearchTableRef, SkillRef, TableColumnRef, TableRef, TriggerParameterRef } from "./types.js";
23
23
  /** Fixed platform user-directory schema used by userSearch filters. */
24
24
  export declare const usersCatalog: {
25
25
  readonly fields: {
@@ -49,6 +49,10 @@ export declare const usersCatalog: {
49
49
  };
50
50
  };
51
51
  };
52
+ /** Lightweight typed owner token for tests and generated bootstrap code. Prefer the generated catalog in app source. */
53
+ export declare function appRef<const RefName extends string>(refName: RefName, name?: string): CatalogRef<"app", RefName>;
54
+ /** Lightweight typed element-owner token. Prefer the generated catalog in authored workspace source. */
55
+ export declare function elementRef<const RefName extends string>(refName: RefName, name?: string): CatalogRef<"element", RefName>;
52
56
  /** An app/element catalog's bags: reference-only kinds plus behavioral kinds sourced from authoring files. */
53
57
  interface AppCatalogBags {
54
58
  readonly fields?: Record<string, FieldRef>;
@@ -57,7 +61,17 @@ interface AppCatalogBags {
57
61
  readonly automations?: Record<string, AutomationCatalogRef>;
58
62
  readonly agents?: Record<string, AgentRef>;
59
63
  readonly skills?: Record<string, SkillRef>;
64
+ readonly approvalChains?: Record<string, ApprovalChainRef>;
65
+ readonly phoneServices?: Record<string, PhoneServiceRef>;
60
66
  }
67
+ /** Preserve an app catalog's literal owner and agent keys after parent stamping. */
68
+ type WithOwnedAgents<B extends AppCatalogBags, Parent extends string> = B extends {
69
+ readonly agents: infer A extends Record<string, AgentRef>;
70
+ } ? Omit<B, "agents"> & {
71
+ readonly agents: {
72
+ readonly [K in keyof A]: A[K] & AgentRef<Parent, Extract<K, string>>;
73
+ };
74
+ } : B;
61
75
  /**
62
76
  * Automation ref. Accepts optional `trigger` and `outputs` bags of typed parameter/property refs —
63
77
  * e.g. `automationRef({ trigger: { topic: triggerParameterRef({ name: "topic", parent: "auto" }) } })`
@@ -129,19 +143,25 @@ export declare function skillRef(opts?: {
129
143
  readonly name?: string;
130
144
  readonly parent?: string;
131
145
  }): SkillRef;
132
- export declare const flowRef: (opts: Omit<FlowRef, "refName" | "__kind">) => Omit<FlowRef, "refName" | "__kind"> & {
133
- readonly __kind: "flow";
134
- readonly refName: string;
135
- };
136
- export declare const approvalChainRef: (opts: Omit<ApprovalChainRef, "refName" | "__kind">) => Omit<ApprovalChainRef, "refName" | "__kind"> & {
146
+ export declare function phoneServiceRef(opts?: {
147
+ readonly name?: string;
148
+ readonly parent?: string;
149
+ }): PhoneServiceRef;
150
+ export declare function datamineRef(opts?: {
151
+ readonly name?: string;
152
+ readonly parent?: string;
153
+ }): DatamineRef;
154
+ export declare const approvalChainRef: (opts: Omit<ApprovalChainRef<string, string>, "parent" | "refName" | "__kind">) => Omit<ApprovalChainRef<string, string>, "parent" | "refName" | "__kind"> & {
137
155
  readonly __kind: "approvalChain";
138
156
  readonly refName: string;
139
157
  };
140
- export declare const searchTableRef: (opts: Omit<SearchTableRef, "refName" | "__kind">) => Omit<SearchTableRef, "refName" | "__kind"> & {
141
- readonly __kind: "searchTable";
142
- readonly refName: string;
143
- };
144
- export declare const connectorRef: (opts: Omit<ConnectorRef, "refName" | "__kind">) => Omit<ConnectorRef, "refName" | "__kind"> & {
158
+ /** Reference to a managed element search table. Resource selection stays private. */
159
+ export declare function searchTableRef(opts: Omit<SearchTableRef, "__kind" | "refName" | "parent">): SearchTableRef;
160
+ /** Reference to an existing linked Cortex Search Service. */
161
+ export declare function linkedSearchTableRef(opts: Omit<SearchTableRef, "__kind" | "refName" | "parent">): SearchTableRef;
162
+ /** Reference to a managed search table owned by an Elementum Table. */
163
+ export declare function tableSearchTableRef(opts: Omit<SearchTableRef, "__kind" | "refName" | "parent">): SearchTableRef;
164
+ export declare const connectorRef: (opts: Omit<import("./types.js").AiServiceRef, "refName" | "__kind">) => Omit<import("./types.js").AiServiceRef, "refName" | "__kind"> & {
145
165
  readonly __kind: "connector";
146
166
  readonly refName: string;
147
167
  };
@@ -179,10 +199,20 @@ export declare const groupRef: (opts: Omit<GroupRef, "refName" | "__kind">) => O
179
199
  readonly __kind: "group";
180
200
  readonly refName: string;
181
201
  };
202
+ export declare const phoneProviderRef: (opts: Omit<PhoneProviderRef, "refName" | "__kind">) => Omit<PhoneProviderRef, "refName" | "__kind"> & {
203
+ readonly __kind: "phoneProvider";
204
+ readonly refName: string;
205
+ };
182
206
  export declare function tableColumnRef(opts: Omit<TableColumnRef, "__kind" | "refName" | "parent"> & {
183
207
  readonly parent?: string;
184
208
  }): TableColumnRef;
185
- export declare function tableRef(opts: Omit<TableRef, "__kind" | "refName">): TableRef;
209
+ export declare function tableRef<const Columns extends Readonly<Record<string, TableColumnRef>> | undefined = undefined, const RefName extends string = string>(opts: Omit<TableRef, "__kind" | "refName" | "columns"> & {
210
+ readonly refName?: RefName;
211
+ readonly columns?: Columns;
212
+ }): TableRef & {
213
+ readonly refName: RefName;
214
+ readonly columns: Columns;
215
+ };
186
216
  /**
187
217
  * `refName` is optional and defaults to `name` — for a caller with no bag-key
188
218
  * context (e.g. a cross-aspect field ref where the field belongs to an aspect
@@ -212,15 +242,15 @@ export declare const fieldRef: <const T extends Omit<FieldRef, "__kind" | "refNa
212
242
  * `identity.refName` — their factory calls (`automationRef()`, `agentRef()`,
213
243
  * `searchTableRef({ name })`, …) need no `parent` argument.
214
244
  */
215
- export declare function appCatalog<B extends AppCatalogBags>(identity: {
216
- readonly refName: string;
245
+ export declare function appCatalog<const RefName extends string, B extends AppCatalogBags>(identity: {
246
+ readonly refName: RefName;
217
247
  readonly name: string;
218
- }, bags: B): CatalogRef<"app"> & B;
248
+ }, bags: B): CatalogRef<"app", RefName> & WithOwnedAgents<B, RefName>;
219
249
  /** Same as {@link appCatalog}, but for an element catalog root. */
220
- export declare function elementCatalog<B extends AppCatalogBags>(identity: {
221
- readonly refName: string;
250
+ export declare function elementCatalog<const RefName extends string, B extends AppCatalogBags>(identity: {
251
+ readonly refName: RefName;
222
252
  readonly name: string;
223
- }, bags: B): CatalogRef<"element"> & B;
253
+ }, bags: B): CatalogRef<"element", RefName> & B;
224
254
  /**
225
255
  * Assemble the org catalog object. Produces `{ handle: "org", name: "Org", ...bags }`.
226
256
  * No `__kind` — the org is not a `CatalogRef` kind and is referenced only as
@@ -229,14 +259,18 @@ export declare function elementCatalog<B extends AppCatalogBags>(identity: {
229
259
  * unlike every other identity in this file, it's not a ref name. Bag entries'
230
260
  * `.handle` are stamped from their own key, same as `appCatalog`.
231
261
  */
262
+ type PhoneProviderOrgCatalogBag = {
263
+ readonly phoneProviders: Readonly<Record<string, PhoneProviderRef>>;
264
+ };
232
265
  export declare function orgCatalog<B extends {
233
266
  aiProviders?: Record<string, AiProviderRef>;
234
267
  cloudLinks?: Record<string, CloudLinkRef>;
235
268
  categories?: Record<string, CategoryRef>;
236
269
  groups?: Record<string, GroupRef>;
270
+ phoneProviders?: Record<string, PhoneProviderRef>;
237
271
  tables?: Record<string, TableRef>;
238
272
  }>(bags: B): {
239
273
  readonly handle: "org";
240
274
  readonly name: "Org";
241
- } & B;
275
+ } & B & PhoneProviderOrgCatalogBag;
242
276
  export {};
@@ -7,6 +7,14 @@ export const usersCatalog = {
7
7
  lastName: { __kind: "userField", refName: "lastName", name: "lastName", fieldType: "TEXT" },
8
8
  },
9
9
  };
10
+ /** Lightweight typed owner token for tests and generated bootstrap code. Prefer the generated catalog in app source. */
11
+ export function appRef(refName, name = refName) {
12
+ return { __kind: "app", refName, name };
13
+ }
14
+ /** Lightweight typed element-owner token. Prefer the generated catalog in authored workspace source. */
15
+ export function elementRef(refName, name = refName) {
16
+ return { __kind: "element", refName, name };
17
+ }
10
18
  /** Build a ref-kind factory: no identity parameter, `.refName` defaults to `name` (stamped over by the enclosing bag). */
11
19
  function refFactory(kind) {
12
20
  return (opts) => ({ __kind: kind, refName: opts.name, ...opts });
@@ -75,9 +83,33 @@ export function agentRef(opts) {
75
83
  export function skillRef(opts) {
76
84
  return { __kind: "skill", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
77
85
  }
78
- export const flowRef = refFactory("flow");
86
+ export function phoneServiceRef(opts) {
87
+ return { __kind: "phone-service", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
88
+ }
89
+ export function datamineRef(opts) {
90
+ return { __kind: "datamine", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
91
+ }
79
92
  export const approvalChainRef = refFactory("approvalChain");
80
- export const searchTableRef = refFactory("searchTable");
93
+ function searchTableRefFor(opts, variant) {
94
+ return {
95
+ __kind: "searchTable",
96
+ refName: opts.name,
97
+ ...opts,
98
+ __variant: variant,
99
+ };
100
+ }
101
+ /** Reference to a managed element search table. Resource selection stays private. */
102
+ export function searchTableRef(opts) {
103
+ return searchTableRefFor(opts, "snowflake");
104
+ }
105
+ /** Reference to an existing linked Cortex Search Service. */
106
+ export function linkedSearchTableRef(opts) {
107
+ return searchTableRefFor(opts, "linked");
108
+ }
109
+ /** Reference to a managed search table owned by an Elementum Table. */
110
+ export function tableSearchTableRef(opts) {
111
+ return searchTableRefFor(opts, "table");
112
+ }
81
113
  export const connectorRef = refFactory("connector");
82
114
  /**
83
115
  * AI provider ref — reference only, the provider must already exist on the
@@ -106,6 +138,7 @@ export function defineAiProvider(opts) {
106
138
  export const cloudLinkRef = refFactory("cloudLink");
107
139
  export const categoryRef = refFactory("category");
108
140
  export const groupRef = refFactory("group");
141
+ export const phoneProviderRef = refFactory("phoneProvider");
109
142
  export function tableColumnRef(opts) {
110
143
  return {
111
144
  __kind: "tableColumn",
@@ -117,11 +150,18 @@ export function tableColumnRef(opts) {
117
150
  };
118
151
  }
119
152
  export function tableRef(opts) {
153
+ const refName = opts.refName ?? opts.name;
154
+ const columns = opts.columns === undefined
155
+ ? undefined
156
+ : Object.fromEntries(Object.entries(opts.columns).map(([refName, column]) => [
157
+ refName,
158
+ { ...column, refName, parent: opts.refName ?? opts.name },
159
+ ]));
120
160
  return {
121
161
  __kind: "table",
122
- refName: opts.name,
162
+ refName,
123
163
  name: opts.name,
124
- ...(opts.columns !== undefined ? { columns: opts.columns } : {}),
164
+ ...(columns !== undefined ? { columns } : {}),
125
165
  ...(opts.categoryId !== undefined ? { categoryId: opts.categoryId } : {}),
126
166
  };
127
167
  }
@@ -183,10 +223,12 @@ function stampTableRefs(bag) {
183
223
  columnRefName,
184
224
  { ...column, refName: columnRefName, parent: tableRefName },
185
225
  ]));
226
+ const datamines = withOwnKeyAsHandle(ref.datamines, tableRefName);
186
227
  out[tableRefName] = {
187
228
  ...ref,
188
229
  refName: tableRefName,
189
230
  ...(columns !== undefined ? { columns } : {}),
231
+ ...(datamines !== undefined ? { datamines } : {}),
190
232
  };
191
233
  }
192
234
  return out;
@@ -213,6 +255,8 @@ export function appCatalog(identity, bags) {
213
255
  automations: withOwnKeyAsHandle(bags.automations, identity.refName) ?? {},
214
256
  agents: withOwnKeyAsHandle(bags.agents, identity.refName) ?? {},
215
257
  skills: withOwnKeyAsHandle(bags.skills, identity.refName) ?? {},
258
+ approvalChains: withOwnKeyAsHandle(bags.approvalChains, identity.refName) ?? {},
259
+ phoneServices: withOwnKeyAsHandle(bags.phoneServices, identity.refName) ?? {},
216
260
  };
217
261
  }
218
262
  /** Same as {@link appCatalog}, but for an element catalog root. */
@@ -228,16 +272,10 @@ export function elementCatalog(identity, bags) {
228
272
  automations: withOwnKeyAsHandle(bags.automations, identity.refName) ?? {},
229
273
  agents: withOwnKeyAsHandle(bags.agents, identity.refName) ?? {},
230
274
  skills: withOwnKeyAsHandle(bags.skills, identity.refName) ?? {},
275
+ approvalChains: withOwnKeyAsHandle(bags.approvalChains, identity.refName) ?? {},
276
+ phoneServices: withOwnKeyAsHandle(bags.phoneServices, identity.refName) ?? {},
231
277
  };
232
278
  }
233
- /**
234
- * Assemble the org catalog object. Produces `{ handle: "org", name: "Org", ...bags }`.
235
- * No `__kind` — the org is not a `CatalogRef` kind and is referenced only as
236
- * a namespace (`org.aiProviders.X.models.Y`, `org.cloudLinks.Y`), never passed as a ref.
237
- * `"org"` is a fixed singleton namespace, not derived from any entity's name —
238
- * unlike every other identity in this file, it's not a ref name. Bag entries'
239
- * `.handle` are stamped from their own key, same as `appCatalog`.
240
- */
241
279
  export function orgCatalog(bags) {
242
280
  return {
243
281
  handle: "org",
@@ -247,6 +285,7 @@ export function orgCatalog(bags) {
247
285
  cloudLinks: withOwnKeyAsHandle(bags.cloudLinks) ?? {},
248
286
  categories: withOwnKeyAsHandle(bags.categories) ?? {},
249
287
  groups: withOwnKeyAsHandle(bags.groups) ?? {},
288
+ phoneProviders: withOwnKeyAsHandle(bags.phoneProviders) ?? {},
250
289
  tables: stampTableRefs(bags.tables) ?? {},
251
290
  };
252
291
  }