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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/README.md +408 -3
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
  3. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
  4. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
  5. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
  6. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
  7. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
  8. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
  9. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
  10. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
  11. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
  12. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
  13. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
  14. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
  15. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
  16. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
  17. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
  18. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
  19. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
  20. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
  21. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
  22. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
  23. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
  24. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
  25. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
  26. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
  27. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
  28. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
  29. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
  30. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
  31. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
  32. package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
  33. package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
  34. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
  35. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
  36. package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
  37. package/dist-sdk/elementum-entity-client/errors.js +111 -0
  38. package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
  39. package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
  40. package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
  41. package/dist-sdk/elementum-entity-client/types.js +1 -0
  42. package/dist-sdk/fs/entity.d.ts +104 -0
  43. package/dist-sdk/fs/entity.js +52 -0
  44. package/dist-sdk/pull/util.d.ts +130 -0
  45. package/dist-sdk/pull/util.js +204 -0
  46. package/dist-sdk/src/catalog/factories.d.ts +189 -0
  47. package/dist-sdk/src/catalog/factories.js +202 -0
  48. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  49. package/dist-sdk/src/catalog/from-authoring.js +462 -0
  50. package/dist-sdk/src/catalog/index.d.ts +11 -0
  51. package/dist-sdk/src/catalog/index.js +11 -0
  52. package/dist-sdk/src/catalog/org.d.ts +11 -0
  53. package/dist-sdk/src/catalog/org.js +211 -0
  54. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  55. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  56. package/dist-sdk/src/catalog/render.d.ts +36 -0
  57. package/dist-sdk/src/catalog/render.js +176 -0
  58. package/dist-sdk/src/catalog/token.d.ts +10 -0
  59. package/dist-sdk/src/catalog/token.js +62 -0
  60. package/dist-sdk/src/catalog/types.d.ts +158 -0
  61. package/dist-sdk/src/catalog/types.js +83 -0
  62. package/dist-sdk/src/catalog/write.d.ts +43 -0
  63. package/dist-sdk/src/catalog/write.js +109 -0
  64. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  65. package/dist-sdk/src/core/app-to-ui.js +75 -0
  66. package/dist-sdk/src/core/index.d.ts +10 -0
  67. package/dist-sdk/src/core/index.js +9 -0
  68. package/dist-sdk/src/core/system-fields.d.ts +93 -0
  69. package/dist-sdk/src/core/system-fields.js +151 -0
  70. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  71. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  72. package/dist-sdk/src/core/types/ai-provider.d.ts +36 -0
  73. package/dist-sdk/src/core/types/ai-provider.js +32 -0
  74. package/dist-sdk/src/core/types/app.d.ts +838 -0
  75. package/dist-sdk/src/core/types/app.js +210 -0
  76. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  77. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  78. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  79. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  80. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  81. package/dist-sdk/src/core/types/display-block.js +61 -0
  82. package/dist-sdk/src/core/types/group.d.ts +13 -0
  83. package/dist-sdk/src/core/types/group.js +6 -0
  84. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  85. package/dist-sdk/src/core/types/platform.js +1 -0
  86. package/dist-sdk/src/core/types/user.d.ts +20 -0
  87. package/dist-sdk/src/core/types/user.js +8 -0
  88. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  89. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  90. package/dist-sdk/src/engine/build/context.d.ts +49 -0
  91. package/dist-sdk/src/engine/build/context.js +6 -0
  92. package/dist-sdk/src/engine/entity.d.ts +44 -0
  93. package/dist-sdk/src/engine/entity.js +15 -0
  94. package/dist-sdk/src/engine/pull/context.d.ts +23 -0
  95. package/dist-sdk/src/engine/pull/context.js +44 -0
  96. package/dist-sdk/src/engine/pull/org.d.ts +44 -0
  97. package/dist-sdk/src/engine/pull/org.js +104 -0
  98. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  99. package/dist-sdk/src/engine/tf/escape.js +28 -0
  100. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  101. package/dist-sdk/src/engine/tf/expr.js +405 -0
  102. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  103. package/dist-sdk/src/engine/tf/index.js +11 -0
  104. package/dist-sdk/src/engine/tf/labels.d.ts +31 -0
  105. package/dist-sdk/src/engine/tf/labels.js +125 -0
  106. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  107. package/dist-sdk/src/engine/tf/model.js +49 -0
  108. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  109. package/dist-sdk/src/engine/tf/parse.js +189 -0
  110. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  111. package/dist-sdk/src/engine/tf/render.js +102 -0
  112. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  113. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  114. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  115. package/dist-sdk/src/entities/agent/build.js +148 -0
  116. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +18 -0
  117. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +177 -0
  118. package/dist-sdk/src/entities/agent/from-tf.d.ts +50 -0
  119. package/dist-sdk/src/entities/agent/from-tf.js +169 -0
  120. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  121. package/dist-sdk/src/entities/agent/index.js +7 -0
  122. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  123. package/dist-sdk/src/entities/agent/module.js +116 -0
  124. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  125. package/dist-sdk/src/entities/agent/to-tf.js +136 -0
  126. package/dist-sdk/src/entities/agent/tools.d.ts +205 -0
  127. package/dist-sdk/src/entities/agent/tools.js +199 -0
  128. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +63 -0
  129. package/dist-sdk/src/entities/agent-tool/from-tf.js +169 -0
  130. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  131. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  132. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +38 -0
  133. package/dist-sdk/src/entities/agent-tool/to-tf.js +164 -0
  134. package/dist-sdk/src/entities/agent-tool/types.d.ts +42 -0
  135. package/dist-sdk/src/entities/agent-tool/types.js +70 -0
  136. package/dist-sdk/src/entities/app/build.d.ts +318 -0
  137. package/dist-sdk/src/entities/app/build.js +325 -0
  138. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +165 -0
  139. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  140. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  141. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  142. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  143. package/dist-sdk/src/entities/app/from-tf.js +180 -0
  144. package/dist-sdk/src/entities/app/index.d.ts +11 -0
  145. package/dist-sdk/src/entities/app/index.js +10 -0
  146. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  147. package/dist-sdk/src/entities/app/locals.js +31 -0
  148. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  149. package/dist-sdk/src/entities/app/module.js +59 -0
  150. package/dist-sdk/src/entities/app/to-tf.d.ts +28 -0
  151. package/dist-sdk/src/entities/app/to-tf.js +183 -0
  152. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  153. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  154. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  155. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  156. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  157. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  158. package/dist-sdk/src/entities/automation/build.d.ts +215 -0
  159. package/dist-sdk/src/entities/automation/build.js +424 -0
  160. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  161. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  162. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +135 -0
  163. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  164. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +40 -0
  165. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1040 -0
  166. package/dist-sdk/src/entities/automation/filter.d.ts +81 -0
  167. package/dist-sdk/src/entities/automation/filter.js +146 -0
  168. package/dist-sdk/src/entities/automation/from-tf.d.ts +36 -0
  169. package/dist-sdk/src/entities/automation/from-tf.js +252 -0
  170. package/dist-sdk/src/entities/automation/index.d.ts +18 -0
  171. package/dist-sdk/src/entities/automation/index.js +21 -0
  172. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  173. package/dist-sdk/src/entities/automation/module.js +153 -0
  174. package/dist-sdk/src/entities/automation/operators.d.ts +66 -0
  175. package/dist-sdk/src/entities/automation/operators.js +43 -0
  176. package/dist-sdk/src/entities/automation/script-code.d.ts +62 -0
  177. package/dist-sdk/src/entities/automation/script-code.js +366 -0
  178. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  179. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  180. package/dist-sdk/src/entities/automation/tasks.d.ts +535 -0
  181. package/dist-sdk/src/entities/automation/tasks.js +697 -0
  182. package/dist-sdk/src/entities/automation/to-tf.d.ts +38 -0
  183. package/dist-sdk/src/entities/automation/to-tf.js +266 -0
  184. package/dist-sdk/src/entities/automation/triggers.d.ts +197 -0
  185. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  186. package/dist-sdk/src/entities/automation/types.d.ts +53 -0
  187. package/dist-sdk/src/entities/automation/types.js +101 -0
  188. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +76 -0
  189. package/dist-sdk/src/entities/automation/value-ref-tf.js +190 -0
  190. package/dist-sdk/src/entities/element/build.d.ts +108 -0
  191. package/dist-sdk/src/entities/element/build.js +109 -0
  192. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  193. package/dist-sdk/src/entities/element/from-tf.js +155 -0
  194. package/dist-sdk/src/entities/element/index.d.ts +9 -0
  195. package/dist-sdk/src/entities/element/index.js +9 -0
  196. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  197. package/dist-sdk/src/entities/element/locals.js +12 -0
  198. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  199. package/dist-sdk/src/entities/element/module.js +63 -0
  200. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  201. package/dist-sdk/src/entities/element/to-tf.js +151 -0
  202. package/dist-sdk/src/entities/field/build.d.ts +69 -0
  203. package/dist-sdk/src/entities/field/build.js +74 -0
  204. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  205. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  206. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  207. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  208. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  209. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  210. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  211. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  212. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  213. package/dist-sdk/src/entities/field/calc/runtime.js +170 -0
  214. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  215. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  216. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  217. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  218. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  219. package/dist-sdk/src/entities/field/calc.js +54 -0
  220. package/dist-sdk/src/entities/field/from-tf.d.ts +29 -0
  221. package/dist-sdk/src/entities/field/from-tf.js +73 -0
  222. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  223. package/dist-sdk/src/entities/field/locals.js +24 -0
  224. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  225. package/dist-sdk/src/entities/field/module.js +49 -0
  226. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  227. package/dist-sdk/src/entities/field/options.js +76 -0
  228. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  229. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  230. package/dist-sdk/src/entities/field/to-tf.d.ts +55 -0
  231. package/dist-sdk/src/entities/field/to-tf.js +97 -0
  232. package/dist-sdk/src/entities/field/types.d.ts +27 -0
  233. package/dist-sdk/src/entities/field/types.js +46 -0
  234. package/dist-sdk/src/entities/file-reader/build.d.ts +124 -0
  235. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  236. package/dist-sdk/src/entities/file-reader/index.d.ts +5 -0
  237. package/dist-sdk/src/entities/file-reader/index.js +5 -0
  238. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  239. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  240. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  241. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  242. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  243. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  244. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  245. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  246. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  247. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  248. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  249. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  250. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  251. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  252. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  253. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  254. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  255. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  256. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  257. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  258. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  259. package/dist-sdk/src/entities/flow/build.js +115 -0
  260. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  261. package/dist-sdk/src/entities/flow/index.js +7 -0
  262. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  263. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  264. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  265. package/dist-sdk/src/entities/flow/util.js +38 -0
  266. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  267. package/dist-sdk/src/entities/org/category.js +33 -0
  268. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  269. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  270. package/dist-sdk/src/entities/org/connector.d.ts +5 -0
  271. package/dist-sdk/src/entities/org/connector.js +37 -0
  272. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  273. package/dist-sdk/src/entities/org/group.js +31 -0
  274. package/dist-sdk/src/entities/org/index.d.ts +10 -0
  275. package/dist-sdk/src/entities/org/index.js +10 -0
  276. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  277. package/dist-sdk/src/entities/org/role.js +21 -0
  278. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  279. package/dist-sdk/src/entities/org/user.js +21 -0
  280. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  281. package/dist-sdk/src/entities/search-table/build.js +79 -0
  282. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  283. package/dist-sdk/src/entities/search-table/index.js +5 -0
  284. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  285. package/dist-sdk/src/entities/search-table/module.js +64 -0
  286. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  287. package/dist-sdk/src/entities/shared/context.js +156 -0
  288. package/dist-sdk/src/entities/shared/filters/ast.d.ts +242 -0
  289. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  290. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  291. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  292. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  293. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  294. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  295. package/dist-sdk/src/entities/shared/ref.js +119 -0
  296. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  297. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  298. package/dist-sdk/src/entities/shared/types/field-types.d.ts +49 -0
  299. package/dist-sdk/src/entities/shared/types/field-types.js +48 -0
  300. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  301. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  302. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  303. package/dist-sdk/src/entities/skill/build.js +50 -0
  304. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +20 -0
  305. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +96 -0
  306. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  307. package/dist-sdk/src/entities/skill/from-tf.js +95 -0
  308. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  309. package/dist-sdk/src/entities/skill/index.js +7 -0
  310. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  311. package/dist-sdk/src/entities/skill/module.js +106 -0
  312. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  313. package/dist-sdk/src/entities/skill/to-tf.js +58 -0
  314. package/dist-sdk/src/entities/skill/tools.d.ts +71 -0
  315. package/dist-sdk/src/entities/skill/tools.js +88 -0
  316. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +47 -0
  317. package/dist-sdk/src/entities/skill-tool/from-tf.js +121 -0
  318. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  319. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  320. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +32 -0
  321. package/dist-sdk/src/entities/skill-tool/to-tf.js +107 -0
  322. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  323. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  324. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  325. package/dist-sdk/src/entities/table/build.js +339 -0
  326. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  327. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  328. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  329. package/dist-sdk/src/entities/table/fields.js +70 -0
  330. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  331. package/dist-sdk/src/entities/table/filter.js +89 -0
  332. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  333. package/dist-sdk/src/entities/table/index.js +12 -0
  334. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  335. package/dist-sdk/src/entities/table/joins.js +31 -0
  336. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  337. package/dist-sdk/src/entities/table/keys.js +25 -0
  338. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  339. package/dist-sdk/src/entities/table/module.js +25 -0
  340. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  341. package/dist-sdk/src/entities/table/state.js +43 -0
  342. package/dist-sdk/src/entities/view/from-tf.d.ts +25 -0
  343. package/dist-sdk/src/entities/view/from-tf.js +233 -0
  344. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  345. package/dist-sdk/src/entities/view/module.js +61 -0
  346. package/dist-sdk/src/entities/view/to-tf.d.ts +63 -0
  347. package/dist-sdk/src/entities/view/to-tf.js +156 -0
  348. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  349. package/dist-sdk/src/entities/view/types.js +89 -0
  350. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +14 -0
  351. package/dist-sdk/src/graph/deferred-catalog-render.js +37 -0
  352. package/dist-sdk/src/graph/index.d.ts +83 -0
  353. package/dist-sdk/src/graph/index.js +207 -0
  354. package/dist-sdk/src/graph/modules.d.ts +7 -0
  355. package/dist-sdk/src/graph/modules.js +37 -0
  356. package/dist-sdk/src/graph/types.d.ts +301 -0
  357. package/dist-sdk/src/graph/types.js +102 -0
  358. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  359. package/dist-sdk/src/internal/sdk-package.js +23 -0
  360. package/package.json +173 -8
@@ -0,0 +1,22 @@
1
+ import type { AspectRef, FieldRef } from "../../../catalog/index.js";
2
+ import { type RenderNode, type SerializedRenderTree } from "./render-catalog.js";
3
+ import type { FlowActivityDefV2 } from "./types.js";
4
+ export interface FormActivityConfig {
5
+ /** The app this form writes against (its fields back the bindings). */
6
+ readonly owner: AspectRef;
7
+ /** Display name for this activity in the flow. */
8
+ readonly name: string;
9
+ /** Single root `RenderNode` — build with the render-catalog helpers. */
10
+ readonly layout: RenderNode;
11
+ }
12
+ /** One field binding — `aspectFieldId` holds a FieldRef token (resolved at deploy). */
13
+ export interface SerializedFormFieldBindingV2 {
14
+ readonly elementId: string;
15
+ readonly aspectFieldId: FieldRef;
16
+ readonly statePath: unknown;
17
+ }
18
+ export interface SerializedFormConfigurationV2 {
19
+ readonly renderTree: SerializedRenderTree;
20
+ readonly fieldReferences: readonly SerializedFormFieldBindingV2[];
21
+ }
22
+ export declare function formActivity(config: FormActivityConfig): FlowActivityDefV2;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * formActivity — a HUMAN/FORM step in a v2 flow. The form UI is a json-render
3
+ * tree built from the v2 render-catalog helpers; field-binding leaves carry
4
+ * `FieldRef` tokens (resolved to ids at deploy). The serializer extracts the
5
+ * `fieldReferences` side-table Wolverine cross-checks.
6
+ *
7
+ * FORM is the one activity kind whose `configuration` the `/v1/flows/create`
8
+ * endpoint accepts.
9
+ */
10
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
11
+ import { serializeRenderTree, } from "./render-catalog.js";
12
+ export function formActivity(config) {
13
+ if (!config.name || config.name.trim() === "") {
14
+ throw new EdkValidationError("formActivity requires a non-empty name.");
15
+ }
16
+ const fieldReferences = [];
17
+ const renderTree = serializeRenderTree(config.layout, (node, elementId) => {
18
+ if (node.__binding) {
19
+ fieldReferences.push({
20
+ elementId,
21
+ aspectFieldId: node.__binding.aspectFieldId, // FieldRef token → id at deploy
22
+ statePath: node.__binding.statePath,
23
+ });
24
+ }
25
+ });
26
+ if (fieldReferences.length === 0) {
27
+ throw new EdkValidationError(`formActivity "${config.name}" must surface at least one field-binding leaf ` +
28
+ `(inputFor / selectFor / textareaFor / ...). A form with no bindings writes nothing.`);
29
+ }
30
+ return {
31
+ activityType: "HUMAN",
32
+ activitySubType: "FORM",
33
+ name: config.name,
34
+ configuration: { renderTree, fieldReferences },
35
+ };
36
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * v2 flow activity factories + the input-ref / prompt vocabulary. Parallel to
3
+ * v1 `src/flows/activities`. Form activities (the render-catalog DSL) land in a
4
+ * follow-up; agent / automation / approval cover the orchestration core.
5
+ */
6
+ export { agentActivity, type AgentActivityConfig } from "./agent.js";
7
+ export { automationActivity, type AutomationActivityConfig } from "./automation.js";
8
+ export { approvalActivity, type ApprovalActivityConfig } from "./approval.js";
9
+ export { formActivity, type FormActivityConfig, type SerializedFormConfigurationV2, type SerializedFormFieldBindingV2, } from "./form.js";
10
+ export { card, checkboxFor, email, fieldFor, grid, heading, inputFor, isRenderNode, maxLength, minLength, required, selectFor, separator, serializeRenderTree, stack, switchFor, text, textareaFor, type Check, type RenderNode, type SerializedRenderElement, type SerializedRenderTree, } from "./render-catalog.js";
11
+ export { activityOutput, isFlowInputRef, literal, recordField, type ActivityOutputRefV2, type FlowInputRefKind, type FlowInputRefV2, type LiteralRefV2, type RecordFieldRefV2, } from "./input-refs.js";
12
+ export { isPromptTemplate, literalPrompt, promptTemplate, type PromptTemplate, type PromptTemplateSegment, } from "./prompt-template.js";
13
+ export { buildFlowCtxV2, type FlowActivityOutputProxy, type FlowCtxV2 } from "./ctx.js";
14
+ export { type FlowActivityDefV2, type FlowActivityReferenceV2, type FlowActivitySubType, type FlowActivityType, } from "./types.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * v2 flow activity factories + the input-ref / prompt vocabulary. Parallel to
3
+ * v1 `src/flows/activities`. Form activities (the render-catalog DSL) land in a
4
+ * follow-up; agent / automation / approval cover the orchestration core.
5
+ */
6
+ export { agentActivity } from "./agent.js";
7
+ export { automationActivity } from "./automation.js";
8
+ export { approvalActivity } from "./approval.js";
9
+ export { formActivity, } from "./form.js";
10
+ export { card, checkboxFor, email, fieldFor, grid, heading, inputFor, isRenderNode, maxLength, minLength, required, selectFor, separator, serializeRenderTree, stack, switchFor, text, textareaFor, } from "./render-catalog.js";
11
+ export { activityOutput, isFlowInputRef, literal, recordField, } from "./input-refs.js";
12
+ export { isPromptTemplate, literalPrompt, promptTemplate, } from "./prompt-template.js";
13
+ export { buildFlowCtxV2 } from "./ctx.js";
@@ -0,0 +1,39 @@
1
+ /**
2
+ * v2 flow activity input refs — the "where does this input come from?" vocabulary
3
+ * for `inputs:` declarations and `prompt:` segments. Parallel to v1
4
+ * `src/flows/activities/input-refs.ts`, but a record-field ref carries a
5
+ * **FieldRef token** (resolved to the field id at deploy) instead of a baked id.
6
+ *
7
+ * Three ref kinds:
8
+ * - `RECORD_FIELD` — a field on the bound record (`recordField(app.fields.x)`).
9
+ * - `ACTIVITY_OUTPUT` — a named output from a prior activity (usually via
10
+ * `ctx.activities.<key>.outputs.<name>`).
11
+ * - `LITERAL` — a static value baked into the flow.
12
+ */
13
+ import type { FieldRef } from "../../../catalog/index.js";
14
+ export type FlowInputRefKind = "RECORD_FIELD" | "ACTIVITY_OUTPUT" | "LITERAL";
15
+ export interface RecordFieldRefV2 {
16
+ readonly kind: "RECORD_FIELD";
17
+ /** FieldRef token → the field id at deploy (`resolvePayload`). */
18
+ readonly fieldId: FieldRef;
19
+ }
20
+ export interface ActivityOutputRefV2 {
21
+ readonly kind: "ACTIVITY_OUTPUT";
22
+ /** The upstream activity's slug-key (matches `SerializedFlowActivity.key`). */
23
+ readonly activityKey: string;
24
+ /** Output property name on that activity. */
25
+ readonly outputName: string;
26
+ }
27
+ export interface LiteralRefV2 {
28
+ readonly kind: "LITERAL";
29
+ readonly value: string | number | boolean | null;
30
+ }
31
+ export type FlowInputRefV2 = RecordFieldRefV2 | ActivityOutputRefV2 | LiteralRefV2;
32
+ /** Read a value from a field on the bound record (token resolved at deploy). */
33
+ export declare function recordField(field: FieldRef): RecordFieldRefV2;
34
+ /** Read a named output from a prior activity. */
35
+ export declare function activityOutput(activityKey: string, outputName: string): ActivityOutputRefV2;
36
+ /** A static value baked into the flow. */
37
+ export declare function literal(value: string | number | boolean | null): LiteralRefV2;
38
+ /** Type guard: a value that's already a `FlowInputRefV2`. */
39
+ export declare function isFlowInputRef(value: unknown): value is FlowInputRefV2;
@@ -0,0 +1,19 @@
1
+ /** Read a value from a field on the bound record (token resolved at deploy). */
2
+ export function recordField(field) {
3
+ return { kind: "RECORD_FIELD", fieldId: field };
4
+ }
5
+ /** Read a named output from a prior activity. */
6
+ export function activityOutput(activityKey, outputName) {
7
+ return { kind: "ACTIVITY_OUTPUT", activityKey, outputName };
8
+ }
9
+ /** A static value baked into the flow. */
10
+ export function literal(value) {
11
+ return { kind: "LITERAL", value };
12
+ }
13
+ /** Type guard: a value that's already a `FlowInputRefV2`. */
14
+ export function isFlowInputRef(value) {
15
+ if (typeof value !== "object" || value === null)
16
+ return false;
17
+ const kind = value.kind;
18
+ return kind === "RECORD_FIELD" || kind === "ACTIVITY_OUTPUT" || kind === "LITERAL";
19
+ }
@@ -0,0 +1,13 @@
1
+ import { type FlowInputRefV2 } from "./input-refs.js";
2
+ export type PromptTemplateSegment = string | FlowInputRefV2;
3
+ export interface PromptTemplate {
4
+ readonly kind: "TEMPLATE";
5
+ readonly segments: ReadonlyArray<PromptTemplateSegment>;
6
+ }
7
+ /** Compose a prompt template from alternating string literals and refs. */
8
+ export declare function promptTemplate<T extends ReadonlyArray<PromptTemplateSegment>>(...segments: T): PromptTemplate;
9
+ /** Wrap a plain string as a uniform `PromptTemplate`. */
10
+ export declare function literalPrompt(value: string): PromptTemplate;
11
+ export declare function isPromptTemplate(value: unknown): value is PromptTemplate;
12
+ /** Runtime guard mirroring the compile-time `PromptTemplateSegment` constraint. */
13
+ export declare function validatePromptSegments(segments: ReadonlyArray<unknown>): void;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Prompt-template helpers for `agentActivity({ prompt: ... })`. Composes an
3
+ * agent's initial prompt from alternating string literals and `FlowInputRefV2`s.
4
+ * Parallel to v1 `src/flows/activities/prompt-template.ts` (which is agnostic
5
+ * over the ref shape); kept separate so v2 refs (FieldRef-token-bearing) type
6
+ * cleanly.
7
+ */
8
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
9
+ import { isFlowInputRef } from "./input-refs.js";
10
+ /** Compose a prompt template from alternating string literals and refs. */
11
+ export function promptTemplate(...segments) {
12
+ return { kind: "TEMPLATE", segments };
13
+ }
14
+ /** Wrap a plain string as a uniform `PromptTemplate`. */
15
+ export function literalPrompt(value) {
16
+ return { kind: "TEMPLATE", segments: [value] };
17
+ }
18
+ export function isPromptTemplate(value) {
19
+ return (typeof value === "object" &&
20
+ value !== null &&
21
+ value.kind === "TEMPLATE" &&
22
+ Array.isArray(value.segments));
23
+ }
24
+ /** Runtime guard mirroring the compile-time `PromptTemplateSegment` constraint. */
25
+ export function validatePromptSegments(segments) {
26
+ for (let i = 0; i < segments.length; i++) {
27
+ const seg = segments[i];
28
+ if (typeof seg === "string")
29
+ continue;
30
+ if (isFlowInputRef(seg))
31
+ continue;
32
+ throw new EdkValidationError(`promptTemplate segment[${i}] must be a string or FlowInputRef, got ${typeof seg}`);
33
+ }
34
+ }
@@ -0,0 +1,140 @@
1
+ import type { FieldRef } from "../../../catalog/index.js";
2
+ /** Marker key the wire boundary flattens to a `record/<id>` statePath string. */
3
+ export declare const RECORD_PATH_MARKER = "__recordPath";
4
+ /** A node in the v2 render-tree AST. `aspectFieldId`/statePath hold tokens/markers. */
5
+ export interface RenderNode<T extends string = string> {
6
+ readonly __nodeKind: "render-node";
7
+ readonly type: T;
8
+ readonly props: Record<string, unknown>;
9
+ readonly children?: readonly RenderNode[];
10
+ readonly __binding?: {
11
+ readonly aspectFieldId: FieldRef;
12
+ readonly statePath: unknown;
13
+ };
14
+ }
15
+ export interface StackProps {
16
+ readonly direction?: "horizontal" | "vertical";
17
+ readonly gap?: "xs" | "sm" | "md" | "lg" | "xl";
18
+ readonly align?: "start" | "center" | "end" | "stretch";
19
+ readonly justify?: "start" | "center" | "end" | "between" | "around";
20
+ }
21
+ export interface CardProps {
22
+ readonly title?: string;
23
+ readonly description?: string;
24
+ readonly maxWidth?: "sm" | "md" | "lg" | "xl" | "full";
25
+ readonly centered?: boolean;
26
+ }
27
+ export interface GridProps {
28
+ readonly columns?: 1 | 2 | 3 | 4 | 5 | 6;
29
+ readonly gap?: "xs" | "sm" | "md" | "lg" | "xl";
30
+ }
31
+ export interface HeadingProps {
32
+ readonly level?: 1 | 2 | 3 | 4;
33
+ }
34
+ export interface TextProps {
35
+ readonly variant?: "default" | "muted" | "small";
36
+ }
37
+ export interface SeparatorProps {
38
+ readonly orientation?: "horizontal" | "vertical";
39
+ }
40
+ export declare function stack(children: readonly RenderNode[], props?: StackProps): RenderNode<"Stack">;
41
+ export declare function card(props: CardProps, children: readonly RenderNode[]): RenderNode<"Card">;
42
+ export declare function grid(props: GridProps, children: readonly RenderNode[]): RenderNode<"Grid">;
43
+ export declare function heading(text: string, props?: HeadingProps): RenderNode<"Heading">;
44
+ export declare function text(value: string, props?: TextProps): RenderNode<"Text">;
45
+ export declare function separator(props?: SeparatorProps): RenderNode<"Separator">;
46
+ /** A single entity-reference leaf, used by `App.toUI()` to render bag entries. */
47
+ export interface ActivityNodeSpec {
48
+ readonly kind: "AGENT" | "AUTOMATION" | "DEFAULT";
49
+ readonly name: string;
50
+ readonly referenceName?: string;
51
+ readonly subType?: string;
52
+ readonly typeLabel?: string;
53
+ }
54
+ /**
55
+ * Build a single-node `ActivityNode` element — a colored leaf rendering an
56
+ * entity reference. Useful for the agent / automation grids in `App.toUI()`.
57
+ */
58
+ export declare function activityNode(spec: ActivityNodeSpec): RenderNode<"ActivityNode">;
59
+ export type Check = {
60
+ readonly type: "required";
61
+ readonly message?: string;
62
+ } | {
63
+ readonly type: "email";
64
+ readonly message?: string;
65
+ } | {
66
+ readonly type: "url";
67
+ readonly message?: string;
68
+ } | {
69
+ readonly type: "minLength";
70
+ readonly value: number;
71
+ readonly message?: string;
72
+ } | {
73
+ readonly type: "maxLength";
74
+ readonly value: number;
75
+ readonly message?: string;
76
+ } | {
77
+ readonly type: "min";
78
+ readonly value: number;
79
+ readonly message?: string;
80
+ } | {
81
+ readonly type: "max";
82
+ readonly value: number;
83
+ readonly message?: string;
84
+ } | {
85
+ readonly type: "pattern";
86
+ readonly value: string;
87
+ readonly message?: string;
88
+ };
89
+ export declare const required: (message?: string) => Check;
90
+ export declare const email: (message?: string) => Check;
91
+ export declare const minLength: (value: number, message?: string) => Check;
92
+ export declare const maxLength: (value: number, message?: string) => Check;
93
+ export interface FieldBindingOptions {
94
+ readonly label?: string;
95
+ readonly helpText?: string;
96
+ readonly checks?: readonly Check[];
97
+ }
98
+ export interface InputFieldOptions extends FieldBindingOptions {
99
+ readonly placeholder?: string;
100
+ readonly type?: "text" | "email" | "password" | "tel" | "url" | "number" | "date" | "datetime-local";
101
+ }
102
+ export interface TextareaFieldOptions extends FieldBindingOptions {
103
+ readonly placeholder?: string;
104
+ readonly rows?: number;
105
+ }
106
+ export interface SelectFieldOptions extends FieldBindingOptions {
107
+ readonly placeholder?: string;
108
+ readonly options?: readonly {
109
+ value: string;
110
+ label: string;
111
+ }[];
112
+ }
113
+ /** Bind a scalar field (TEXT/NUMBER/DECIMAL/DATE/DATETIME/USER_ID/GROUP_ID) to an `Input`. */
114
+ export declare function inputFor(field: FieldRef, opts?: InputFieldOptions): RenderNode<"Input">;
115
+ /** Bind a TEXT/HTML/RICH_TEXT field to a `Textarea`. */
116
+ export declare function textareaFor(field: FieldRef, opts?: TextareaFieldOptions): RenderNode<"Textarea">;
117
+ /** Bind a PICKLIST/MULTI_PICKLIST field to a `Select` (options fetched at render time unless given). */
118
+ export declare function selectFor(field: FieldRef, opts?: SelectFieldOptions): RenderNode<"Select">;
119
+ /** Bind a BOOLEAN field to a `Switch`. */
120
+ export declare function switchFor(field: FieldRef, opts?: FieldBindingOptions): RenderNode<"Switch">;
121
+ /** Bind a BOOLEAN field to a `Checkbox`. */
122
+ export declare function checkboxFor(field: FieldRef, opts?: FieldBindingOptions): RenderNode<"Checkbox">;
123
+ /** Bind any binding-eligible field to the component best fitting its declared type. */
124
+ export declare function fieldFor(field: FieldRef, opts?: FieldBindingOptions & {
125
+ placeholder?: string;
126
+ rows?: number;
127
+ }): RenderNode;
128
+ export interface SerializedRenderElement {
129
+ readonly type: string;
130
+ readonly props: Record<string, unknown>;
131
+ readonly children?: readonly string[];
132
+ }
133
+ export interface SerializedRenderTree {
134
+ readonly root: string;
135
+ readonly elements: Record<string, SerializedRenderElement>;
136
+ }
137
+ export type RenderTreeVisitor = (node: RenderNode, elementId: string) => void;
138
+ export declare function isRenderNode(value: unknown): value is RenderNode;
139
+ /** Walk the AST depth-first → flat `{ root, elements }`; `visit` collects bindings. */
140
+ export declare function serializeRenderTree(layout: RenderNode, visit?: RenderTreeVisitor): SerializedRenderTree;
@@ -0,0 +1,174 @@
1
+ /**
2
+ * v2 form render-catalog — typed json-render AST helpers for `formActivity`.
3
+ * Parallel to v1 `src/flows/activities/render-catalog.ts`; the layout helpers
4
+ * are identical, but the **field-binding leaves take a `FieldRef` token** (not a
5
+ * live `AppField`) and emit the field id position as a token resolved at deploy.
6
+ *
7
+ * A binding leaf needs the field id in two places — `__binding.aspectFieldId`
8
+ * (resolved straight to the id) and the `record/<id>` **statePath string**. v2
9
+ * has no id at author time, so the statePath is emitted as a structured marker
10
+ * `{ __recordPath: <FieldRef token> }`; after `resolvePayload` swaps the token
11
+ * for the id, the wire boundary flattens the marker to `"record/<id>"` (see
12
+ * `flattenRecordPaths` in the apply wire client).
13
+ */
14
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
15
+ /** Marker key the wire boundary flattens to a `record/<id>` statePath string. */
16
+ export const RECORD_PATH_MARKER = "__recordPath";
17
+ const NODE_KIND = "render-node";
18
+ /** Build the structured statePath marker for a field (flattened to a string at deploy). */
19
+ function recordPath(field) {
20
+ return { [RECORD_PATH_MARKER]: field };
21
+ }
22
+ export function stack(children, props) {
23
+ return { __nodeKind: NODE_KIND, type: "Stack", props: { ...(props ?? {}) }, children };
24
+ }
25
+ export function card(props, children) {
26
+ return { __nodeKind: NODE_KIND, type: "Card", props: { ...props }, children };
27
+ }
28
+ export function grid(props, children) {
29
+ return { __nodeKind: NODE_KIND, type: "Grid", props: { ...props }, children };
30
+ }
31
+ export function heading(text, props) {
32
+ return { __nodeKind: NODE_KIND, type: "Heading", props: { text, ...(props ?? {}) } };
33
+ }
34
+ export function text(value, props) {
35
+ return { __nodeKind: NODE_KIND, type: "Text", props: { text: value, ...(props ?? {}) } };
36
+ }
37
+ export function separator(props) {
38
+ return { __nodeKind: NODE_KIND, type: "Separator", props: { ...(props ?? {}) } };
39
+ }
40
+ /**
41
+ * Build a single-node `ActivityNode` element — a colored leaf rendering an
42
+ * entity reference. Useful for the agent / automation grids in `App.toUI()`.
43
+ */
44
+ export function activityNode(spec) {
45
+ const props = { kind: spec.kind, name: spec.name };
46
+ if (spec.subType != null)
47
+ props.subType = spec.subType;
48
+ if (spec.referenceName != null)
49
+ props.referenceName = spec.referenceName;
50
+ if (spec.typeLabel != null)
51
+ props.typeLabel = spec.typeLabel;
52
+ return { __nodeKind: NODE_KIND, type: "ActivityNode", props };
53
+ }
54
+ export const required = (message) => message ? { type: "required", message } : { type: "required" };
55
+ export const email = (message) => message ? { type: "email", message } : { type: "email" };
56
+ export const minLength = (value, message) => message ? { type: "minLength", value, message } : { type: "minLength", value };
57
+ export const maxLength = (value, message) => message ? { type: "maxLength", value, message } : { type: "maxLength", value };
58
+ /** Attach the binding marker + state path. `aspectFieldId` resolves to the id at deploy. */
59
+ function buildBindingNode(type, field, props) {
60
+ const statePath = recordPath(field);
61
+ return {
62
+ __nodeKind: NODE_KIND,
63
+ type,
64
+ props: { ...props, name: statePath, statePath },
65
+ __binding: { aspectFieldId: field, statePath },
66
+ };
67
+ }
68
+ function commonProps(field, opts) {
69
+ const props = { label: opts.label ?? field.name };
70
+ if (opts.helpText != null)
71
+ props.helpText = opts.helpText;
72
+ if (opts.checks != null && opts.checks.length > 0)
73
+ props.checks = opts.checks;
74
+ return props;
75
+ }
76
+ /** Bind a scalar field (TEXT/NUMBER/DECIMAL/DATE/DATETIME/USER_ID/GROUP_ID) to an `Input`. */
77
+ export function inputFor(field, opts = {}) {
78
+ const inferred = field.fieldType === "NUMBER" || field.fieldType === "DECIMAL"
79
+ ? "number"
80
+ : field.fieldType === "DATE"
81
+ ? "date"
82
+ : field.fieldType === "DATETIME"
83
+ ? "datetime-local"
84
+ : "text";
85
+ const props = commonProps(field, opts);
86
+ props.type = opts.type ?? inferred;
87
+ if (opts.placeholder != null)
88
+ props.placeholder = opts.placeholder;
89
+ return buildBindingNode("Input", field, props);
90
+ }
91
+ /** Bind a TEXT/HTML/RICH_TEXT field to a `Textarea`. */
92
+ export function textareaFor(field, opts = {}) {
93
+ const props = commonProps(field, opts);
94
+ if (opts.placeholder != null)
95
+ props.placeholder = opts.placeholder;
96
+ if (opts.rows != null)
97
+ props.rows = opts.rows;
98
+ return buildBindingNode("Textarea", field, props);
99
+ }
100
+ /** Bind a PICKLIST/MULTI_PICKLIST field to a `Select` (options fetched at render time unless given). */
101
+ export function selectFor(field, opts = {}) {
102
+ const props = commonProps(field, opts);
103
+ if (opts.placeholder != null)
104
+ props.placeholder = opts.placeholder;
105
+ if (opts.options != null)
106
+ props.options = opts.options;
107
+ return buildBindingNode("Select", field, props);
108
+ }
109
+ /** Bind a BOOLEAN field to a `Switch`. */
110
+ export function switchFor(field, opts = {}) {
111
+ return buildBindingNode("Switch", field, commonProps(field, opts));
112
+ }
113
+ /** Bind a BOOLEAN field to a `Checkbox`. */
114
+ export function checkboxFor(field, opts = {}) {
115
+ return buildBindingNode("Checkbox", field, commonProps(field, opts));
116
+ }
117
+ /** Bind any binding-eligible field to the component best fitting its declared type. */
118
+ export function fieldFor(field, opts = {}) {
119
+ switch (field.fieldType) {
120
+ case "PICKLIST":
121
+ case "MULTI_PICKLIST":
122
+ return selectFor(field, opts);
123
+ case "HTML":
124
+ case "RICH_TEXT":
125
+ return textareaFor(field, opts);
126
+ case "BOOLEAN":
127
+ return switchFor(field, opts);
128
+ case "TEXT":
129
+ case "NUMBER":
130
+ case "DECIMAL":
131
+ case "DATE":
132
+ case "DATETIME":
133
+ case "USER_ID":
134
+ case "GROUP_ID":
135
+ return inputFor(field, opts);
136
+ default:
137
+ throw new EdkValidationError(`fieldFor: field "${field.name}" has type "${field.fieldType}" which no binding helper supports. ` +
138
+ `Use a layout helper (heading / text / separator) or a specific binding helper.`);
139
+ }
140
+ }
141
+ export function isRenderNode(value) {
142
+ return (typeof value === "object" &&
143
+ value !== null &&
144
+ value.__nodeKind === NODE_KIND);
145
+ }
146
+ function uniqueElementId(candidate, used) {
147
+ if (!used.has(candidate))
148
+ return candidate;
149
+ let suffix = 2;
150
+ while (used.has(`${candidate}_${suffix}`))
151
+ suffix++;
152
+ return `${candidate}_${suffix}`;
153
+ }
154
+ /** Walk the AST depth-first → flat `{ root, elements }`; `visit` collects bindings. */
155
+ export function serializeRenderTree(layout, visit) {
156
+ if (!isRenderNode(layout)) {
157
+ throw new EdkValidationError(`serializeRenderTree: \`layout\` must be a RenderNode from the catalog helpers (card, stack, inputFor, ...).`);
158
+ }
159
+ const elements = {};
160
+ const usedIds = new Set();
161
+ const walk = (node, path) => {
162
+ const id = uniqueElementId(path, usedIds);
163
+ usedIds.add(id);
164
+ let childIds;
165
+ if (node.children && node.children.length > 0) {
166
+ childIds = node.children.map((child, index) => walk(child, `${path}.${index}`));
167
+ }
168
+ elements[id] = { type: node.type, props: node.props, ...(childIds ? { children: childIds } : {}) };
169
+ visit?.(node, id);
170
+ return id;
171
+ };
172
+ const root = walk(layout, "root");
173
+ return { root, elements };
174
+ }
@@ -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 {};