@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +462 -3
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
  3. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
  4. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
  5. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
  6. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
  7. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
  8. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
  9. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
  10. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
  11. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
  12. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
  13. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
  14. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
  15. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
  16. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
  17. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
  18. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
  19. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
  20. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
  21. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
  22. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
  23. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
  24. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
  25. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
  26. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
  27. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
  28. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
  29. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
  30. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
  31. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
  32. package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
  33. package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
  34. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
  35. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
  36. package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
  37. package/dist-sdk/elementum-entity-client/errors.js +111 -0
  38. package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
  39. package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
  40. package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
  41. package/dist-sdk/elementum-entity-client/types.js +1 -0
  42. package/dist-sdk/fs/entity.d.ts +104 -0
  43. package/dist-sdk/fs/entity.js +52 -0
  44. package/dist-sdk/pull/util.d.ts +130 -0
  45. package/dist-sdk/pull/util.js +204 -0
  46. package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
  47. package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
  48. package/dist-sdk/src/catalog/factories.d.ts +242 -0
  49. package/dist-sdk/src/catalog/factories.js +265 -0
  50. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  51. package/dist-sdk/src/catalog/from-authoring.js +467 -0
  52. package/dist-sdk/src/catalog/index.d.ts +12 -0
  53. package/dist-sdk/src/catalog/index.js +12 -0
  54. package/dist-sdk/src/catalog/org.d.ts +11 -0
  55. package/dist-sdk/src/catalog/org.js +288 -0
  56. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  57. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  58. package/dist-sdk/src/catalog/render.d.ts +48 -0
  59. package/dist-sdk/src/catalog/render.js +193 -0
  60. package/dist-sdk/src/catalog/token.d.ts +10 -0
  61. package/dist-sdk/src/catalog/token.js +76 -0
  62. package/dist-sdk/src/catalog/types.d.ts +215 -0
  63. package/dist-sdk/src/catalog/types.js +86 -0
  64. package/dist-sdk/src/catalog/write.d.ts +43 -0
  65. package/dist-sdk/src/catalog/write.js +109 -0
  66. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  67. package/dist-sdk/src/core/app-to-ui.js +75 -0
  68. package/dist-sdk/src/core/index.d.ts +10 -0
  69. package/dist-sdk/src/core/index.js +9 -0
  70. package/dist-sdk/src/core/system-fields.d.ts +95 -0
  71. package/dist-sdk/src/core/system-fields.js +153 -0
  72. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  73. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  74. package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
  75. package/dist-sdk/src/core/types/ai-provider.js +8 -0
  76. package/dist-sdk/src/core/types/app.d.ts +857 -0
  77. package/dist-sdk/src/core/types/app.js +210 -0
  78. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  79. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  80. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  81. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  82. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  83. package/dist-sdk/src/core/types/display-block.js +61 -0
  84. package/dist-sdk/src/core/types/group.d.ts +13 -0
  85. package/dist-sdk/src/core/types/group.js +6 -0
  86. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  87. package/dist-sdk/src/core/types/platform.js +1 -0
  88. package/dist-sdk/src/core/types/user.d.ts +20 -0
  89. package/dist-sdk/src/core/types/user.js +8 -0
  90. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  91. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  92. package/dist-sdk/src/engine/build/context.d.ts +67 -0
  93. package/dist-sdk/src/engine/build/context.js +6 -0
  94. package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
  95. package/dist-sdk/src/engine/build/source-context.js +23 -0
  96. package/dist-sdk/src/engine/entity.d.ts +44 -0
  97. package/dist-sdk/src/engine/entity.js +15 -0
  98. package/dist-sdk/src/engine/pull/context.d.ts +38 -0
  99. package/dist-sdk/src/engine/pull/context.js +44 -0
  100. package/dist-sdk/src/engine/pull/org.d.ts +54 -0
  101. package/dist-sdk/src/engine/pull/org.js +134 -0
  102. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  103. package/dist-sdk/src/engine/tf/escape.js +28 -0
  104. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  105. package/dist-sdk/src/engine/tf/expr.js +405 -0
  106. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  107. package/dist-sdk/src/engine/tf/index.js +11 -0
  108. package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
  109. package/dist-sdk/src/engine/tf/labels.js +196 -0
  110. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  111. package/dist-sdk/src/engine/tf/model.js +49 -0
  112. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  113. package/dist-sdk/src/engine/tf/parse.js +189 -0
  114. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  115. package/dist-sdk/src/engine/tf/render.js +102 -0
  116. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  117. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  118. package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
  119. package/dist-sdk/src/entities/access-policy/build.js +7 -0
  120. package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
  121. package/dist-sdk/src/entities/access-policy/filter.js +83 -0
  122. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
  123. package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
  124. package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
  125. package/dist-sdk/src/entities/access-policy/module.js +17 -0
  126. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
  127. package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
  128. package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
  129. package/dist-sdk/src/entities/access-policy/types.js +10 -0
  130. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  131. package/dist-sdk/src/entities/agent/build.js +148 -0
  132. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
  133. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
  134. package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
  135. package/dist-sdk/src/entities/agent/from-tf.js +289 -0
  136. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  137. package/dist-sdk/src/entities/agent/index.js +7 -0
  138. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  139. package/dist-sdk/src/entities/agent/module.js +122 -0
  140. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  141. package/dist-sdk/src/entities/agent/to-tf.js +188 -0
  142. package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
  143. package/dist-sdk/src/entities/agent/tools.js +238 -0
  144. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
  145. package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
  146. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  147. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  148. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
  149. package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
  150. package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
  151. package/dist-sdk/src/entities/agent-tool/types.js +102 -0
  152. package/dist-sdk/src/entities/app/build.d.ts +368 -0
  153. package/dist-sdk/src/entities/app/build.js +372 -0
  154. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
  155. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  156. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  157. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  158. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  159. package/dist-sdk/src/entities/app/from-tf.js +197 -0
  160. package/dist-sdk/src/entities/app/index.d.ts +14 -0
  161. package/dist-sdk/src/entities/app/index.js +11 -0
  162. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  163. package/dist-sdk/src/entities/app/locals.js +31 -0
  164. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  165. package/dist-sdk/src/entities/app/module.js +66 -0
  166. package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
  167. package/dist-sdk/src/entities/app/to-tf.js +212 -0
  168. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  169. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  170. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  171. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  172. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  173. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  174. package/dist-sdk/src/entities/automation/build.d.ts +259 -0
  175. package/dist-sdk/src/entities/automation/build.js +436 -0
  176. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  177. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  178. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
  179. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  180. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
  181. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
  182. package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
  183. package/dist-sdk/src/entities/automation/filter.js +156 -0
  184. package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
  185. package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
  186. package/dist-sdk/src/entities/automation/index.d.ts +22 -0
  187. package/dist-sdk/src/entities/automation/index.js +25 -0
  188. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  189. package/dist-sdk/src/entities/automation/module.js +150 -0
  190. package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
  191. package/dist-sdk/src/entities/automation/operators.js +69 -0
  192. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
  193. package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
  194. package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
  195. package/dist-sdk/src/entities/automation/script-code.js +633 -0
  196. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  197. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  198. package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
  199. package/dist-sdk/src/entities/automation/tasks.js +765 -0
  200. package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
  201. package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
  202. package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
  203. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  204. package/dist-sdk/src/entities/automation/types.d.ts +78 -0
  205. package/dist-sdk/src/entities/automation/types.js +131 -0
  206. package/dist-sdk/src/entities/element/build.d.ts +121 -0
  207. package/dist-sdk/src/entities/element/build.js +110 -0
  208. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  209. package/dist-sdk/src/entities/element/from-tf.js +170 -0
  210. package/dist-sdk/src/entities/element/index.d.ts +12 -0
  211. package/dist-sdk/src/entities/element/index.js +10 -0
  212. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  213. package/dist-sdk/src/entities/element/locals.js +12 -0
  214. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  215. package/dist-sdk/src/entities/element/module.js +65 -0
  216. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  217. package/dist-sdk/src/entities/element/to-tf.js +169 -0
  218. package/dist-sdk/src/entities/field/build.d.ts +112 -0
  219. package/dist-sdk/src/entities/field/build.js +84 -0
  220. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  221. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  222. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  223. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  224. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  225. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  226. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  227. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  228. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  229. package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
  230. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  231. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  232. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  233. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  234. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  235. package/dist-sdk/src/entities/field/calc.js +54 -0
  236. package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
  237. package/dist-sdk/src/entities/field/from-tf.js +184 -0
  238. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  239. package/dist-sdk/src/entities/field/locals.js +24 -0
  240. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  241. package/dist-sdk/src/entities/field/module.js +50 -0
  242. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  243. package/dist-sdk/src/entities/field/options.js +76 -0
  244. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  245. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  246. package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
  247. package/dist-sdk/src/entities/field/to-tf.js +142 -0
  248. package/dist-sdk/src/entities/field/types.d.ts +53 -0
  249. package/dist-sdk/src/entities/field/types.js +68 -0
  250. package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
  251. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  252. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
  253. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
  254. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
  255. package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
  256. package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
  257. package/dist-sdk/src/entities/file-reader/index.js +10 -0
  258. package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
  259. package/dist-sdk/src/entities/file-reader/module.js +115 -0
  260. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
  261. package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
  262. package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
  263. package/dist-sdk/src/entities/file-reader/types.js +30 -0
  264. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  265. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  266. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  267. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  268. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  269. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  270. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  271. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  272. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  273. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  274. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  275. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  276. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  277. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  278. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  279. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  280. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  281. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  282. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  283. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  284. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  285. package/dist-sdk/src/entities/flow/build.js +115 -0
  286. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  287. package/dist-sdk/src/entities/flow/index.js +7 -0
  288. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  289. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  290. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  291. package/dist-sdk/src/entities/flow/util.js +38 -0
  292. package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
  293. package/dist-sdk/src/entities/org/ai-provider.js +46 -0
  294. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  295. package/dist-sdk/src/entities/org/category.js +33 -0
  296. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  297. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  298. package/dist-sdk/src/entities/org/connector.d.ts +12 -0
  299. package/dist-sdk/src/entities/org/connector.js +35 -0
  300. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  301. package/dist-sdk/src/entities/org/group.js +40 -0
  302. package/dist-sdk/src/entities/org/index.d.ts +11 -0
  303. package/dist-sdk/src/entities/org/index.js +11 -0
  304. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  305. package/dist-sdk/src/entities/org/role.js +21 -0
  306. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  307. package/dist-sdk/src/entities/org/user.js +30 -0
  308. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  309. package/dist-sdk/src/entities/search-table/build.js +79 -0
  310. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  311. package/dist-sdk/src/entities/search-table/index.js +5 -0
  312. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  313. package/dist-sdk/src/entities/search-table/module.js +64 -0
  314. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  315. package/dist-sdk/src/entities/shared/context.js +156 -0
  316. package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
  317. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  318. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  319. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  320. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  321. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  322. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  323. package/dist-sdk/src/entities/shared/ref.js +119 -0
  324. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
  325. package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
  326. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  327. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  328. package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
  329. package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
  330. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  331. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  332. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  333. package/dist-sdk/src/entities/skill/build.js +50 -0
  334. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
  335. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
  336. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  337. package/dist-sdk/src/entities/skill/from-tf.js +96 -0
  338. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  339. package/dist-sdk/src/entities/skill/index.js +7 -0
  340. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  341. package/dist-sdk/src/entities/skill/module.js +111 -0
  342. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  343. package/dist-sdk/src/entities/skill/to-tf.js +59 -0
  344. package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
  345. package/dist-sdk/src/entities/skill/tools.js +105 -0
  346. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
  347. package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
  348. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  349. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  350. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
  351. package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
  352. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  353. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  354. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  355. package/dist-sdk/src/entities/table/build.js +339 -0
  356. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  357. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  358. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  359. package/dist-sdk/src/entities/table/fields.js +70 -0
  360. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  361. package/dist-sdk/src/entities/table/filter.js +89 -0
  362. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  363. package/dist-sdk/src/entities/table/index.js +12 -0
  364. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  365. package/dist-sdk/src/entities/table/joins.js +31 -0
  366. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  367. package/dist-sdk/src/entities/table/keys.js +25 -0
  368. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  369. package/dist-sdk/src/entities/table/module.js +25 -0
  370. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  371. package/dist-sdk/src/entities/table/state.js +43 -0
  372. package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
  373. package/dist-sdk/src/entities/view/from-tf.js +235 -0
  374. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  375. package/dist-sdk/src/entities/view/module.js +61 -0
  376. package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
  377. package/dist-sdk/src/entities/view/to-tf.js +171 -0
  378. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  379. package/dist-sdk/src/entities/view/types.js +89 -0
  380. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
  381. package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
  382. package/dist-sdk/src/graph/index.d.ts +91 -0
  383. package/dist-sdk/src/graph/index.js +211 -0
  384. package/dist-sdk/src/graph/modules.d.ts +7 -0
  385. package/dist-sdk/src/graph/modules.js +42 -0
  386. package/dist-sdk/src/graph/types.d.ts +375 -0
  387. package/dist-sdk/src/graph/types.js +102 -0
  388. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  389. package/dist-sdk/src/internal/sdk-package.js +23 -0
  390. package/package.json +201 -8
@@ -0,0 +1,33 @@
1
+ /**
2
+ * v2 flow activity definitions. Parallel to v1 `src/flows/activities/types.ts`,
3
+ * but an activity's `reference` is a **CatalogRef token** (agent / automation /
4
+ * approval-chain handle) resolved to an id at deploy — not a live `.id`.
5
+ *
6
+ * For HUMAN/FORM activities there is no outbound reference (the form owns its
7
+ * schema via `configuration`); for HUMAN/APPROVAL the reference is the approval
8
+ * chain and there is no configuration.
9
+ */
10
+ import type { AgentRef, ApprovalChainRef, AutomationRef } from "../../../catalog/index.js";
11
+ export type FlowActivityType = "AGENT" | "AUTOMATION" | "HUMAN";
12
+ /** Sub-type discriminator — only meaningful for HUMAN activities. */
13
+ export type FlowActivitySubType = "FORM" | "APPROVAL";
14
+ /** The token an activity points at (resolved to an id at deploy). */
15
+ export type FlowActivityReferenceV2 = AgentRef | AutomationRef | ApprovalChainRef;
16
+ /**
17
+ * The phantom output shape an activity exposes to downstream activities via
18
+ * `ctx.activities.<key>`. Loose today (`outputs.<name>` accepts any name);
19
+ * per-kind typed outputs land with the form render-catalog port.
20
+ */
21
+ export type FlowActivityOutputsV2 = unknown;
22
+ export interface FlowActivityDefV2<TOutputs = FlowActivityOutputsV2> {
23
+ readonly activityType: FlowActivityType;
24
+ /** Only set for HUMAN activities — omitted for AGENT / AUTOMATION. */
25
+ readonly activitySubType?: FlowActivitySubType;
26
+ readonly name: string;
27
+ /** Outbound reference token. Optional — HUMAN/FORM activities are self-contained. */
28
+ readonly reference?: FlowActivityReferenceV2;
29
+ /** Opaque per-activity config (e.g. `{ inputs }`, `{ prompt }`, form render tree). */
30
+ readonly configuration?: Record<string, unknown>;
31
+ /** Phantom — carries the typed output shape for `ctx.activities.<key>`. */
32
+ readonly __outputs?: TOutputs;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ import type { FlowRef } from "../../catalog/index.js";
2
+ import type { Simplify } from "../shared/ref.js";
3
+ import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
4
+ import { type FlowActivityOutputProxy, type FlowCtxV2 } from "./activities/ctx.js";
5
+ import type { FlowActivityDefV2 } from "./activities/types.js";
6
+ import { type FlowStartType, type FlowStatus } from "./serialize.js";
7
+ /** A v2 wire filter (may embed FieldRef tokens) — the `startWhen` shape. */
8
+ export type FlowFilter = Record<string, unknown>;
9
+ /** An activity slot: a built def or a lazy `(ctx) => def` for typed prior-output refs. */
10
+ export type FlowActivityFactory<TActivities extends Record<string, unknown>> = FlowActivityDefV2 | ((ctx: FlowCtxV2<TActivities>) => FlowActivityDefV2);
11
+ /** Branch condition — a label string, or a `(ctx) => string` for typed authoring. */
12
+ export type BranchConditionFactory<TActivities extends Record<string, unknown>> = string | ((ctx: FlowCtxV2<TActivities>) => string);
13
+ type AddActivity<TActivities, K extends string> = Simplify<TActivities & Record<K, FlowActivityOutputProxy>>;
14
+ export interface DefineFlowV2Options extends EntityDeployOptions {
15
+ readonly handle?: string;
16
+ readonly name: string;
17
+ readonly parent?: string;
18
+ readonly description?: string;
19
+ readonly starts?: readonly FlowStartType[];
20
+ readonly status?: FlowStatus;
21
+ /** Record-creation filter over the owner app's fields (build with the v2 filter DSL). */
22
+ readonly startWhen?: FlowFilter;
23
+ }
24
+ export interface FlowConfigured<TActivities extends Record<string, unknown> = Record<string, FlowActivityOutputProxy>> {
25
+ readonly ref: FlowRef;
26
+ activity(factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<TActivities>;
27
+ activity<K extends string>(key: K, factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<AddActivity<TActivities, K>>;
28
+ build(): DeployableEntity;
29
+ }
30
+ export interface FlowWithActivity<TActivities extends Record<string, unknown> = Record<string, FlowActivityOutputProxy>> {
31
+ /** A conditional branch off the previous activity. */
32
+ branch(condition: BranchConditionFactory<TActivities>, ...activities: Array<FlowActivityFactory<TActivities>>): FlowWithActivity<TActivities>;
33
+ activity(factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<TActivities>;
34
+ activity<K extends string>(key: K, factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<AddActivity<TActivities, K>>;
35
+ build(): DeployableEntity;
36
+ }
37
+ export declare function defineFlow(opts: DefineFlowV2Options): FlowConfigured;
38
+ export {};
@@ -0,0 +1,115 @@
1
+ /**
2
+ * v2 flow authoring — `defineFlow`. Parallel to v1 `src/flows/builder.ts`,
3
+ * but standalone: it produces a `DeployableEntity { kind:"flow", parent, handle, payload }`
4
+ * whose activity references are CatalogRef tokens (resolved at deploy), not live
5
+ * `.id`s.
6
+ *
7
+ * defineFlow({ name:"Triage", parent:"incidents" })
8
+ * .activity("intake", agentActivity({ agent: app.agents.intake, name: "Intake" }))
9
+ * .activity((ctx) => automationActivity({
10
+ * automation: app.automations.escalate,
11
+ * name: "Escalate",
12
+ * inputs: { summary: ctx.activities.intake.outputs.summary },
13
+ * }))
14
+ * .build()
15
+ *
16
+ * Flows are CREATE-ONLY on the platform — a changed, already-deployed flow is
17
+ * surfaced by the deploy as unsupported-update (delete + re-create), not a PUT.
18
+ *
19
+ * Slice scope: agent / automation / approval activities, branches, starts,
20
+ * status, and `startWhen` (a v2 filter over the owner app's fields). Form
21
+ * activities (the render-catalog DSL) follow.
22
+ */
23
+ import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
24
+ import { slugifyActivityName } from "./util.js";
25
+ import { buildFlowCtxV2 } from "./activities/ctx.js";
26
+ import { serializeFlowV2, } from "./serialize.js";
27
+ export function defineFlow(opts) {
28
+ const name = opts.name;
29
+ if (!name || name.trim() === "") {
30
+ throw new EdkValidationError("defineFlow requires a non-empty name.");
31
+ }
32
+ const nodes = [];
33
+ // Registered activity keys (in order) — drive the ctx `activities` proxy.
34
+ const keys = [];
35
+ function resolveFactory(factory) {
36
+ return typeof factory === "function" ? factory(buildFlowCtxV2(keys)) : factory;
37
+ }
38
+ function registerActivity(factory, explicitKey) {
39
+ const def = resolveFactory(factory);
40
+ if (!def.name || def.name.trim() === "") {
41
+ throw new EdkValidationError("Flow activity requires a non-empty name.");
42
+ }
43
+ // The key drives both `ctx.activities.<key>` and the wire `key` (so refs
44
+ // line up): explicit key when given, else the activity-name slug.
45
+ const key = explicitKey ?? slugifyActivityName(def.name);
46
+ keys.push(key);
47
+ const node = { def, key, branches: [] };
48
+ nodes.push(node);
49
+ return node;
50
+ }
51
+ function resolveCondition(condition) {
52
+ const out = typeof condition === "function" ? condition(buildFlowCtxV2(keys)) : condition;
53
+ if (!out || out.trim() === "") {
54
+ throw new EdkValidationError("branch(condition, ...) requires a non-empty condition string.");
55
+ }
56
+ return out;
57
+ }
58
+ function build() {
59
+ return {
60
+ kind: "flow",
61
+ parent: opts.parent ?? "",
62
+ refName: opts.handle ?? "",
63
+ payload: serializeFlowV2({
64
+ name,
65
+ ...(opts.description !== undefined ? { description: opts.description } : {}),
66
+ ...(opts.starts !== undefined ? { starts: opts.starts } : {}),
67
+ ...(opts.status !== undefined ? { status: opts.status } : {}),
68
+ ...(opts.startWhen !== undefined ? { startWhen: opts.startWhen } : {}),
69
+ nodes,
70
+ }),
71
+ ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
72
+ };
73
+ }
74
+ function withActivity(node) {
75
+ const api = {
76
+ branch(condition, ...activities) {
77
+ const conditionString = resolveCondition(condition);
78
+ if (activities.length === 0) {
79
+ throw new EdkValidationError(`branch "${conditionString}" requires at least one activity.`);
80
+ }
81
+ // Branch activities are mutated onto the parent node's branch list.
82
+ const resolved = activities.map((a) => resolveFactory(a));
83
+ node.branches.push({ condition: conditionString, activities: resolved });
84
+ return api;
85
+ },
86
+ activity(...args) {
87
+ const { factory, key } = parseActivityArgs(args);
88
+ return withActivity(registerActivity(factory, key));
89
+ },
90
+ build,
91
+ };
92
+ return api;
93
+ }
94
+ const ref = { __kind: "flow", refName: opts.handle ?? "", name: opts.name, parent: opts.parent ?? "" };
95
+ return {
96
+ ref,
97
+ activity(...args) {
98
+ const { factory, key } = parseActivityArgs(args);
99
+ return withActivity(registerActivity(factory, key));
100
+ },
101
+ build,
102
+ };
103
+ }
104
+ /** Disambiguate `activity(def)` from `activity(key, def)`. */
105
+ function parseActivityArgs(args) {
106
+ if (args.length === 0)
107
+ throw new EdkValidationError("activity(...) requires at least one argument.");
108
+ if (typeof args[0] === "string") {
109
+ if (args.length < 2) {
110
+ throw new EdkValidationError(`activity("${args[0]}", factoryOrDef) requires the second argument.`);
111
+ }
112
+ return { factory: args[1], key: args[0] };
113
+ }
114
+ return { factory: args[0] };
115
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * v2 flow authoring — `defineFlow`. App-owned; create-only on the platform.
3
+ * Standalone from v1's `src/flows`. Activity factories + the input-ref / prompt
4
+ * vocabulary live under `./activities`.
5
+ */
6
+ export { defineFlow, type BranchConditionFactory, type DefineFlowV2Options, type FlowActivityFactory, type FlowConfigured, type FlowFilter, type FlowWithActivity, } from "./build.js";
7
+ export { type FlowStartType, type FlowStatus, type SerializedFlowActivity, type SerializedFlow, } from "./serialize.js";
8
+ export * from "./activities/index.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * v2 flow authoring — `defineFlow`. App-owned; create-only on the platform.
3
+ * Standalone from v1's `src/flows`. Activity factories + the input-ref / prompt
4
+ * vocabulary live under `./activities`.
5
+ */
6
+ export { defineFlow, } from "./build.js";
7
+ export * from "./activities/index.js";
@@ -0,0 +1,51 @@
1
+ import type { FlowActivityDefV2 } from "./activities/types.js";
2
+ export type FlowStartType = "WEB" | "PHONE" | "EMAIL" | "AUTOMATION" | "SERVICE_REQUEST" | "SLACK" | "GOOGLE_CHAT" | "MS_TEAMS";
3
+ export type FlowStatus = "DRAFT" | "ACTIVE";
4
+ /** One activity node in the builder tree (a main-path activity + its branches). */
5
+ export interface FlowActivityNodeV2 {
6
+ readonly def: FlowActivityDefV2;
7
+ /** The activity's key — explicit `.activity(key, …)` or the name slug. Drives the wire key + ctx refs. */
8
+ readonly key: string;
9
+ readonly branches: readonly FlowBranchV2[];
10
+ }
11
+ export interface FlowBranchV2 {
12
+ readonly condition: string;
13
+ readonly activities: readonly FlowActivityDefV2[];
14
+ }
15
+ export interface SerializedFlowActivity {
16
+ readonly key: string;
17
+ readonly type: string;
18
+ readonly subType?: "FORM" | "APPROVAL";
19
+ readonly name: string;
20
+ /** CatalogRef token pre-resolution; the field id after deploy. */
21
+ readonly referenceId?: unknown;
22
+ readonly configuration?: Record<string, unknown>;
23
+ readonly branchParentKey?: string;
24
+ readonly branchCondition?: string;
25
+ }
26
+ /** The flow payload minus `appId` (injected at the wire boundary). */
27
+ export interface SerializedFlow {
28
+ readonly name: string;
29
+ readonly description?: string;
30
+ readonly starts?: readonly FlowStartType[];
31
+ readonly startWhen?: Record<string, unknown>;
32
+ readonly status?: FlowStatus;
33
+ readonly activities: readonly SerializedFlowActivity[];
34
+ }
35
+ export interface SerializeFlowV2Input {
36
+ readonly name: string;
37
+ readonly description?: string;
38
+ readonly starts?: readonly FlowStartType[];
39
+ readonly startWhen?: Record<string, unknown>;
40
+ readonly status?: FlowStatus;
41
+ readonly nodes: readonly FlowActivityNodeV2[];
42
+ }
43
+ /**
44
+ * Deep-walk a config node: internal `Ref`s → wire ref JSON; `CatalogRef` tokens
45
+ * slimmed + left in place (resolved at deploy); arrays/objects recursed.
46
+ * (Same body as automations-v2's `serializeNode`; consolidates to `core` at the
47
+ * cutover.)
48
+ */
49
+ export declare function serializeNode(node: unknown): unknown;
50
+ /** Serialize the flow to its handle-form payload (tokens intact, no `appId`). */
51
+ export declare function serializeFlowV2(input: SerializeFlowV2Input): SerializedFlow;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * v2 flow serialization — flatten the builder's activity tree into the flat
3
+ * `activities[]` wire shape, with each activity's `referenceId` holding a
4
+ * **CatalogRef token** (resolved to an id at deploy by `resolvePayload`) rather
5
+ * than a baked id. Mirrors v1 `src/flows/serializer/index.ts` (same
6
+ * `key`/`branchParentKey`/`branchCondition` shape, same key generation), minus
7
+ * `appId` — that's injected at the wire boundary from the resolved owner app id.
8
+ *
9
+ * Wire-shape note (carried from v1): this `SerializedFlow` shape targets the
10
+ * REST `POST /v1/flows/create` (`FullStateFlowInput`) path, not wolverine's
11
+ * GraphQL `AppFlowCreateInput`. Confirm the endpoint before re-targeting.
12
+ *
13
+ * The whole structure is run through {@link serializeNode}, which slims catalog
14
+ * tokens (left in place for deploy-time resolution) and converts any internal
15
+ * `core/ref` Refs — matching how automations-v2 serializes its payload.
16
+ */
17
+ import { isCatalogToken, slimToken } from "../../catalog/index.js";
18
+ import { isRef } from "../shared/ref.js";
19
+ import { serializeRefData } from "../../core/wire/ref-serializer.js";
20
+ import { slugifyActivityName } from "./util.js";
21
+ /**
22
+ * Deep-walk a config node: internal `Ref`s → wire ref JSON; `CatalogRef` tokens
23
+ * slimmed + left in place (resolved at deploy); arrays/objects recursed.
24
+ * (Same body as automations-v2's `serializeNode`; consolidates to `core` at the
25
+ * cutover.)
26
+ */
27
+ export function serializeNode(node) {
28
+ if (isRef(node))
29
+ return serializeRefData(node.__data);
30
+ if (isCatalogToken(node))
31
+ return slimToken(node);
32
+ if (Array.isArray(node))
33
+ return node.map(serializeNode);
34
+ if (node !== null && typeof node === "object") {
35
+ const out = {};
36
+ for (const [k, v] of Object.entries(node))
37
+ out[k] = serializeNode(v);
38
+ return out;
39
+ }
40
+ return node;
41
+ }
42
+ function uniqueKey(base, usedKeys) {
43
+ if (!usedKeys.has(base)) {
44
+ usedKeys.add(base);
45
+ return base;
46
+ }
47
+ let counter = 2;
48
+ while (usedKeys.has(`${base}_${counter}`))
49
+ counter++;
50
+ const key = `${base}_${counter}`;
51
+ usedKeys.add(key);
52
+ return key;
53
+ }
54
+ function buildActivity(def, key, branchParentKey, branchCondition) {
55
+ return {
56
+ key,
57
+ type: def.activityType,
58
+ ...(def.activitySubType != null ? { subType: def.activitySubType } : {}),
59
+ name: def.name,
60
+ ...(def.reference != null ? { referenceId: def.reference } : {}), // token → id at deploy
61
+ ...(def.configuration != null ? { configuration: def.configuration } : {}),
62
+ ...(branchParentKey != null ? { branchParentKey } : {}),
63
+ ...(branchCondition != null ? { branchCondition } : {}),
64
+ };
65
+ }
66
+ function flattenNodes(nodes, usedKeys) {
67
+ const result = [];
68
+ for (const node of nodes) {
69
+ // Use the node's resolved key (explicit or name-slug) so `ctx.activities.<key>`
70
+ // refs line up with the wire `key`. Branch activities have no explicit key.
71
+ const parentKey = uniqueKey(node.key, usedKeys);
72
+ result.push(buildActivity(node.def, parentKey));
73
+ for (const branch of node.branches) {
74
+ for (const def of branch.activities) {
75
+ const key = uniqueKey(slugifyActivityName(def.name), usedKeys);
76
+ result.push(buildActivity(def, key, parentKey, branch.condition));
77
+ }
78
+ }
79
+ }
80
+ return result;
81
+ }
82
+ /** Serialize the flow to its handle-form payload (tokens intact, no `appId`). */
83
+ export function serializeFlowV2(input) {
84
+ const usedKeys = new Set();
85
+ const payload = {
86
+ name: input.name,
87
+ ...(input.description != null ? { description: input.description } : {}),
88
+ ...(input.starts != null && input.starts.length > 0 ? { starts: input.starts } : {}),
89
+ ...(input.startWhen != null ? { startWhen: input.startWhen } : {}),
90
+ ...(input.status != null ? { status: input.status } : {}),
91
+ activities: flattenNodes(input.nodes, usedKeys),
92
+ };
93
+ return serializeNode(payload);
94
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Shared helpers for the flow builder + serializer. Lives here so both
3
+ * sides use a single implementation of conventions like slug derivation
4
+ * — the activity-key the user passes to `.activity(<key>, ...)` must
5
+ * line up with the wire-format slug the serializer emits and the
6
+ * runtime resolver matches against, so a single source of truth
7
+ * eliminates the silent-drift class of bugs.
8
+ *
9
+ * Modeled after `pull/util.ts` (the established repo pattern for
10
+ * standardized util methods).
11
+ */
12
+ /**
13
+ * Convert a flow activity's display name to its wire-format slug
14
+ * (lowercased, non-alphanumerics collapsed to single underscores,
15
+ * trimmed). The slug is what:
16
+ *
17
+ * - the serializer emits as `SerializedFlowActivity.key`,
18
+ * - Wolverine's `FlowActivityInputResolver` matches against when
19
+ * resolving `ActivityOutputRef.activityKey`, and
20
+ * - the flow builder uses as the type-key for unkeyed
21
+ * `.activity(def)` registrations so `ctx.activities.<slug>` lines up.
22
+ *
23
+ * Throws when the input contains no alphanumerics — without an
24
+ * alphanumeric character the slug would be empty, leaving downstream
25
+ * activities unable to reference this one.
26
+ */
27
+ export declare function slugifyActivityName(name: string): string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Shared helpers for the flow builder + serializer. Lives here so both
3
+ * sides use a single implementation of conventions like slug derivation
4
+ * — the activity-key the user passes to `.activity(<key>, ...)` must
5
+ * line up with the wire-format slug the serializer emits and the
6
+ * runtime resolver matches against, so a single source of truth
7
+ * eliminates the silent-drift class of bugs.
8
+ *
9
+ * Modeled after `pull/util.ts` (the established repo pattern for
10
+ * standardized util methods).
11
+ */
12
+ import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
13
+ /**
14
+ * Convert a flow activity's display name to its wire-format slug
15
+ * (lowercased, non-alphanumerics collapsed to single underscores,
16
+ * trimmed). The slug is what:
17
+ *
18
+ * - the serializer emits as `SerializedFlowActivity.key`,
19
+ * - Wolverine's `FlowActivityInputResolver` matches against when
20
+ * resolving `ActivityOutputRef.activityKey`, and
21
+ * - the flow builder uses as the type-key for unkeyed
22
+ * `.activity(def)` registrations so `ctx.activities.<slug>` lines up.
23
+ *
24
+ * Throws when the input contains no alphanumerics — without an
25
+ * alphanumeric character the slug would be empty, leaving downstream
26
+ * activities unable to reference this one.
27
+ */
28
+ export function slugifyActivityName(name) {
29
+ const slug = name
30
+ .toLowerCase()
31
+ .replaceAll(/[^a-z0-9]+/g, "_")
32
+ .replaceAll(/^_|_$/g, "");
33
+ if (slug === "") {
34
+ throw new EdkValidationError(`Flow activity name "${name}" slugifies to an empty key. ` +
35
+ `Use a name that contains at least one alphanumeric character.`);
36
+ }
37
+ return slug;
38
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * AI providers: org-owned reference identities, name-keyed lookups — never
3
+ * authored/created (they hold credentials, manually configured on the
4
+ * platform; src/CLAUDE.md), only referenced. One kind per AiProviderType
5
+ * (Anthropic, Bedrock, ..., matching the 10 distinct `elementum_<type>_
6
+ * ai_provider` terraform data sources) sharing the single "aiProviders" org
7
+ * bag — `pull org`/`catalog/org.ts` treat that bag's entries uniformly
8
+ * regardless of which of the 10 kinds produced them.
9
+ */
10
+ import { type EntityKindModule } from "../../graph/types.js";
11
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
12
+ export declare const AI_PROVIDER_ORG_BAG: "aiProviders";
13
+ export declare const aiProviderModules: readonly EntityKindModule[];
@@ -0,0 +1,46 @@
1
+ /**
2
+ * AI providers: org-owned reference identities, name-keyed lookups — never
3
+ * authored/created (they hold credentials, manually configured on the
4
+ * platform; src/CLAUDE.md), only referenced. One kind per AiProviderType
5
+ * (Anthropic, Bedrock, ..., matching the 10 distinct `elementum_<type>_
6
+ * ai_provider` terraform data sources) sharing the single "aiProviders" org
7
+ * bag — `pull org`/`catalog/org.ts` treat that bag's entries uniformly
8
+ * regardless of which of the 10 kinds produced them.
9
+ */
10
+ import { NO_CATALOG, NO_LIFECYCLE } from "../../graph/types.js";
11
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
12
+ export const AI_PROVIDER_ORG_BAG = "aiProviders";
13
+ const AI_PROVIDER_TYPES = [
14
+ { kind: "ai-provider-anthropic", resourceType: "elementum_anthropic_ai_provider", label: "Anthropic" },
15
+ { kind: "ai-provider-bedrock", resourceType: "elementum_bedrock_ai_provider", label: "Bedrock" },
16
+ { kind: "ai-provider-custom", resourceType: "elementum_custom_ai_provider", label: "Custom" },
17
+ { kind: "ai-provider-deepgram", resourceType: "elementum_deepgram_ai_provider", label: "Deepgram" },
18
+ { kind: "ai-provider-elevenlab", resourceType: "elementum_elevenlab_ai_provider", label: "ElevenLab" },
19
+ { kind: "ai-provider-gemini", resourceType: "elementum_gemini_ai_provider", label: "Gemini" },
20
+ { kind: "ai-provider-openai", resourceType: "elementum_openai_ai_provider", label: "OpenAI" },
21
+ { kind: "ai-provider-snowflake", resourceType: "elementum_snowflake_ai_provider", label: "Snowflake" },
22
+ { kind: "ai-provider-xai", resourceType: "elementum_xai_ai_provider", label: "xAI" },
23
+ { kind: "ai-provider-managed", resourceType: "elementum_managed_ai_provider", label: "Elementum Managed" },
24
+ ];
25
+ export const aiProviderModules = AI_PROVIDER_TYPES.map(({ kind, resourceType, label }) => ({
26
+ kind,
27
+ stream: { role: "orgExport" },
28
+ data: {
29
+ participates: true,
30
+ lookupAttr: "name",
31
+ catalogKind: "aiProvider",
32
+ orgBag: AI_PROVIDER_ORG_BAG,
33
+ // Connectors reference their provider (`provider_id`), so build emits
34
+ // this data source and the build-vs-export scopes it.
35
+ referencedByBuild: true,
36
+ },
37
+ authoring: { unit: "none" },
38
+ parents: [{ parent: "org", child: kind }],
39
+ resource: { shape: "single", resourceType, adoptable: false },
40
+ lifecycle: NO_LIFECYCLE,
41
+ canvas: { participates: true, label: `AI Providers (${label})`, glyph: "◆", component: "orgIdentity" },
42
+ // Rendered specially in src/catalog/org.ts (nested with each provider's
43
+ // connectors under `aiProviders.<provider>.models.<model>`), not through
44
+ // the generic per-bag catalog renderer.
45
+ catalog: NO_CATALOG,
46
+ }));
@@ -0,0 +1,5 @@
1
+ /** Categories: org-owned reference identities, name-keyed data lookups. */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
4
+ export declare const CATEGORY_ORG_BAG: "categories";
5
+ export declare const categoryModule: EntityKindModule;
@@ -0,0 +1,33 @@
1
+ /** Categories: org-owned reference identities, name-keyed data lookups. */
2
+ import { namedOnlyFactoryEntry } from "../../catalog/render-helpers.js";
3
+ import { NO_LIFECYCLE, } from "../../graph/types.js";
4
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
5
+ export const CATEGORY_ORG_BAG = "categories";
6
+ export const categoryModule = {
7
+ kind: "category",
8
+ stream: { role: "orgExport" },
9
+ data: {
10
+ participates: true,
11
+ lookupAttr: "name",
12
+ catalogKind: "category",
13
+ orgBag: CATEGORY_ORG_BAG,
14
+ // Apps reference categories (`category_id`), so build emits this data
15
+ // source and the build-vs-export must scope it.
16
+ referencedByBuild: true,
17
+ },
18
+ authoring: { unit: "none" },
19
+ parents: [{ parent: "org", child: "category" }],
20
+ resource: { shape: "single", resourceType: "elementum_category", adoptable: false },
21
+ lifecycle: NO_LIFECYCLE,
22
+ canvas: { participates: true, label: "Categories", glyph: "▣", component: "orgIdentity" },
23
+ catalog: {
24
+ participates: true,
25
+ refKind: "category",
26
+ catalogBag: "categories",
27
+ renderOrder: 100,
28
+ catalogRoot: "org",
29
+ renderEntry: namedOnlyFactoryEntry("categoryRef"),
30
+ stubRef: (refName) => ({ __kind: "category", refName, name: refName }),
31
+ refFromAuthoring: () => undefined,
32
+ },
33
+ };
@@ -0,0 +1,5 @@
1
+ /** Cloud links: org-owned reference identities, name-keyed data lookups. */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
4
+ export declare const CLOUD_LINK_ORG_BAG: "cloudLinks";
5
+ export declare const cloudLinkModule: EntityKindModule;
@@ -0,0 +1,33 @@
1
+ /** Cloud links: org-owned reference identities, name-keyed data lookups. */
2
+ import { namedOnlyFactoryEntry } from "../../catalog/render-helpers.js";
3
+ import { NO_LIFECYCLE, } from "../../graph/types.js";
4
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
5
+ export const CLOUD_LINK_ORG_BAG = "cloudLinks";
6
+ export const cloudLinkModule = {
7
+ kind: "cloud-link",
8
+ stream: { role: "orgExport" },
9
+ data: {
10
+ participates: true,
11
+ lookupAttr: "name",
12
+ catalogKind: "cloudLink",
13
+ orgBag: CLOUD_LINK_ORG_BAG,
14
+ // Apps pin cloud links (`cloud_link_id`), so build emits this data source
15
+ // and the build-vs-export must scope it.
16
+ referencedByBuild: true,
17
+ },
18
+ authoring: { unit: "none" },
19
+ parents: [{ parent: "org", child: "cloud-link" }],
20
+ resource: { shape: "single", resourceType: "elementum_cloudlink", adoptable: false },
21
+ lifecycle: NO_LIFECYCLE,
22
+ canvas: { participates: true, label: "Cloud Links", glyph: "☁", component: "orgIdentity" },
23
+ catalog: {
24
+ participates: true,
25
+ refKind: "cloudLink",
26
+ catalogBag: "cloudLinks",
27
+ renderOrder: 80,
28
+ catalogRoot: "org",
29
+ renderEntry: namedOnlyFactoryEntry("cloudLinkRef"),
30
+ stubRef: (refName) => ({ __kind: "cloudLink", refName, name: refName }),
31
+ refFromAuthoring: () => undefined,
32
+ },
33
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * AI provider connectors: org-owned reference identities, model_name-keyed
3
+ * lookups. Never their own top-level catalog bag — nested under their
4
+ * owning provider instead (`catalog.aiProviders.<provider>.models.<model>`,
5
+ * rendered specially in `src/catalog/org.ts`), since a connector's
6
+ * `provider_id` is a real reference to one of the 10 `elementum_<type>_
7
+ * ai_provider` blocks (entities/org/ai-provider.ts), not a plain string.
8
+ */
9
+ import { type EntityKindModule } from "../../graph/types.js";
10
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
11
+ export declare const CONNECTOR_ORG_BAG: "connectors";
12
+ export declare const connectorModule: EntityKindModule;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * AI provider connectors: org-owned reference identities, model_name-keyed
3
+ * lookups. Never their own top-level catalog bag — nested under their
4
+ * owning provider instead (`catalog.aiProviders.<provider>.models.<model>`,
5
+ * rendered specially in `src/catalog/org.ts`), since a connector's
6
+ * `provider_id` is a real reference to one of the 10 `elementum_<type>_
7
+ * ai_provider` blocks (entities/org/ai-provider.ts), not a plain string.
8
+ */
9
+ import { NO_CATALOG, NO_LIFECYCLE } from "../../graph/types.js";
10
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
11
+ export const CONNECTOR_ORG_BAG = "connectors";
12
+ export const connectorModule = {
13
+ kind: "connector",
14
+ stream: { role: "orgExport" },
15
+ data: {
16
+ participates: true,
17
+ lookupAttr: "model_name",
18
+ providerRefAttr: "provider_id",
19
+ catalogKind: "connector",
20
+ orgBag: CONNECTOR_ORG_BAG,
21
+ // Agents pin connectors (`ai_provider_connector_id`), so build emits this
22
+ // data source and the build-vs-export scopes it (M3).
23
+ referencedByBuild: true,
24
+ },
25
+ authoring: { unit: "none" },
26
+ parents: [{ parent: "org", child: "connector" }],
27
+ resource: {
28
+ shape: "single",
29
+ resourceType: "elementum_ai_provider_connector",
30
+ adoptable: false,
31
+ },
32
+ lifecycle: NO_LIFECYCLE,
33
+ canvas: { participates: true, label: "AI Provider Connectors", glyph: "⚡", component: "orgIdentity" },
34
+ catalog: NO_CATALOG,
35
+ };
@@ -0,0 +1,5 @@
1
+ /** Groups: org-owned reference identities, name-keyed data lookups. */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
4
+ export declare const GROUP_ORG_BAG: "groups";
5
+ export declare const groupModule: EntityKindModule;