@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,160 @@
1
+ /**
2
+ * Value Reference system — the foundation of the SDK's type-safe data flow.
3
+ *
4
+ * A Ref<T> is a *description* of a runtime value, not the value itself.
5
+ * It carries enough metadata to serialize into the Elementum API's
6
+ * ValueReferenceInput format (trigger refs, task refs, forEach refs,
7
+ * static values, and template strings).
8
+ *
9
+ * TypeScript sees the phantom T so autocomplete and type checking work;
10
+ * the runtime Proxy layer (see context.ts) constructs these automatically
11
+ * when agent code accesses ctx.trigger.* or ctx.tasks.*.
12
+ */
13
+ export interface TriggerRefData {
14
+ kind: "trigger";
15
+ name: string;
16
+ }
17
+ export interface TaskRefData {
18
+ kind: "task";
19
+ taskRefKey: string;
20
+ name: string;
21
+ }
22
+ export interface ForEachRefData {
23
+ kind: "forEach";
24
+ forEachTaskName: string;
25
+ name: string;
26
+ }
27
+ export interface StaticRefData {
28
+ kind: "static";
29
+ value: unknown;
30
+ }
31
+ export interface TemplateRefData {
32
+ kind: "template";
33
+ parts: (string | RefData)[];
34
+ }
35
+ export interface VariableParamRefData {
36
+ kind: "variableParam";
37
+ variableTaskRefKey: string;
38
+ name: string;
39
+ }
40
+ /**
41
+ * A reference to a named secret stored in the Elementum secret vault.
42
+ * Resolved at runtime by the executor; never serialized as plaintext.
43
+ */
44
+ export interface SecretRefData {
45
+ kind: "secret";
46
+ secretId: string;
47
+ }
48
+ export type RefData = TriggerRefData | TaskRefData | ForEachRefData | StaticRefData | TemplateRefData | VariableParamRefData | SecretRefData;
49
+ declare const REF_BRAND: unique symbol;
50
+ export interface Ref<T> {
51
+ readonly [REF_BRAND]: true;
52
+ /** Phantom type — never read at runtime, only used by TypeScript. */
53
+ readonly __type: T;
54
+ /** The serializable descriptor for this reference. */
55
+ readonly __data: RefData;
56
+ }
57
+ export declare function createRef<T>(data: RefData): Ref<T>;
58
+ export declare function isRef(value: unknown): value is Ref<unknown>;
59
+ export type ToRefs<T> = {
60
+ [K in keyof T]: Ref<T[K]>;
61
+ };
62
+ /**
63
+ * Simplify<T> flattens intersection types into a single object for clean
64
+ * IDE hover tooltips (e.g. A & B & C → { ...all keys... }).
65
+ */
66
+ export type Simplify<T> = {
67
+ [K in keyof T]: T[K];
68
+ } & {};
69
+ /** Create a static-value reference. */
70
+ export declare function val<T>(value: T): Ref<T>;
71
+ /**
72
+ * Branded error type surfaced in IDE hovers when a `template()` arg list
73
+ * has a literal string fragment ending in `$` immediately followed by a
74
+ * `Ref<...>` arg. The Mobius UI's Lexical editor interprets
75
+ * `${{{pN}}}` as an escape and renders the reference placeholder as
76
+ * literal text; see plans/edk-shortcomings.md #27.
77
+ *
78
+ * Fix at the call site by removing the literal `$` — the downstream
79
+ * string usually already contains the currency code ("USD") or the
80
+ * meaning of the prefix.
81
+ */
82
+ export type _TemplateDollarBeforeRefError = "__edk_error_template_cannot_have_$_immediately_before_a_ref__" & never;
83
+ type IsRefPart<T> = T extends Ref<unknown> ? true : false;
84
+ /**
85
+ * Walk the variadic argument list. Whenever a literal string arg ends in
86
+ * `$` and the next arg is a `Ref<...>`, replace the Ref slot with the
87
+ * branded error type so `tsc` rejects the call at the offending
88
+ * position.
89
+ */
90
+ export type ValidateTemplateArgs<Args extends readonly unknown[]> = Args extends readonly [
91
+ infer Head,
92
+ infer Next,
93
+ ...infer Rest
94
+ ] ? Head extends `${string}$` ? IsRefPart<Next> extends true ? readonly [Head, _TemplateDollarBeforeRefError, ...ValidateTemplateArgs<Rest>] : readonly [Head, Next, ...ValidateTemplateArgs<readonly [Next, ...Rest] extends readonly [infer _, ...infer R] ? R : []>] : readonly [Head, ...ValidateTemplateArgs<readonly [Next, ...Rest]>] : Args;
95
+ /**
96
+ * Create a template-string reference from interleaved strings and refs.
97
+ *
98
+ * Rejects any literal string fragment that ends in `$` when immediately
99
+ * followed by a `Ref<...>` — the UI can't render that pattern (see
100
+ * plans/edk-shortcomings.md #27). Dynamic/computed string fragments that
101
+ * the type system can't inspect are caught at serialize time by an
102
+ * escape-character insertion pass.
103
+ */
104
+ export declare function template<const Args extends readonly (string | Ref<unknown>)[]>(...parts: Args & ValidateTemplateArgs<Args>): Ref<string>;
105
+ /**
106
+ * Reference a named secret by id. The resolver at execution time fetches
107
+ * the plaintext from the Elementum secret vault. EDK never sees the
108
+ * plaintext.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * apiRequest({
113
+ * url: "https://api.example.com",
114
+ * method: "GET",
115
+ * authorization: { type: "bearer", token: secret("payments-provider-token") },
116
+ * })
117
+ * ```
118
+ */
119
+ export declare function secret(secretId: string): Ref<string>;
120
+ /**
121
+ * Marker prefix embedded in a trigger ref's `record.<field>` name when the
122
+ * field couldn't be resolved. `unresolvedField` writes it;
123
+ * `src/deploy/plan/resolve-record-refs.ts` strips it back off and passes the
124
+ * raw id straight through to the wire, unchecked against the field catalog —
125
+ * keep both sides in sync.
126
+ */
127
+ export declare const UNRESOLVED_FIELD_MARKER = "__edkUnresolvedField::";
128
+ /**
129
+ * Escape hatch for a `ctx.trigger.record.<field>` reference the pull-time
130
+ * deserializer couldn't resolve to any field in the owning app's catalog —
131
+ * the wire field id/clientHandle isn't present there (deleted, orphaned, or
132
+ * otherwise never captured). `RecordShape<A>` is closed over the app's known
133
+ * fields, so a raw/unknown id has no normal spelling through
134
+ * `ctx.trigger.record`; this bypasses that typed proxy entirely.
135
+ *
136
+ * `rawFieldId` round-trips straight through to the platform unchanged on
137
+ * deploy — EDK never validates it against the field catalog, so it also never
138
+ * blocks the plan.
139
+ */
140
+ export declare function unresolvedField(rawFieldId: string): Ref<unknown>;
141
+ /** Accepts a value that is either a literal T or a Ref<T>. */
142
+ export type ValueOrRef<T> = T | Ref<T>;
143
+ /**
144
+ * Unwrap ValueOrRef to its underlying RefData.
145
+ * Literal values become static refs.
146
+ */
147
+ export declare function toRefData(v: ValueOrRef<unknown>): RefData;
148
+ /**
149
+ * Normalize a string-typed task field so the Mobius UI's templating layer
150
+ * can render it. The platform expects these fields as a `templateReference`;
151
+ * a bare trigger/task/forEach ref serializes to a single-kind ref and the
152
+ * UI either renders empty (postComment.contents) or throws
153
+ * `e.matchAll is not a function` (sendEmail.messageBody) when it tries to
154
+ * expand placeholders.
155
+ *
156
+ * Plain strings and explicit `template(...)` values pass through unchanged.
157
+ * Any other ref kind is wrapped in a one-parameter template.
158
+ */
159
+ export declare function ensureTemplate(value: ValueOrRef<string> | Ref<unknown>): ValueOrRef<string> | Ref<unknown>;
160
+ export {};
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Value Reference system — the foundation of the SDK's type-safe data flow.
3
+ *
4
+ * A Ref<T> is a *description* of a runtime value, not the value itself.
5
+ * It carries enough metadata to serialize into the Elementum API's
6
+ * ValueReferenceInput format (trigger refs, task refs, forEach refs,
7
+ * static values, and template strings).
8
+ *
9
+ * TypeScript sees the phantom T so autocomplete and type checking work;
10
+ * the runtime Proxy layer (see context.ts) constructs these automatically
11
+ * when agent code accesses ctx.trigger.* or ctx.tasks.*.
12
+ */
13
+ import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
14
+ // ---------------------------------------------------------------------------
15
+ // Branded Ref<T> type
16
+ // ---------------------------------------------------------------------------
17
+ const REF_BRAND = Symbol("Ref");
18
+ export function createRef(data) {
19
+ return { [REF_BRAND]: true, __type: undefined, __data: data };
20
+ }
21
+ export function isRef(value) {
22
+ return (typeof value === "object" &&
23
+ value !== null &&
24
+ REF_BRAND in value &&
25
+ value[REF_BRAND] === true);
26
+ }
27
+ // ---------------------------------------------------------------------------
28
+ // Convenience helpers for explicit ref construction
29
+ // ---------------------------------------------------------------------------
30
+ /** Create a static-value reference. */
31
+ export function val(value) {
32
+ return createRef({ kind: "static", value });
33
+ }
34
+ /**
35
+ * Create a template-string reference from interleaved strings and refs.
36
+ *
37
+ * Rejects any literal string fragment that ends in `$` when immediately
38
+ * followed by a `Ref<...>` — the UI can't render that pattern (see
39
+ * plans/edk-shortcomings.md #27). Dynamic/computed string fragments that
40
+ * the type system can't inspect are caught at serialize time by an
41
+ * escape-character insertion pass.
42
+ */
43
+ export function template(...parts) {
44
+ const data = parts.map((p) => isRef(p) ? p.__data : String(p));
45
+ return createRef({ kind: "template", parts: data });
46
+ }
47
+ /**
48
+ * Reference a named secret by id. The resolver at execution time fetches
49
+ * the plaintext from the Elementum secret vault. EDK never sees the
50
+ * plaintext.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * apiRequest({
55
+ * url: "https://api.example.com",
56
+ * method: "GET",
57
+ * authorization: { type: "bearer", token: secret("payments-provider-token") },
58
+ * })
59
+ * ```
60
+ */
61
+ export function secret(secretId) {
62
+ if (!secretId || typeof secretId !== "string") {
63
+ throw new EdkValidationError("secret() requires a non-empty string secretId.");
64
+ }
65
+ return createRef({ kind: "secret", secretId });
66
+ }
67
+ /**
68
+ * Marker prefix embedded in a trigger ref's `record.<field>` name when the
69
+ * field couldn't be resolved. `unresolvedField` writes it;
70
+ * `src/deploy/plan/resolve-record-refs.ts` strips it back off and passes the
71
+ * raw id straight through to the wire, unchecked against the field catalog —
72
+ * keep both sides in sync.
73
+ */
74
+ export const UNRESOLVED_FIELD_MARKER = "__edkUnresolvedField::";
75
+ /**
76
+ * Escape hatch for a `ctx.trigger.record.<field>` reference the pull-time
77
+ * deserializer couldn't resolve to any field in the owning app's catalog —
78
+ * the wire field id/clientHandle isn't present there (deleted, orphaned, or
79
+ * otherwise never captured). `RecordShape<A>` is closed over the app's known
80
+ * fields, so a raw/unknown id has no normal spelling through
81
+ * `ctx.trigger.record`; this bypasses that typed proxy entirely.
82
+ *
83
+ * `rawFieldId` round-trips straight through to the platform unchanged on
84
+ * deploy — EDK never validates it against the field catalog, so it also never
85
+ * blocks the plan.
86
+ */
87
+ export function unresolvedField(rawFieldId) {
88
+ if (!rawFieldId || typeof rawFieldId !== "string") {
89
+ throw new EdkValidationError("unresolvedField() requires a non-empty string rawFieldId.");
90
+ }
91
+ return createRef({ kind: "trigger", name: `record.${UNRESOLVED_FIELD_MARKER}${rawFieldId}` });
92
+ }
93
+ /**
94
+ * Unwrap ValueOrRef to its underlying RefData.
95
+ * Literal values become static refs.
96
+ */
97
+ export function toRefData(v) {
98
+ if (isRef(v))
99
+ return v.__data;
100
+ return { kind: "static", value: v };
101
+ }
102
+ /**
103
+ * Normalize a string-typed task field so the Mobius UI's templating layer
104
+ * can render it. The platform expects these fields as a `templateReference`;
105
+ * a bare trigger/task/forEach ref serializes to a single-kind ref and the
106
+ * UI either renders empty (postComment.contents) or throws
107
+ * `e.matchAll is not a function` (sendEmail.messageBody) when it tries to
108
+ * expand placeholders.
109
+ *
110
+ * Plain strings and explicit `template(...)` values pass through unchanged.
111
+ * Any other ref kind is wrapped in a one-parameter template.
112
+ */
113
+ export function ensureTemplate(value) {
114
+ if (!isRef(value))
115
+ return value;
116
+ if (value.__data.kind === "template")
117
+ return value;
118
+ return template(value);
119
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A tool's `field_id` value → the TARGET aspect's field bag key. Shared by
3
+ * `agent-tool`/`skill-tool` from-tf (neither owns the other, so this lives in
4
+ * the cross-entity commons rather than either module). Two shapes: a
5
+ * `resource-attr` to the field's own resource (custom fields, which have a
6
+ * dedicated `elementum_<type>_field` block), or a `local.<aspect>_<key>_
7
+ * field_id` reference (system fields - title/status/closedBy/…, which have
8
+ * no resource of their own). Same recognition `automation/from-tf.ts`'s
9
+ * `decodeValue` already does for record-path field refs.
10
+ *
11
+ * `scopeTfLabel`/`scope` identify the tool's RESOLVED target aspect (self,
12
+ * or a foreign app/element per `target_id` — board issue #169), not always
13
+ * the owning app: a field on a foreign aspect is scoped under that aspect's
14
+ * own label, not the caller's.
15
+ */
16
+ import { type ChildResourceScope, type TfValue } from "../../engine/tf/index.js";
17
+ export declare function resolveToolFieldKey(fieldRef: TfValue | undefined, scopeTfLabel: string, scope?: ChildResourceScope): string | undefined;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * A tool's `field_id` value → the TARGET aspect's field bag key. Shared by
3
+ * `agent-tool`/`skill-tool` from-tf (neither owns the other, so this lives in
4
+ * the cross-entity commons rather than either module). Two shapes: a
5
+ * `resource-attr` to the field's own resource (custom fields, which have a
6
+ * dedicated `elementum_<type>_field` block), or a `local.<aspect>_<key>_
7
+ * field_id` reference (system fields - title/status/closedBy/…, which have
8
+ * no resource of their own). Same recognition `automation/from-tf.ts`'s
9
+ * `decodeValue` already does for record-path field refs.
10
+ *
11
+ * `scopeTfLabel`/`scope` identify the tool's RESOLVED target aspect (self,
12
+ * or a foreign app/element per `target_id` — board issue #169), not always
13
+ * the owning app: a field on a foreign aspect is scoped under that aspect's
14
+ * own label, not the caller's.
15
+ */
16
+ import { isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
17
+ import { SUB_TYPE_BY_RESOURCE as FIELD_SUB_TYPE_BY_RESOURCE } from "../field/types.js";
18
+ export function resolveToolFieldKey(fieldRef, scopeTfLabel, scope = "app") {
19
+ if (fieldRef === undefined)
20
+ return undefined;
21
+ if (isTfExpr(fieldRef) && fieldRef.$expr === "resource-attr" && FIELD_SUB_TYPE_BY_RESOURCE.has(fieldRef.type)) {
22
+ return scopedLabelToBagKey(scopeTfLabel, fieldRef.label, scope);
23
+ }
24
+ if (isTfExpr(fieldRef) && fieldRef.$expr === "local") {
25
+ const prefix = `${scopeTfLabel}_`;
26
+ if (fieldRef.name.startsWith(prefix) && fieldRef.name.endsWith("_field_id")) {
27
+ return tfLabelToTsLabel(fieldRef.name.slice(prefix.length, -"_field_id".length));
28
+ }
29
+ }
30
+ return undefined;
31
+ }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Shared types used across automations, agents, and other EDK domains.
3
+ */
4
+ import type { Ref, ValueOrRef } from "../ref.js";
5
+ import type { Attachment } from "./platform.js";
6
+ import type { AppField } from "../../../core/types/app.js";
7
+ export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
8
+ export interface BasicAuth {
9
+ type: "basic";
10
+ username: ValueOrRef<string>;
11
+ password: ValueOrRef<string>;
12
+ }
13
+ export interface BearerAuth {
14
+ type: "bearer";
15
+ /**
16
+ * Bearer token. Accepts a raw string (literal or environment-rewritten
17
+ * placeholder), a task/trigger ref (e.g. `ctx.tasks.login.token`), or
18
+ * a `secret(...)` ref that serializes to Mobius's secret-reference
19
+ * shape. Every real integration uses a secret; the raw-string form
20
+ * exists only for the literal / placeholder case.
21
+ */
22
+ token: ValueOrRef<string>;
23
+ }
24
+ export interface OAuthAuth {
25
+ type: "oauth";
26
+ url: ValueOrRef<string>;
27
+ clientId: ValueOrRef<string>;
28
+ clientSecret: ValueOrRef<string>;
29
+ }
30
+ export type ApiAuthorization = BasicAuth | BearerAuth | OAuthAuth;
31
+ export interface JsonBody {
32
+ type: "json";
33
+ json: unknown;
34
+ }
35
+ export interface FormBody {
36
+ type: "form";
37
+ values: Array<{
38
+ key: string;
39
+ value: string;
40
+ }>;
41
+ }
42
+ export interface CustomBody {
43
+ type: "custom";
44
+ body: string;
45
+ contentType: string;
46
+ }
47
+ /**
48
+ * One entry in a multipart body. Either a text part (any value, optionally
49
+ * referenced from upstream data) or a file part backed by exactly one of
50
+ * `attachmentId`, `attachment`, or `file`. File-source slots accept a
51
+ * `Ref<…>` only — the platform rejects literal values in those slots, so
52
+ * the type forbids them at compile time.
53
+ */
54
+ export interface MultipartTextPart {
55
+ name: string;
56
+ value: ValueOrRef<string>;
57
+ }
58
+ export type MultipartFilePart = {
59
+ name: string;
60
+ attachmentId: Ref<string>;
61
+ attachment?: never;
62
+ file?: never;
63
+ } | {
64
+ name: string;
65
+ attachment: Ref<Attachment>;
66
+ attachmentId?: never;
67
+ file?: never;
68
+ } | {
69
+ name: string;
70
+ file: Ref<unknown>;
71
+ attachmentId?: never;
72
+ attachment?: never;
73
+ };
74
+ export type MultipartPart = MultipartTextPart | MultipartFilePart;
75
+ export interface MultipartBody {
76
+ type: "multipart";
77
+ parts: ReadonlyArray<MultipartPart>;
78
+ }
79
+ export type ApiBody = JsonBody | FormBody | CustomBody | MultipartBody;
80
+ export type SortDirection = "ASC" | "DESC";
81
+ /** One sort clause (field id + direction). Use {@link asc}, {@link desc}, or {@link sortBy}. */
82
+ export interface SortOrder {
83
+ field: AppField;
84
+ direction: SortDirection;
85
+ }
86
+ export declare function asc(field: AppField): SortOrder;
87
+ export declare function desc(field: AppField): SortOrder;
88
+ /** Multi-field sort (order is significant). Serializes to `Sort.orders` for Mobius. */
89
+ export declare function sortBy(...orders: SortOrder[]): readonly SortOrder[];
90
+ /**
91
+ * Serialize an authored `SortOrder | readonly SortOrder[]` to the
92
+ * platform's `Sort` JSON shape: `{ orders: [{ field: <id>, direction }] }`.
93
+ * Returns `undefined` when `sort` is null/undefined or doesn't match
94
+ * the expected shape — callers can then omit the wire field entirely.
95
+ *
96
+ * Lifted from `automations/serializer/task-serializer.ts` so every
97
+ * tool surface that accepts a sort (automation `recordSearch`, agent
98
+ * search tools, etc.) emits the same wire shape through the same
99
+ * code path.
100
+ */
101
+ export declare function serializeSortToWire(sort: unknown): Record<string, unknown> | undefined;
102
+ export type AiAgentOutputType = "text" | "json";
103
+ export interface AiJsonFieldDef {
104
+ type: "text" | "number" | "boolean" | "date";
105
+ description?: string;
106
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Shared types used across automations, agents, and other EDK domains.
3
+ */
4
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
5
+ export function asc(field) {
6
+ return { field, direction: "ASC" };
7
+ }
8
+ export function desc(field) {
9
+ return { field, direction: "DESC" };
10
+ }
11
+ /** Multi-field sort (order is significant). Serializes to `Sort.orders` for Mobius. */
12
+ export function sortBy(...orders) {
13
+ if (orders.length === 0) {
14
+ throw new EdkValidationError("sortBy requires at least one sort order.");
15
+ }
16
+ return orders;
17
+ }
18
+ /**
19
+ * Defensive runtime predicate — confirms a `unknown` value matches the
20
+ * authored `SortOrder` shape (`{ field: { id }, direction }`). The
21
+ * serializer accepts `SortOrder | SortOrder[] | unknown` from callers
22
+ * (the public option type is loose enough that an arbitrary object
23
+ * could land here) so this guards against bad input before we project
24
+ * onto the wire. Used by {@link serializeSortToWire}.
25
+ */
26
+ function isSortOrderLike(v) {
27
+ if (v === null || typeof v !== "object" || Array.isArray(v))
28
+ return false;
29
+ const o = v;
30
+ const field = o.field;
31
+ if (field === null || typeof field !== "object" || !("id" in field))
32
+ return false;
33
+ return typeof field.id === "string" && typeof o.direction === "string";
34
+ }
35
+ /**
36
+ * Serialize an authored `SortOrder | readonly SortOrder[]` to the
37
+ * platform's `Sort` JSON shape: `{ orders: [{ field: <id>, direction }] }`.
38
+ * Returns `undefined` when `sort` is null/undefined or doesn't match
39
+ * the expected shape — callers can then omit the wire field entirely.
40
+ *
41
+ * Lifted from `automations/serializer/task-serializer.ts` so every
42
+ * tool surface that accepts a sort (automation `recordSearch`, agent
43
+ * search tools, etc.) emits the same wire shape through the same
44
+ * code path.
45
+ */
46
+ export function serializeSortToWire(sort) {
47
+ if (sort == null || typeof sort !== "object")
48
+ return undefined;
49
+ let clauses;
50
+ if (Array.isArray(sort)) {
51
+ clauses = sort.filter(isSortOrderLike);
52
+ }
53
+ else if (isSortOrderLike(sort)) {
54
+ clauses = [sort];
55
+ }
56
+ else {
57
+ clauses = [];
58
+ }
59
+ if (clauses.length === 0)
60
+ return undefined;
61
+ return {
62
+ orders: clauses.map((o) => ({ field: o.field.id, direction: o.direction })),
63
+ };
64
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * WorkflowFieldType — mirrors the Java enum in
3
+ * jarvis/util/.../WorkflowFieldType.java
4
+ *
5
+ * Only the subset relevant to on-demand trigger inputs and task
6
+ * configurations is surfaced here. The full enum is listed for
7
+ * forward-compatibility; uncommon types are commented.
8
+ */
9
+ export type WorkflowFieldType = "TEXT" | "HANDLE" | "NUMBER" | "DECIMAL" | "BOOLEAN" | "DATE" | "DATETIME" | "HTML" | "USER" | "USER_ID" | "GROUP" | "GROUP_ID" | "FILE" | "ATTACHMENT" | "ATTACHMENT_ID" | "ASPECT_ID" | "ASPECT_RECORD" | "ASPECT_RECORD_ID" | "ASPECT_FIELD_ID" | "FILTER" | "OBJECT" | "JSON" | "PICKLIST" | "PICKLIST_ID" | "MULTI_PICKLIST" | "MULTI_PICKLIST_ID" | "RELATION" | "SEARCH_TABLE_ID" | "TABLE_ID" | "TABLE_RECORD" | "VARIABLE" | "RICH_TEXT" | "AI_SEARCH_TABLE_RECORD";
10
+ /**
11
+ * Map from user-friendly type names (used in the SDK's onDemand input
12
+ * schema) to the platform's WorkflowFieldType value.
13
+ *
14
+ * `attachmentId` is the odd one out: `elementum_on_demand_trigger`'s own
15
+ * `parameters[].type` terraform attribute (on_demand_trigger_resource.go)
16
+ * only validates a bare "attachment" - there is no "attachment_id" spelling
17
+ * at that layer, unlike every other row here where the wire string is just
18
+ * the WorkflowFieldType name lowercased. automation/to-tf.ts special-cases
19
+ * ATTACHMENT_ID -> "attachment" (and from-tf.ts the inverse) rather than
20
+ * renaming this alias, to avoid a breaking change to authored `onDemand({})`
21
+ * calls that already use `type: "attachmentId"`.
22
+ */
23
+ export declare const FIELD_TYPE_MAP: {
24
+ readonly text: "TEXT";
25
+ readonly number: "NUMBER";
26
+ readonly decimal: "DECIMAL";
27
+ readonly boolean: "BOOLEAN";
28
+ readonly date: "DATE";
29
+ readonly datetime: "DATETIME";
30
+ readonly user: "USER";
31
+ readonly json: "JSON";
32
+ readonly object: "OBJECT";
33
+ readonly attachmentId: "ATTACHMENT_ID";
34
+ };
35
+ export type FieldTypeAlias = keyof typeof FIELD_TYPE_MAP;
36
+ /**
37
+ * Subset of {@link FieldTypeAlias} that Mobius's `onDemand` trigger
38
+ * validator accepts. Mobius rejects `WorkflowFieldType.USER` and
39
+ * `WorkflowFieldType.GROUP` (and other `*_ID` types) on trigger params:
40
+ *
41
+ * parameter[submitter]: Parameter type USER is not valid for this trigger.
42
+ *
43
+ * We model the restriction at the type level so `onDemand({ x: { type: "user" } })`
44
+ * is a compile-time error, not a deploy-time 400. When Mobius widens the
45
+ * accepted set, add the alias back here and the full enum will open up
46
+ * for authors.
47
+ */
48
+ export type TriggerFieldTypeAlias = Exclude<FieldTypeAlias, "user">;
49
+ /**
50
+ * Maps a user-friendly FieldTypeAlias to the TypeScript type it represents.
51
+ * Used to derive the phantom T in Ref<T> for trigger inputs.
52
+ */
53
+ /**
54
+ * Maps GraphQL __typename values for aspect fields to WorkflowFieldType.
55
+ * Used when generating app definitions from Hydra's field metadata.
56
+ */
57
+ export declare const ASPECT_FIELD_TYPE_NAME_TO_WORKFLOW_FIELD_TYPE: Record<string, WorkflowFieldType>;
58
+ export type FieldTypeToTS<A extends FieldTypeAlias> = A extends "text" ? string : A extends "number" | "decimal" ? number : A extends "boolean" ? boolean : A extends "date" | "datetime" ? string : A extends "user" ? string : A extends "attachmentId" ? string : A extends "json" | "object" ? unknown : unknown;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * WorkflowFieldType — mirrors the Java enum in
3
+ * jarvis/util/.../WorkflowFieldType.java
4
+ *
5
+ * Only the subset relevant to on-demand trigger inputs and task
6
+ * configurations is surfaced here. The full enum is listed for
7
+ * forward-compatibility; uncommon types are commented.
8
+ */
9
+ /**
10
+ * Map from user-friendly type names (used in the SDK's onDemand input
11
+ * schema) to the platform's WorkflowFieldType value.
12
+ *
13
+ * `attachmentId` is the odd one out: `elementum_on_demand_trigger`'s own
14
+ * `parameters[].type` terraform attribute (on_demand_trigger_resource.go)
15
+ * only validates a bare "attachment" - there is no "attachment_id" spelling
16
+ * at that layer, unlike every other row here where the wire string is just
17
+ * the WorkflowFieldType name lowercased. automation/to-tf.ts special-cases
18
+ * ATTACHMENT_ID -> "attachment" (and from-tf.ts the inverse) rather than
19
+ * renaming this alias, to avoid a breaking change to authored `onDemand({})`
20
+ * calls that already use `type: "attachmentId"`.
21
+ */
22
+ export const FIELD_TYPE_MAP = {
23
+ text: "TEXT",
24
+ number: "NUMBER",
25
+ decimal: "DECIMAL",
26
+ boolean: "BOOLEAN",
27
+ date: "DATE",
28
+ datetime: "DATETIME",
29
+ user: "USER",
30
+ json: "JSON",
31
+ object: "OBJECT",
32
+ attachmentId: "ATTACHMENT_ID",
33
+ };
34
+ /**
35
+ * Maps a user-friendly FieldTypeAlias to the TypeScript type it represents.
36
+ * Used to derive the phantom T in Ref<T> for trigger inputs.
37
+ */
38
+ /**
39
+ * Maps GraphQL __typename values for aspect fields to WorkflowFieldType.
40
+ * Used when generating app definitions from Hydra's field metadata.
41
+ */
42
+ export const ASPECT_FIELD_TYPE_NAME_TO_WORKFLOW_FIELD_TYPE = {
43
+ AspectTextField: "TEXT",
44
+ AspectHandleField: "HANDLE",
45
+ AspectHtmlField: "HTML",
46
+ AspectNumberField: "NUMBER",
47
+ AspectDecimalField: "DECIMAL",
48
+ AspectBooleanField: "BOOLEAN",
49
+ AspectDateField: "DATE",
50
+ AspectDateTimeField: "DATETIME",
51
+ AspectUserField: "USER_ID",
52
+ AspectGroupField: "GROUP_ID",
53
+ AspectAttachmentField: "ATTACHMENT_ID",
54
+ AspectJsonField: "TEXT",
55
+ AspectPicklistField: "PICKLIST",
56
+ AspectMultiPicklistField: "MULTI_PICKLIST",
57
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Platform field-value shapes — used as record / task-output types so
3
+ * `DeepRef` exposes the sub-properties the Elementum platform resolves at
4
+ * runtime (e.g. `ctx.trigger.record.owner.email` → ref name `user.email`).
5
+ *
6
+ * These are value types, not deployable entity kinds. Org `user`/`group`
7
+ * modules are data lookups for org.ts; these interfaces describe USER/GROUP
8
+ * (etc.) *field values* on records.
9
+ */
10
+ export interface Manager {
11
+ readonly name: string;
12
+ readonly email: string;
13
+ }
14
+ export interface Employee {
15
+ readonly manager: Manager;
16
+ }
17
+ export interface User {
18
+ readonly id: string;
19
+ readonly name: string;
20
+ readonly email: string;
21
+ readonly employee: Employee;
22
+ }
23
+ export interface Group {
24
+ readonly id: string;
25
+ readonly name: string;
26
+ }
27
+ export interface Attachment {
28
+ readonly id: string;
29
+ readonly name: string;
30
+ readonly description: string;
31
+ readonly mediaType: string;
32
+ readonly url: string;
33
+ }
34
+ /**
35
+ * A rich-text value. The platform exposes both `plainText` (stripped) and
36
+ * `html` (the rendered HTML) sub-properties on rich-text references.
37
+ */
38
+ export interface RichText {
39
+ readonly plainText: string;
40
+ readonly html: string;
41
+ }
42
+ /** A selected picklist option. `MULTI_PICKLIST` fields expose an array of these. */
43
+ export interface PicklistValue {
44
+ readonly id: string;
45
+ readonly label: string;
46
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Platform field-value shapes — used as record / task-output types so
3
+ * `DeepRef` exposes the sub-properties the Elementum platform resolves at
4
+ * runtime (e.g. `ctx.trigger.record.owner.email` → ref name `user.email`).
5
+ *
6
+ * These are value types, not deployable entity kinds. Org `user`/`group`
7
+ * modules are data lookups for org.ts; these interfaces describe USER/GROUP
8
+ * (etc.) *field values* on records.
9
+ */
10
+ export {};