@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,55 @@
1
+ /**
2
+ * Field emission: one authored custom field → one `elementum_*_field`
3
+ * resource block, in ei's dialect. The owning aspect's to-tf drives the
4
+ * field pass (system-tagged fields fold into the OWNER's attributes and
5
+ * never reach here) and supplies the `object_id` back-reference — this
6
+ * module never names the owner's resource type.
7
+ *
8
+ * Unsupported authoring shapes degrade through `diagnostics` — reported,
9
+ * never silent, never thrown (plan §4.3). The one hard error is a
10
+ * non-canonical bag key: it has no well-defined terraform address.
11
+ */
12
+ import { type TfBlock, type TfExpr, type TfValue } from "../../engine/tf/index.js";
13
+ import { type PicklistValueWire } from "./options.js";
14
+ /** The authored field shape (post-`slimTokens` compose body). Deliberately loose — degrade, don't assert. */
15
+ export interface FieldInnerWire {
16
+ readonly name?: string;
17
+ readonly __refName?: string;
18
+ readonly columnName?: string;
19
+ readonly required?: boolean;
20
+ readonly requiredOnClose?: boolean;
21
+ readonly showOnCreate?: boolean;
22
+ readonly lockOnCreate?: boolean;
23
+ readonly description?: string;
24
+ readonly defaultValue?: unknown;
25
+ readonly tags?: readonly string[];
26
+ readonly picklistValues?: readonly PicklistValueWire[];
27
+ readonly config?: unknown;
28
+ readonly format?: unknown;
29
+ readonly calculation?: unknown;
30
+ }
31
+ export interface FieldToTfOptions {
32
+ /** The owner's id reference, e.g. `elementum_app.<ns>.id` — computed by the owner's to-tf. */
33
+ readonly objectId: TfValue;
34
+ /** Degradations land here — reported by the caller, never silent. */
35
+ readonly diagnostics: string[];
36
+ }
37
+ export interface FieldToTfResult {
38
+ readonly block: TfBlock;
39
+ /** The authoring bag key (= the tfLabel's bijective image). */
40
+ readonly bagKey: string;
41
+ /** `<resourceType>.<tfLabel>` — locals/build-vs-export bookkeeping. */
42
+ readonly address: string;
43
+ }
44
+ /** One custom field → its resource block; undefined = degraded (diagnostic already pushed). */
45
+ export declare function fieldToTf(typeKey: string, inner: FieldInnerWire, opts: FieldToTfOptions): FieldToTfResult | undefined;
46
+ /**
47
+ * A custom field reference `{fieldType, refName}` (the shape a `FieldRef`
48
+ * token slims to) → `<resourceType>.<tfLabel>.id` — shared by anything that
49
+ * NAMES a field by typed ref rather than owning it directly (agent-tool
50
+ * fields, view layout/list-view field refs). Undefined when the authoring
51
+ * type has no terraform mapping or the bag key isn't canonical; callers own
52
+ * the diagnostic wording since the two failure cases usually read
53
+ * differently at each call site.
54
+ */
55
+ export declare function fieldRefToTfValue(fieldType: string, refName: string): TfExpr | undefined;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Field emission: one authored custom field → one `elementum_*_field`
3
+ * resource block, in ei's dialect. The owning aspect's to-tf drives the
4
+ * field pass (system-tagged fields fold into the OWNER's attributes and
5
+ * never reach here) and supplies the `object_id` back-reference — this
6
+ * module never names the owner's resource type.
7
+ *
8
+ * Unsupported authoring shapes degrade through `diagnostics` — reported,
9
+ * never silent, never thrown (plan §4.3). The one hard error is a
10
+ * non-canonical bag key: it has no well-defined terraform address.
11
+ */
12
+ import { EntityTfError } from "../../engine/entity.js";
13
+ import { expr, isCanonicalTsLabel, snakeSlug, tsLabelToTfLabel } from "../../engine/tf/index.js";
14
+ import { picklistLabel } from "./options.js";
15
+ import { SUB_TYPE_BY_AUTHORING_TYPE, SUB_TYPE_BY_TYPE_KEY } from "./types.js";
16
+ /** One custom field → its resource block; undefined = degraded (diagnostic already pushed). */
17
+ export function fieldToTf(typeKey, inner, opts) {
18
+ const { objectId, diagnostics } = opts;
19
+ const name = inner.name ?? "";
20
+ if (typeKey === "calculated" || inner.calculation !== undefined) {
21
+ diagnostics.push(`field "${name}": calculated fields are not supported on the terraform path yet; dropped`);
22
+ return undefined;
23
+ }
24
+ if (inner.config !== undefined) {
25
+ diagnostics.push(`field "${name}": dependent/dynamic picklist config is not supported by the terraform provider yet; dropped`);
26
+ return undefined;
27
+ }
28
+ const subType = SUB_TYPE_BY_TYPE_KEY.get(typeKey);
29
+ if (subType === undefined) {
30
+ diagnostics.push(`field "${name}": field type key "${typeKey}" has no terraform field resource mapping; dropped`);
31
+ return undefined;
32
+ }
33
+ if (inner.format !== undefined) {
34
+ diagnostics.push(`field "${name}": numeric/QR format is not supported on the terraform path yet; dropped`);
35
+ }
36
+ const bagKey = inner.__refName ?? snakeSlug(name);
37
+ // The bag key IS the field's terraform label (via the bijection — the
38
+ // stable naming contract, Sean 2026-07-22). Non-canonical keys have no
39
+ // well-defined address: hard error, not a degradation.
40
+ if (!isCanonicalTsLabel(bagKey)) {
41
+ throw new EntityTfError(`field bag key "${bagKey}" is not a canonical tsLabel (see src/engine/tf/labels.ts) — rename the key in fields: {}`);
42
+ }
43
+ const tfLabel = tsLabelToTfLabel(bagKey);
44
+ const attrs = {
45
+ object_id: objectId,
46
+ name,
47
+ };
48
+ // Always emitted, mirroring ei's exporter (hcl_app.go): these four are
49
+ // Optional+Computed with NO schema Default in the frozen provider, so an
50
+ // omitted attr plans as unknown instead of preserving the stored false.
51
+ // Authoring keeps them optional — absent means false.
52
+ attrs["required"] = inner.required ?? false;
53
+ attrs["required_on_close"] = inner.requiredOnClose ?? false;
54
+ attrs["show_on_create"] = inner.showOnCreate ?? false;
55
+ attrs["lock_on_create"] = inner.lockOnCreate ?? false;
56
+ if (inner.description !== undefined)
57
+ attrs["description"] = inner.description;
58
+ if (inner.columnName !== undefined)
59
+ attrs["column_name"] = inner.columnName;
60
+ if (inner.defaultValue !== undefined) {
61
+ const rendered = scalarOrUndefined(inner.defaultValue);
62
+ if (rendered === undefined) {
63
+ diagnostics.push(`field "${name}": default value has an unsupported (non-scalar) shape; dropped`);
64
+ }
65
+ else {
66
+ attrs["default_value"] = rendered;
67
+ }
68
+ }
69
+ if (subType.hasOptions === true && inner.picklistValues !== undefined) {
70
+ if (inner.picklistValues.some((pv) => pv.relatedParentValues !== undefined)) {
71
+ diagnostics.push(`field "${name}": dependent option links (parentValues) are not supported by the terraform provider yet; dropped`);
72
+ }
73
+ if (inner.picklistValues.length > 0) {
74
+ attrs["options"] = inner.picklistValues.map((pv) => ({ label: picklistLabel(pv) }));
75
+ }
76
+ }
77
+ const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
78
+ return { block, bagKey, address: `${subType.resourceType}.${tfLabel}` };
79
+ }
80
+ function scalarOrUndefined(v) {
81
+ return typeof v === "string" || typeof v === "number" || typeof v === "boolean" ? v : undefined;
82
+ }
83
+ /**
84
+ * A custom field reference `{fieldType, refName}` (the shape a `FieldRef`
85
+ * token slims to) → `<resourceType>.<tfLabel>.id` — shared by anything that
86
+ * NAMES a field by typed ref rather than owning it directly (agent-tool
87
+ * fields, view layout/list-view field refs). Undefined when the authoring
88
+ * type has no terraform mapping or the bag key isn't canonical; callers own
89
+ * the diagnostic wording since the two failure cases usually read
90
+ * differently at each call site.
91
+ */
92
+ export function fieldRefToTfValue(fieldType, refName) {
93
+ const subType = SUB_TYPE_BY_AUTHORING_TYPE.get(fieldType);
94
+ if (subType === undefined || !isCanonicalTsLabel(refName))
95
+ return undefined;
96
+ return expr.resourceAttr(subType.resourceType, tsLabelToTfLabel(refName), ["id"]);
97
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The field entity's sub-type table. Fields are a real sub-entity — 13
3
+ * terraform resource types sharing one emission/extraction shape — so the
4
+ * per-sub-type knowledge is one ROW here, not one file: the only thing that
5
+ * varies between an html field and a number field is this mapping triple.
6
+ * A sub-type that grows real per-kind logic graduates to its own file under
7
+ * this directory (the automation task/ pattern).
8
+ */
9
+ /** One field sub-type: the authoring variant key ↔ resource type ↔ normalized type triple. */
10
+ export interface FieldSubType {
11
+ /** `AspectFieldInput` variant key — the key under `fields: {}` entries ("html"). */
12
+ readonly typeKey: string;
13
+ /** Terraform resource type ("elementum_longtext_field"). */
14
+ readonly resourceType: string;
15
+ /** Canonical authoring field type on the normalized shape ("HTML"). */
16
+ readonly authoringType: string;
17
+ /** Carries an `options` attribute (the picklist kinds). */
18
+ readonly hasOptions?: true;
19
+ }
20
+ export declare const FIELD_SUB_TYPES: readonly FieldSubType[];
21
+ export declare const SUB_TYPE_BY_TYPE_KEY: ReadonlyMap<string, FieldSubType>;
22
+ export declare const SUB_TYPE_BY_RESOURCE: ReadonlyMap<string, FieldSubType>;
23
+ /** Keyed by the canonical authoring type (e.g. "TEXT") — what a `FieldRef` token carries as `fieldType`. */
24
+ export declare const SUB_TYPE_BY_AUTHORING_TYPE: ReadonlyMap<string, FieldSubType>;
25
+ export declare const FIELD_RESOURCE_TYPES: readonly string[];
26
+ /** Attributes `fieldFromTf` understands — anything else is dialect growth, reported loudly. */
27
+ export declare const KNOWN_FIELD_ATTRS: ReadonlySet<string>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The field entity's sub-type table. Fields are a real sub-entity — 13
3
+ * terraform resource types sharing one emission/extraction shape — so the
4
+ * per-sub-type knowledge is one ROW here, not one file: the only thing that
5
+ * varies between an html field and a number field is this mapping triple.
6
+ * A sub-type that grows real per-kind logic graduates to its own file under
7
+ * this directory (the automation task/ pattern).
8
+ */
9
+ export const FIELD_SUB_TYPES = [
10
+ { typeKey: "text", resourceType: "elementum_text_field", authoringType: "TEXT" },
11
+ { typeKey: "html", resourceType: "elementum_longtext_field", authoringType: "HTML" },
12
+ { typeKey: "number", resourceType: "elementum_number_field", authoringType: "NUMBER" },
13
+ { typeKey: "decimal", resourceType: "elementum_decimal_field", authoringType: "DECIMAL" },
14
+ { typeKey: "bool", resourceType: "elementum_boolean_field", authoringType: "BOOLEAN" },
15
+ { typeKey: "date", resourceType: "elementum_date_field", authoringType: "DATE" },
16
+ { typeKey: "dateTime", resourceType: "elementum_datetime_field", authoringType: "DATETIME" },
17
+ { typeKey: "user", resourceType: "elementum_user_field", authoringType: "USER" },
18
+ { typeKey: "group", resourceType: "elementum_group_field", authoringType: "GROUP" },
19
+ { typeKey: "attachment", resourceType: "elementum_attachment_field", authoringType: "ATTACHMENT" },
20
+ { typeKey: "json", resourceType: "elementum_json_field", authoringType: "JSON" },
21
+ { typeKey: "picklist", resourceType: "elementum_dropdown_field", authoringType: "PICKLIST", hasOptions: true },
22
+ {
23
+ typeKey: "multiPicklist",
24
+ resourceType: "elementum_multiselect_field",
25
+ authoringType: "MULTI_PICKLIST",
26
+ hasOptions: true,
27
+ },
28
+ ];
29
+ export const SUB_TYPE_BY_TYPE_KEY = new Map(FIELD_SUB_TYPES.map((t) => [t.typeKey, t]));
30
+ export const SUB_TYPE_BY_RESOURCE = new Map(FIELD_SUB_TYPES.map((t) => [t.resourceType, t]));
31
+ /** Keyed by the canonical authoring type (e.g. "TEXT") — what a `FieldRef` token carries as `fieldType`. */
32
+ export const SUB_TYPE_BY_AUTHORING_TYPE = new Map(FIELD_SUB_TYPES.map((t) => [t.authoringType, t]));
33
+ export const FIELD_RESOURCE_TYPES = FIELD_SUB_TYPES.map((t) => t.resourceType);
34
+ /** Attributes `fieldFromTf` understands — anything else is dialect growth, reported loudly. */
35
+ export const KNOWN_FIELD_ATTRS = new Set([
36
+ "object_id",
37
+ "name",
38
+ "required",
39
+ "required_on_close",
40
+ "show_on_create",
41
+ "lock_on_create",
42
+ "description",
43
+ "column_name",
44
+ "default_value",
45
+ "options",
46
+ ]);
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Document model authoring. Unlike every other entity in this SDK, create and
3
+ * update go straight through the tenant graph (`elementum-entity-client/clients/document-models/`)
4
+ * — antman has no REST endpoint for this entity at all.
5
+ *
6
+ * The platform models six variants (AI extraction, Excel, an Excel-cell
7
+ * variant, invoice, JSON, OCR, XML) behind one `documentModelCreate`/
8
+ * `documentModelUpdate` mutation pair, each populating exactly one input
9
+ * slot. `DocumentModelOptions` mirrors that as a discriminated union on
10
+ * `type`. Excel-cell has no update path on the graph for its own fields
11
+ * (only `name` can change) — `wire-client.ts`'s update dispatch throws for
12
+ * that variant if anything beyond `name` changed.
13
+ */
14
+ import type { FileReaderCatalogRef } from "../../catalog/index.js";
15
+ import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
16
+ import type { FileReaderCreateInput, FileReaderUpdateInput, InvoiceFieldLabel } from "../../../elementum-entity-client/clients/document-models/models/document-model.js";
17
+ /**
18
+ * A field in a JSON/XML document model's structure tree. `object`/`array`
19
+ * nest recursively, mirroring the graph's `DocumentModelJsonStructureInput`.
20
+ */
21
+ export type JsonStructureField = {
22
+ readonly type: "text";
23
+ readonly name: string;
24
+ } | {
25
+ readonly type: "number";
26
+ readonly name: string;
27
+ } | {
28
+ readonly type: "decimal";
29
+ readonly name: string;
30
+ } | {
31
+ readonly type: "boolean";
32
+ readonly name: string;
33
+ } | {
34
+ readonly type: "date";
35
+ readonly name: string;
36
+ readonly format: string;
37
+ } | {
38
+ readonly type: "datetime";
39
+ readonly name: string;
40
+ readonly format: string;
41
+ } | {
42
+ readonly type: "object";
43
+ readonly name: string;
44
+ readonly properties: readonly JsonStructureField[];
45
+ } | {
46
+ readonly type: "array";
47
+ readonly name: string;
48
+ readonly itemType: JsonStructureField;
49
+ };
50
+ /** An AI-extraction field definition. */
51
+ export interface FileReaderAiField {
52
+ readonly name: string;
53
+ readonly description: string;
54
+ readonly required: boolean;
55
+ readonly type: string;
56
+ }
57
+ /** Where in the spreadsheet an Excel field's value lives. */
58
+ export interface ExcelCellLocation {
59
+ readonly sheet: number;
60
+ readonly row: number;
61
+ readonly column: number;
62
+ }
63
+ /** An Excel/Excel-cell field mapping. */
64
+ export interface FileReaderExcelField {
65
+ readonly name?: string;
66
+ readonly fieldType: string;
67
+ readonly required: boolean;
68
+ readonly include: boolean;
69
+ readonly location?: ExcelCellLocation;
70
+ }
71
+ interface FileReaderOptionsBase extends EntityDeployOptions {
72
+ readonly parent: string;
73
+ readonly name: string;
74
+ }
75
+ export interface FileReaderAiOptions extends FileReaderOptionsBase {
76
+ readonly type: "ai";
77
+ readonly instructions: string;
78
+ readonly fields: readonly FileReaderAiField[];
79
+ }
80
+ export interface FileReaderExcelOptions extends FileReaderOptionsBase {
81
+ readonly type: "excel";
82
+ readonly documentId: string;
83
+ readonly firstRowIsHeader: boolean;
84
+ readonly fields: readonly FileReaderExcelField[];
85
+ }
86
+ export interface FileReaderExcelCellOptions extends FileReaderOptionsBase {
87
+ readonly type: "excelCell";
88
+ readonly documentId: string;
89
+ readonly fields: readonly FileReaderExcelField[];
90
+ }
91
+ export interface FileReaderInvoiceOptions extends FileReaderOptionsBase {
92
+ readonly type: "invoice";
93
+ readonly fields: readonly InvoiceFieldLabel[];
94
+ }
95
+ export interface FileReaderJsonOptions extends FileReaderOptionsBase {
96
+ readonly type: "json";
97
+ readonly structure: readonly JsonStructureField[];
98
+ }
99
+ export interface FileReaderOcrOptions extends FileReaderOptionsBase {
100
+ readonly type: "ocr";
101
+ }
102
+ export interface FileReaderXmlOptions extends FileReaderOptionsBase {
103
+ readonly type: "xml";
104
+ readonly structure: readonly JsonStructureField[];
105
+ }
106
+ export type FileReaderOptions = FileReaderAiOptions | FileReaderExcelOptions | FileReaderExcelCellOptions | FileReaderInvoiceOptions | FileReaderJsonOptions | FileReaderOcrOptions | FileReaderXmlOptions;
107
+ /** The authored shape stored as `DeployableEntity.payload` — `DocumentModelOptions` minus the deploy-only `parent`/`enabled`. */
108
+ export type FileReaderPayload = Omit<FileReaderAiOptions, "parent" | "enabled"> | Omit<FileReaderExcelOptions, "parent" | "enabled"> | Omit<FileReaderExcelCellOptions, "parent" | "enabled"> | Omit<FileReaderInvoiceOptions, "parent" | "enabled"> | Omit<FileReaderJsonOptions, "parent" | "enabled"> | Omit<FileReaderOcrOptions, "parent" | "enabled"> | Omit<FileReaderXmlOptions, "parent" | "enabled">;
109
+ /** Build the `documentModelCreate` mutation input from a document model's authored payload. */
110
+ export declare function fileReaderCreateBody(opts: FileReaderPayload): FileReaderCreateInput;
111
+ /**
112
+ * Build the `documentModelUpdate` mutation input. `excelCell` has no update
113
+ * path on the graph for its own content — only `name` — so
114
+ * `isDocumentModelUpdateSupported` (`src/deploy/plan/plan.ts`) routes any
115
+ * other excelCell change to `update-unsupported` before this is ever called
116
+ * with excelCell content changes.
117
+ */
118
+ export declare function fileReaderUpdateBody(opts: FileReaderPayload): FileReaderUpdateInput;
119
+ export interface FileReaderConfigured {
120
+ ref(refName: string): FileReaderCatalogRef;
121
+ def(refName: string): DeployableEntity;
122
+ }
123
+ export declare function defineFileReader(opts: FileReaderOptions): FileReaderConfigured;
124
+ export {};
@@ -0,0 +1,105 @@
1
+ function serializeJsonStructureField(f) {
2
+ switch (f.type) {
3
+ case "text":
4
+ return { text: { name: f.name } };
5
+ case "number":
6
+ return { number: { name: f.name } };
7
+ case "decimal":
8
+ return { decimal: { name: f.name } };
9
+ case "boolean":
10
+ return { bool: { name: f.name } };
11
+ case "date":
12
+ return { date: { name: f.name, format: f.format } };
13
+ case "datetime":
14
+ return { datetime: { name: f.name, format: f.format } };
15
+ case "object":
16
+ return { object: { name: f.name, properties: f.properties.map(serializeJsonStructureField) } };
17
+ case "array":
18
+ return { array: { name: f.name, arrayType: serializeJsonStructureField(f.itemType) } };
19
+ }
20
+ }
21
+ function serializeJsonStructure(fields) {
22
+ return { properties: fields.map(serializeJsonStructureField) };
23
+ }
24
+ function serializeAiFields(fields) {
25
+ return fields.map((f) => ({ name: f.name, description: f.description, required: f.required, type: f.type }));
26
+ }
27
+ function serializeExcelFields(fields) {
28
+ return fields.map((f) => ({
29
+ fieldType: f.fieldType,
30
+ required: f.required,
31
+ include: f.include,
32
+ ...(f.name !== undefined ? { name: f.name } : {}),
33
+ ...(f.location !== undefined ? { location: f.location } : {}),
34
+ }));
35
+ }
36
+ /** Build the `documentModelCreate` mutation input from a document model's authored payload. */
37
+ export function fileReaderCreateBody(opts) {
38
+ switch (opts.type) {
39
+ case "ai":
40
+ return { ai: { name: opts.name, instructions: opts.instructions, fields: serializeAiFields(opts.fields) } };
41
+ case "excel":
42
+ return {
43
+ excel: {
44
+ name: opts.name,
45
+ documentId: opts.documentId,
46
+ firstRowIsHeader: opts.firstRowIsHeader,
47
+ fields: serializeExcelFields(opts.fields),
48
+ },
49
+ };
50
+ case "excelCell":
51
+ return {
52
+ excelCell: { name: opts.name, documentId: opts.documentId, fields: serializeExcelFields(opts.fields) },
53
+ };
54
+ case "invoice":
55
+ return { invoice: { name: opts.name, fields: opts.fields } };
56
+ case "json":
57
+ return { json: { name: opts.name, jsonStructure: serializeJsonStructure(opts.structure) } };
58
+ case "ocr":
59
+ return { ocr: { name: opts.name } };
60
+ case "xml":
61
+ return { xml: { name: opts.name, values: serializeJsonStructure(opts.structure) } };
62
+ }
63
+ }
64
+ /**
65
+ * Build the `documentModelUpdate` mutation input. `excelCell` has no update
66
+ * path on the graph for its own content — only `name` — so
67
+ * `isDocumentModelUpdateSupported` (`src/deploy/plan/plan.ts`) routes any
68
+ * other excelCell change to `update-unsupported` before this is ever called
69
+ * with excelCell content changes.
70
+ */
71
+ export function fileReaderUpdateBody(opts) {
72
+ switch (opts.type) {
73
+ case "ai":
74
+ return { name: opts.name, ai: { name: opts.name, instructions: opts.instructions, fields: serializeAiFields(opts.fields) } };
75
+ case "excel":
76
+ return { name: opts.name, excelFields: serializeExcelFields(opts.fields) };
77
+ case "excelCell":
78
+ return { name: opts.name };
79
+ case "invoice":
80
+ return { name: opts.name, invoiceFields: opts.fields };
81
+ case "json":
82
+ return { name: opts.name, jsonStructure: serializeJsonStructure(opts.structure) };
83
+ case "ocr":
84
+ return { name: opts.name };
85
+ case "xml":
86
+ return { name: opts.name, xml: { name: opts.name, values: serializeJsonStructure(opts.structure) } };
87
+ }
88
+ }
89
+ export function defineFileReader(opts) {
90
+ return {
91
+ ref(refName) {
92
+ return { __kind: "documentModel", refName, name: opts.name, parent: opts.parent };
93
+ },
94
+ def(refName) {
95
+ const { parent, enabled, ...payload } = opts;
96
+ return {
97
+ kind: "documentModel",
98
+ parent,
99
+ refName,
100
+ payload,
101
+ ...(enabled !== undefined ? { enabled } : {}),
102
+ };
103
+ },
104
+ };
105
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Document model authoring — create/edit AI, Excel, Excel-cell, invoice,
3
+ * JSON, OCR, and XML document models.
4
+ */
5
+ export { defineFileReader, fileReaderCreateBody, fileReaderUpdateBody, type FileReaderAiField, type FileReaderAiOptions, type FileReaderConfigured, type FileReaderExcelCellOptions, type FileReaderExcelField, type FileReaderExcelOptions, type FileReaderInvoiceOptions, type FileReaderJsonOptions, type FileReaderOcrOptions, type FileReaderOptions, type FileReaderPayload, type FileReaderXmlOptions, type ExcelCellLocation, type JsonStructureField, } from "./build.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Document model authoring — create/edit AI, Excel, Excel-cell, invoice,
3
+ * JSON, OCR, and XML document models.
4
+ */
5
+ export { defineFileReader, fileReaderCreateBody, fileReaderUpdateBody, } from "./build.js";
@@ -0,0 +1,15 @@
1
+ import type { AgentRef } from "../../../catalog/index.js";
2
+ import type { FlowInputRefV2 } from "./input-refs.js";
3
+ import { type PromptTemplate } from "./prompt-template.js";
4
+ import type { FlowActivityDefV2 } from "./types.js";
5
+ export interface AgentActivityConfig {
6
+ /** The agent that handles this step (resolved to an id at deploy). */
7
+ readonly agent: AgentRef;
8
+ /** Display name for this activity in the flow. */
9
+ readonly name: string;
10
+ /** Input mapping passed to the agent as conversation context. */
11
+ readonly inputs?: Record<string, FlowInputRefV2>;
12
+ /** Initial user message — a plain string or a `promptTemplate(...)`. */
13
+ readonly prompt?: string | PromptTemplate;
14
+ }
15
+ export declare function agentActivity(config: AgentActivityConfig): FlowActivityDefV2;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * agentActivity — an AGENT step in a v2 flow. References an agent by token;
3
+ * optional `inputs` (passed to the agent as context) and `prompt` (initial user
4
+ * message) serialize into `configuration`.
5
+ */
6
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
7
+ import { isPromptTemplate, literalPrompt, validatePromptSegments, } from "./prompt-template.js";
8
+ export function agentActivity(config) {
9
+ if (!config.name || config.name.trim() === "") {
10
+ throw new EdkValidationError("agentActivity requires a non-empty name.");
11
+ }
12
+ const configuration = {};
13
+ if (config.inputs && Object.keys(config.inputs).length > 0)
14
+ configuration.inputs = config.inputs;
15
+ if (config.prompt != null) {
16
+ const prompt = typeof config.prompt === "string" ? literalPrompt(config.prompt) : config.prompt;
17
+ if (!isPromptTemplate(prompt)) {
18
+ throw new EdkValidationError(`agentActivity "${config.name}": prompt must be a string or promptTemplate(...).`);
19
+ }
20
+ validatePromptSegments(prompt.segments);
21
+ configuration.prompt = prompt;
22
+ }
23
+ return {
24
+ activityType: "AGENT",
25
+ name: config.name,
26
+ reference: config.agent,
27
+ ...(Object.keys(configuration).length > 0 ? { configuration } : {}),
28
+ };
29
+ }
@@ -0,0 +1,9 @@
1
+ import type { ApprovalChainRef } from "../../../catalog/index.js";
2
+ import type { FlowActivityDefV2 } from "./types.js";
3
+ export interface ApprovalActivityConfig {
4
+ /** The approval chain that gates this step (resolved to an id at deploy). */
5
+ readonly approvalChain: ApprovalChainRef;
6
+ /** Display name for this activity in the flow. */
7
+ readonly name: string;
8
+ }
9
+ export declare function approvalActivity(config: ApprovalActivityConfig): FlowActivityDefV2;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * approvalActivity — a HUMAN/APPROVAL step in a v2 flow. Pauses the flow until
3
+ * the referenced approval chain completes. The chain (referenced by token,
4
+ * resolved to an id at deploy) defines the approver set; no `configuration` is
5
+ * emitted.
6
+ */
7
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
8
+ export function approvalActivity(config) {
9
+ if (!config.name || config.name.trim() === "") {
10
+ throw new EdkValidationError("approvalActivity requires a non-empty name.");
11
+ }
12
+ return {
13
+ activityType: "HUMAN",
14
+ activitySubType: "APPROVAL",
15
+ name: config.name,
16
+ reference: config.approvalChain,
17
+ };
18
+ }
@@ -0,0 +1,12 @@
1
+ import type { AutomationRef } from "../../../catalog/index.js";
2
+ import type { FlowInputRefV2 } from "./input-refs.js";
3
+ import type { FlowActivityDefV2 } from "./types.js";
4
+ export interface AutomationActivityConfig {
5
+ /** Target automation (resolved to an id at deploy). Must be ACTIVE at run time. */
6
+ readonly automation: AutomationRef;
7
+ /** Display name for this activity in the flow. */
8
+ readonly name: string;
9
+ /** Input mapping keyed by the target automation's trigger parameter names. */
10
+ readonly inputs?: Record<string, FlowInputRefV2>;
11
+ }
12
+ export declare function automationActivity(config: AutomationActivityConfig): FlowActivityDefV2;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * automationActivity — an AUTOMATION step in a v2 flow. References an
3
+ * automation by token; optional `inputs` (the automation's trigger parameters)
4
+ * serialize into `configuration.inputs`.
5
+ *
6
+ * The automation must be ACTIVE for the platform to dispatch it — v2 doesn't
7
+ * carry the automation's status on its token, so this is validated server-side
8
+ * at run time (unlike v1's compile-time `EnsureActiveAutomation`).
9
+ */
10
+ import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
11
+ export function automationActivity(config) {
12
+ if (!config.name || config.name.trim() === "") {
13
+ throw new EdkValidationError("automationActivity requires a non-empty name.");
14
+ }
15
+ const configuration = config.inputs && Object.keys(config.inputs).length > 0 ? { inputs: config.inputs } : undefined;
16
+ return {
17
+ activityType: "AUTOMATION",
18
+ name: config.name,
19
+ reference: config.automation,
20
+ ...(configuration !== undefined ? { configuration } : {}),
21
+ };
22
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The typed context a lazy flow-activity factory receives:
3
+ *
4
+ * .activity("review", (ctx) => agentActivity({
5
+ * agent: app.agents.reviewer,
6
+ * name: "Review",
7
+ * inputs: { summary: ctx.activities.intake.outputs.summary },
8
+ * }))
9
+ *
10
+ * `ctx.activities.<key>.outputs.<name>` produces an `ACTIVITY_OUTPUT` ref to a
11
+ * prior activity; `ctx.literal(v)` a `LITERAL`. Record fields come in as
12
+ * `recordField(app.fields.x)` directly (v2 has no live owner-app proxy — the
13
+ * catalog already gives typed `FieldRef` tokens).
14
+ *
15
+ * This mirrors the agnostic intra-entity ctx pattern that automations-v2 reuses
16
+ * from `core/context`, but keyed to flow activities rather than tasks.
17
+ */
18
+ import { type ActivityOutputRefV2, type LiteralRefV2 } from "./input-refs.js";
19
+ /** The output surface of a single prior activity. */
20
+ export interface FlowActivityOutputProxy {
21
+ /** `outputs.<name>` → an `ACTIVITY_OUTPUT` ref to this activity's named output. */
22
+ readonly outputs: Record<string, ActivityOutputRefV2>;
23
+ }
24
+ /** The typed flow context exposed to lazy activity factories. */
25
+ export interface FlowCtxV2<TActivities extends Record<string, unknown> = Record<string, FlowActivityOutputProxy>> {
26
+ /** Prior activities by key; each exposes `.outputs.<name>`. */
27
+ readonly activities: {
28
+ [K in keyof TActivities]: FlowActivityOutputProxy;
29
+ } & Record<string, FlowActivityOutputProxy>;
30
+ /** A static value baked into the flow. */
31
+ literal(value: string | number | boolean | null): LiteralRefV2;
32
+ }
33
+ /** Build the ctx for a lazy activity factory, given the keys registered so far. */
34
+ export declare function buildFlowCtxV2(priorKeys: readonly string[]): FlowCtxV2;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The typed context a lazy flow-activity factory receives:
3
+ *
4
+ * .activity("review", (ctx) => agentActivity({
5
+ * agent: app.agents.reviewer,
6
+ * name: "Review",
7
+ * inputs: { summary: ctx.activities.intake.outputs.summary },
8
+ * }))
9
+ *
10
+ * `ctx.activities.<key>.outputs.<name>` produces an `ACTIVITY_OUTPUT` ref to a
11
+ * prior activity; `ctx.literal(v)` a `LITERAL`. Record fields come in as
12
+ * `recordField(app.fields.x)` directly (v2 has no live owner-app proxy — the
13
+ * catalog already gives typed `FieldRef` tokens).
14
+ *
15
+ * This mirrors the agnostic intra-entity ctx pattern that automations-v2 reuses
16
+ * from `core/context`, but keyed to flow activities rather than tasks.
17
+ */
18
+ import { activityOutput, literal } from "./input-refs.js";
19
+ function activityOutputProxy(key) {
20
+ return {
21
+ outputs: new Proxy({}, {
22
+ get: (_t, name) => activityOutput(key, String(name)),
23
+ }),
24
+ };
25
+ }
26
+ /** Build the ctx for a lazy activity factory, given the keys registered so far. */
27
+ export function buildFlowCtxV2(priorKeys) {
28
+ const known = new Set(priorKeys);
29
+ const activities = new Proxy({}, {
30
+ get: (_t, key) => {
31
+ const k = String(key);
32
+ // Permissive at runtime; the builder's typed keys drive autocomplete.
33
+ void known;
34
+ return activityOutputProxy(k);
35
+ },
36
+ });
37
+ return { activities, literal };
38
+ }