@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,108 @@
1
+ /**
2
+ * v2 element authoring — `defineElement`.
3
+ *
4
+ * Elements are not apps — they're a dedicated aspect kind with their own
5
+ * builder/printer — but a pulled real-world element proved they carry nearly
6
+ * every authoring slot an app does (category icon/color, namespace,
7
+ * description, cloud options, display blocks). The one genuinely new
8
+ * concept is a **linked** element's cloud mapping: a Cloud Link + Database +
9
+ * Schema + Table pointing at an existing table in the customer's cloud
10
+ * database, vs. a **standard** element (no `cloudConnection`), whose table
11
+ * Elementum manages — a shape `defineApp` has no slot for. Reusing `defineApp`
12
+ * for elements is why that data was silently dropped on pull.
13
+ *
14
+ * Produces a `DeployableEntity` of kind `element` with `parent: "org"` (elements are
15
+ * org-owned, like apps). The payload is the same compose-body shape
16
+ * `defineApp({ type: "ELEMENT" })` produced before this split — fields are
17
+ * authored inline; the cloud link is a `CatalogRef` token resolved at deploy.
18
+ * Deployed via the same wire client compose path apps use.
19
+ *
20
+ * Field/category serialization is genuinely shared with apps (both are
21
+ * "aspects" — see `src/CLAUDE.md`'s glossary), so this imports `serializeField`
22
+ * and its types directly from `src/aspects/build.ts` rather than duplicating
23
+ * them.
24
+ */
25
+ import { type AspectRef, type CloudLinkRef, type FieldRef } from "../../catalog/index.js";
26
+ import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
27
+ import { type DisplayBlock } from "../app/display-blocks.js";
28
+ import { type AppCategory, type AppCloudOptions, type AppField, type AppLayout, type AppListView } from "../app/build.js";
29
+ export type { AppCategory, AppField, AppLayout, AppListView, PicklistOption } from "../app/build.js";
30
+ /**
31
+ * The source table a LINKED element maps to — an existing table in the
32
+ * customer's cloud database, vs. a STANDARD element (no `cloudConnection`),
33
+ * whose table Elementum manages. Real and sent on deploy via the terraform
34
+ * path (`elementum_element`'s `cloud_mapping_snowflake_*` /
35
+ * `snowflake_hybrid_table` / `title_column_name` / `id_column_name`
36
+ * attributes) — applied on create only: an element's table binding is
37
+ * immutable once set.
38
+ */
39
+ export interface ElementCloudConnection {
40
+ readonly database?: string;
41
+ readonly schema?: string;
42
+ readonly table?: string;
43
+ /** `false` creates a standard Snowflake table; omitted/`true` is a hybrid table. */
44
+ readonly hybridTable?: boolean;
45
+ /** The record-title source column on the mapped table. */
46
+ readonly titleColumnName?: string;
47
+ /** The record-id source column on the mapped table. */
48
+ readonly idColumnName?: string;
49
+ }
50
+ export interface ElementV2Options extends EntityDeployOptions {
51
+ /** The platform's aspect handle (business acronym, e.g. "PRD") — distinct from the refName. Omit to let the platform assign one. */
52
+ readonly handle?: string;
53
+ readonly name: string;
54
+ readonly category: AppCategory;
55
+ readonly namespace?: string;
56
+ readonly description?: string;
57
+ readonly icon?: string;
58
+ readonly color?: string;
59
+ /**
60
+ * Cloud link whose data store this element's records persist in (token →
61
+ * id at deploy). Optional — omit it to use the org's default cloud link.
62
+ * Applied on create only: an aspect's cloud link is immutable once created.
63
+ */
64
+ readonly cloudLink?: CloudLinkRef;
65
+ /** Cloud-backing options (Snowflake-only); applied on create only. */
66
+ readonly cloudOptions?: AppCloudOptions;
67
+ /** A LINKED element's table mapping — see {@link ElementCloudConnection}. */
68
+ readonly cloudConnection?: ElementCloudConnection;
69
+ /** Whether the comments display block is enabled. Omit to leave the platform's current value alone. */
70
+ readonly commentsEnabled?: boolean;
71
+ /** Fields keyed by ref name. At least one required by the compose API. */
72
+ readonly fields: Record<string, AppField>;
73
+ /**
74
+ * Platform-managed (system) fields that exist on every element but are not authored here — e.g.
75
+ * ID, Created on. These flow into `ref().fields` so other entities can reference them by typed
76
+ * handle, but are **never included in the deploy payload** (the platform owns them).
77
+ */
78
+ readonly readonlyFields?: Record<string, FieldRef>;
79
+ /** Record-view (LAYOUT surface) display blocks. */
80
+ readonly displayBlocks?: readonly DisplayBlock[];
81
+ /** New-record form (CREATE surface) display blocks. */
82
+ readonly recordCreateDisplayBlocks?: readonly DisplayBlock[];
83
+ /**
84
+ * Per-stage record layouts (terraform-path). Elements rarely carry stages;
85
+ * included for parity with app pull when layouts appear on the stream.
86
+ */
87
+ readonly layouts?: Readonly<Record<string, AppLayout>>;
88
+ /** Saved list views, keyed by view ref name. */
89
+ readonly listViews?: Readonly<Record<string, AppListView>>;
90
+ /** Display order of `listViews` (by key). Defaults to declaration order. */
91
+ readonly viewOrder?: readonly string[];
92
+ }
93
+ /** An element's reference surface: identity plus its fields (the only bag other entities may point at). */
94
+ export type ElementRef = AspectRef & {
95
+ readonly fields: Record<string, FieldRef>;
96
+ };
97
+ /**
98
+ * The configured result of `defineElement` — its reference surface (`ref()`)
99
+ * and its deployable entity (`def()`). Both take `refName` as a **call-time
100
+ * argument**, not a constructor option — see `AppConfigured` in
101
+ * `src/aspects/build.ts` for the full rationale (identical here).
102
+ */
103
+ export interface ElementConfigured {
104
+ ref(refName: string): ElementRef;
105
+ def(refName: string): DeployableEntity;
106
+ }
107
+ /** Build a v2 element entity: org-owned, compose-body payload. Exposes `.ref(refName)` and `.def(refName)`. */
108
+ export declare function defineElement(opts: ElementV2Options): ElementConfigured;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * v2 element authoring — `defineElement`.
3
+ *
4
+ * Elements are not apps — they're a dedicated aspect kind with their own
5
+ * builder/printer — but a pulled real-world element proved they carry nearly
6
+ * every authoring slot an app does (category icon/color, namespace,
7
+ * description, cloud options, display blocks). The one genuinely new
8
+ * concept is a **linked** element's cloud mapping: a Cloud Link + Database +
9
+ * Schema + Table pointing at an existing table in the customer's cloud
10
+ * database, vs. a **standard** element (no `cloudConnection`), whose table
11
+ * Elementum manages — a shape `defineApp` has no slot for. Reusing `defineApp`
12
+ * for elements is why that data was silently dropped on pull.
13
+ *
14
+ * Produces a `DeployableEntity` of kind `element` with `parent: "org"` (elements are
15
+ * org-owned, like apps). The payload is the same compose-body shape
16
+ * `defineApp({ type: "ELEMENT" })` produced before this split — fields are
17
+ * authored inline; the cloud link is a `CatalogRef` token resolved at deploy.
18
+ * Deployed via the same wire client compose path apps use.
19
+ *
20
+ * Field/category serialization is genuinely shared with apps (both are
21
+ * "aspects" — see `src/CLAUDE.md`'s glossary), so this imports `serializeField`
22
+ * and its types directly from `src/aspects/build.ts` rather than duplicating
23
+ * them.
24
+ */
25
+ import { slimTokens } from "../../catalog/index.js";
26
+ import { serializeDisplayBlocks } from "../app/display-blocks.js";
27
+ import { serializeField, } from "../app/build.js";
28
+ /**
29
+ * Client-side validation for `defineElement` — the authoring-time home for
30
+ * element validation rules, so a malformed definition fails at define time
31
+ * rather than as an opaque platform error during apply.
32
+ *
33
+ * - `handle` — letters only (A–Z or a–z), when provided (it's optional).
34
+ * Existing elements can carry a lowercase handle (the platform doesn't
35
+ * enforce case), so this only rejects non-letters, not case.
36
+ * - `namespace` — lowercase letters only (a–z), when provided
37
+ */
38
+ function validateElementOptions(opts) {
39
+ if (opts.handle !== undefined && !/^[A-Za-z]+$/.test(opts.handle)) {
40
+ throw new Error(`defineElement "${opts.name}": handle "${opts.handle}" must be letters only (A–Z or a–z).`);
41
+ }
42
+ if (opts.namespace !== undefined && !/^[a-z]+$/.test(opts.namespace)) {
43
+ throw new Error(`defineElement "${opts.name}": namespace "${opts.namespace}" must be lowercase letters only (a–z).`);
44
+ }
45
+ }
46
+ /** Build a v2 element entity: org-owned, compose-body payload. Exposes `.ref(refName)` and `.def(refName)`. */
47
+ export function defineElement(opts) {
48
+ validateElementOptions(opts);
49
+ const fieldEntries = Object.values(opts.fields);
50
+ if (fieldEntries.length === 0) {
51
+ throw new Error(`defineElement "${opts.name}" requires at least one field.`);
52
+ }
53
+ return {
54
+ ref(refName) {
55
+ // See `defineApp`'s `ref()` for why `handle` here is the bag key —
56
+ // `def()` carries it as `serializeField`'s internal `__refName` marker so
57
+ // `applyV2`'s field reconciliation can match this field by bag key
58
+ // instead of `name`, which would otherwise break on a rename.
59
+ const fields = {};
60
+ for (const [bagKey, field] of Object.entries(opts.fields)) {
61
+ fields[bagKey] = {
62
+ __kind: "field",
63
+ refName: bagKey,
64
+ name: field.name,
65
+ parent: refName,
66
+ fieldType: field.type,
67
+ ...(field.tags !== undefined ? { tags: field.tags } : {}),
68
+ };
69
+ }
70
+ if (opts.readonlyFields !== undefined) {
71
+ for (const [bagKey, ref] of Object.entries(opts.readonlyFields)) {
72
+ fields[bagKey] = { ...ref, refName: bagKey, parent: refName };
73
+ }
74
+ }
75
+ return { __kind: "element", refName: refName, name: opts.name, fields };
76
+ },
77
+ def(refName) {
78
+ const displayBlocks = serializeDisplayBlocks(opts.displayBlocks, "LAYOUT");
79
+ const recordCreateDisplayBlocks = serializeDisplayBlocks(opts.recordCreateDisplayBlocks, "CREATE");
80
+ const payload = {
81
+ name: opts.name,
82
+ ...(opts.description !== undefined ? { description: opts.description } : {}),
83
+ handle: opts.handle, // wire field name is fixed by the compose API contract
84
+ ...(opts.namespace !== undefined ? { namespace: opts.namespace } : {}),
85
+ type: "ELEMENT",
86
+ category: opts.category,
87
+ ...(opts.icon !== undefined ? { icon: opts.icon } : {}),
88
+ ...(opts.color !== undefined ? { color: opts.color } : {}),
89
+ ...(opts.cloudLink !== undefined ? { cloudLinkId: opts.cloudLink } : {}), // token → id at deploy
90
+ ...(opts.cloudOptions !== undefined ? { cloudOptions: opts.cloudOptions } : {}),
91
+ ...(opts.cloudConnection !== undefined ? { cloudConnection: opts.cloudConnection } : {}),
92
+ ...(opts.commentsEnabled !== undefined ? { commentsEnabled: opts.commentsEnabled } : {}),
93
+ fields: Object.entries(opts.fields).map(([bagKey, field]) => serializeField(field, bagKey)),
94
+ ...(displayBlocks !== undefined ? { displayBlocks } : {}),
95
+ ...(recordCreateDisplayBlocks !== undefined ? { recordCreateDisplayBlocks } : {}),
96
+ ...(opts.layouts !== undefined ? { layouts: opts.layouts } : {}),
97
+ ...(opts.listViews !== undefined ? { listViews: opts.listViews } : {}),
98
+ ...(opts.viewOrder !== undefined ? { viewOrder: opts.viewOrder } : {}),
99
+ };
100
+ return {
101
+ kind: "element",
102
+ parent: "org",
103
+ refName,
104
+ payload: slimTokens(payload),
105
+ ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
106
+ };
107
+ },
108
+ };
109
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Element extraction: `elementum_element` + owned field resources → the
3
+ * `NormalizedApp` shape (`type: "ELEMENT"`) that `printElementV2` consumes.
4
+ * Mirrors `app/from-tf.ts` without app-only status/stages dialect.
5
+ */
6
+ import { type FromTfContext } from "../../engine/pull/context.js";
7
+ import { type TfBlock } from "../../engine/tf/index.js";
8
+ import type { NormalizedApp } from "../app/deserializer/normalize.js";
9
+ export interface ElementFromTfResult {
10
+ readonly element: NormalizedApp;
11
+ /** org.ts `cloudLinks` bag key when the element pins one. */
12
+ readonly cloudLinkHandle?: string;
13
+ }
14
+ export interface ElementFromTfViewBlocks {
15
+ readonly layoutBlocks: readonly TfBlock[];
16
+ readonly listViewBlocks: readonly TfBlock[];
17
+ readonly managedViewOrderBlocks: readonly TfBlock[];
18
+ }
19
+ export declare function elementFromTf(elementBlock: TfBlock, fieldBlocks: readonly TfBlock[], ctx: FromTfContext, viewBlocks?: ElementFromTfViewBlocks): ElementFromTfResult;
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Element extraction: `elementum_element` + owned field resources → the
3
+ * `NormalizedApp` shape (`type: "ELEMENT"`) that `printElementV2` consumes.
4
+ * Mirrors `app/from-tf.ts` without app-only status/stages dialect.
5
+ */
6
+ import { EntityTfError } from "../../engine/entity.js";
7
+ import { dataRefLabel, optionalBoolean, optionalString } from "../../engine/pull/context.js";
8
+ import { tfLabelToTsLabel } from "../../engine/tf/index.js";
9
+ import { fieldFromTf } from "../field/from-tf.js";
10
+ import { viewsFromTf } from "../view/from-tf.js";
11
+ import { ELEMENT_RESOURCE_TYPE } from "./module.js";
12
+ /** Attributes `elementFromTf` understands — anything else is dialect growth. */
13
+ const KNOWN_ELEMENT_ATTRS = new Set([
14
+ "name",
15
+ "namespace",
16
+ "handle",
17
+ "description",
18
+ "icon",
19
+ "color",
20
+ "category_id",
21
+ "cloud_link_id",
22
+ "comments_enabled",
23
+ "cloud_mapping_snowflake_database",
24
+ "cloud_mapping_snowflake_schema",
25
+ "cloud_mapping_snowflake_table",
26
+ "title_column_name",
27
+ "id_column_name",
28
+ "snowflake_hybrid_table",
29
+ "title_field_name",
30
+ "id_field_name",
31
+ "title_field_description",
32
+ "id_field_description",
33
+ ]);
34
+ export function elementFromTf(elementBlock, fieldBlocks, ctx, viewBlocks = {
35
+ layoutBlocks: [],
36
+ listViewBlocks: [],
37
+ managedViewOrderBlocks: [],
38
+ }) {
39
+ const label = elementBlock.label;
40
+ if (label === undefined || label === "") {
41
+ throw new EntityTfError("elementum_element block is missing its label");
42
+ }
43
+ const attrs = elementBlock.attrs;
44
+ const refName = tfLabelToTsLabel(label);
45
+ for (const key of Object.keys(attrs)) {
46
+ if (!KNOWN_ELEMENT_ATTRS.has(key)) {
47
+ ctx.diagnostics.push(`element "${label}": unhandled attribute "${key}" — the export dialect grew; extend elementFromTf deliberately`);
48
+ }
49
+ }
50
+ const name = optionalString(attrs, "name", `element "${label}"`, ctx) ?? "";
51
+ const namespace = optionalString(attrs, "namespace", `element "${label}"`, ctx);
52
+ const handle = optionalString(attrs, "handle", `element "${label}"`, ctx);
53
+ const description = optionalString(attrs, "description", `element "${label}"`, ctx);
54
+ const icon = optionalString(attrs, "icon", `element "${label}"`, ctx);
55
+ const color = optionalString(attrs, "color", `element "${label}"`, ctx);
56
+ if (handle === undefined) {
57
+ ctx.diagnostics.push(`element "${label}": export stream carries no handle; derived "${label.toUpperCase()}"`);
58
+ }
59
+ for (const key of ["title_field_description", "id_field_description"]) {
60
+ if (attrs[key] !== undefined) {
61
+ ctx.diagnostics.push(`element "${label}": ${key} has no authoring slot yet (systemFields overrides are name only); dropped`);
62
+ }
63
+ }
64
+ const commentsEnabled = optionalBoolean(attrs, "comments_enabled", `element "${label}"`, ctx);
65
+ // Snowflake cloud mapping — a LINKED element's Cloud Link + Database/Schema/
66
+ // Table + column-name wiring. Real and round-tripped: elementToTf re-sends
67
+ // it on build (create-only — the table binding is immutable once set).
68
+ const snowDb = optionalString(attrs, "cloud_mapping_snowflake_database", `element "${label}"`, ctx);
69
+ const snowSchema = optionalString(attrs, "cloud_mapping_snowflake_schema", `element "${label}"`, ctx);
70
+ const snowTable = optionalString(attrs, "cloud_mapping_snowflake_table", `element "${label}"`, ctx);
71
+ const hybridTable = optionalBoolean(attrs, "snowflake_hybrid_table", `element "${label}"`, ctx);
72
+ const titleColumnName = optionalString(attrs, "title_column_name", `element "${label}"`, ctx);
73
+ const idColumnName = optionalString(attrs, "id_column_name", `element "${label}"`, ctx);
74
+ const cloudConnection = snowDb !== undefined ||
75
+ snowSchema !== undefined ||
76
+ snowTable !== undefined ||
77
+ hybridTable !== undefined ||
78
+ titleColumnName !== undefined ||
79
+ idColumnName !== undefined
80
+ ? {
81
+ kind: "snowflake",
82
+ ...(snowDb !== undefined && { database: snowDb }),
83
+ ...(snowSchema !== undefined && { schema: snowSchema }),
84
+ ...(snowTable !== undefined && { table: snowTable }),
85
+ ...(hybridTable !== undefined && { hybridTable }),
86
+ ...(titleColumnName !== undefined && { titleColumnName }),
87
+ ...(idColumnName !== undefined && { idColumnName }),
88
+ }
89
+ : undefined;
90
+ let category;
91
+ if (attrs["category_id"] !== undefined) {
92
+ const dataLabel = dataRefLabel(attrs["category_id"], "elementum_category");
93
+ const categoryName = dataLabel !== undefined ? ctx.dataName("elementum_category", dataLabel) : undefined;
94
+ if (categoryName === undefined) {
95
+ ctx.diagnostics.push(`element "${label}": category_id is not a resolvable elementum_category data reference; dropped`);
96
+ }
97
+ else {
98
+ category = { name: categoryName };
99
+ }
100
+ }
101
+ let cloudLinkId;
102
+ let cloudLinkHandle;
103
+ if (attrs["cloud_link_id"] !== undefined) {
104
+ const dataLabel = dataRefLabel(attrs["cloud_link_id"], "elementum_cloudlink");
105
+ if (dataLabel === undefined) {
106
+ ctx.diagnostics.push(`element "${label}": cloud_link_id is not an elementum_cloudlink data reference; dropped`);
107
+ }
108
+ else {
109
+ cloudLinkHandle = tfLabelToTsLabel(dataLabel);
110
+ cloudLinkId = `data.elementum_cloudlink.${dataLabel}`;
111
+ }
112
+ }
113
+ const fields = [];
114
+ const titleName = optionalString(attrs, "title_field_name", `element "${label}"`, ctx);
115
+ if (titleName !== undefined)
116
+ fields.push(systemEntry("title", titleName, "TEXT", "TITLE"));
117
+ const idName = optionalString(attrs, "id_field_name", `element "${label}"`, ctx);
118
+ if (idName !== undefined)
119
+ fields.push(systemEntry("id", idName, "TEXT", "HANDLE"));
120
+ const owner = { type: ELEMENT_RESOURCE_TYPE, label };
121
+ for (const block of fieldBlocks) {
122
+ const entry = fieldFromTf(block, owner, ctx);
123
+ if (entry !== undefined)
124
+ fields.push(entry);
125
+ }
126
+ const elementId = ctx.importId(`${ELEMENT_RESOURCE_TYPE}.${label}`);
127
+ if (elementId === undefined) {
128
+ ctx.diagnostics.push(`element "${label}": no import block in the stream — adoption has no identity to bind`);
129
+ }
130
+ const { layouts, listViews, viewOrder } = viewsFromTf(viewBlocks.layoutBlocks, viewBlocks.listViewBlocks, viewBlocks.managedViewOrderBlocks, { type: ELEMENT_RESOURCE_TYPE, label }, ctx);
131
+ const element = {
132
+ id: elementId ?? "",
133
+ name,
134
+ ...(description !== undefined && { description }),
135
+ ...(namespace !== undefined && { namespace }),
136
+ ...(icon !== undefined && { icon }),
137
+ ...(color !== undefined && { color }),
138
+ type: "ELEMENT",
139
+ ...(category !== undefined && { category }),
140
+ refName,
141
+ backendHandle: handle ?? label.toUpperCase(),
142
+ fields,
143
+ stages: [],
144
+ ...(cloudLinkId !== undefined && { cloudLinkId }),
145
+ ...(cloudConnection !== undefined && { cloudConnection }),
146
+ ...(commentsEnabled !== undefined && { commentsEnabled }),
147
+ ...(layouts.length > 0 && { layouts }),
148
+ ...(listViews.length > 0 && { listViews }),
149
+ ...(viewOrder !== undefined && { viewOrder }),
150
+ };
151
+ return { element, ...(cloudLinkHandle !== undefined && { cloudLinkHandle }) };
152
+ }
153
+ function systemEntry(key, name, type, tag) {
154
+ return { key, field: { id: "", name, type, tags: [tag] } };
155
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * v2 element authoring — `defineElement`. Org-owned; deploys via the same
3
+ * wire client compose path apps use. Elements are not apps — see
4
+ * `src/elements/build.ts`'s header for why this is a dedicated module rather
5
+ * than folding into `src/aspects/` (which still owns `defineApp` and the
6
+ * field/print internals genuinely shared between both aspect kinds).
7
+ */
8
+ export { defineElement, type ElementCloudConnection, type ElementConfigured, type ElementRef, type ElementV2Options, } from "./build.js";
9
+ export { attachmentField, booleanField, dateField, dateTimeField, decimalField, groupField, htmlField, jsonField, multiPicklistField, numberField, picklistField, textField, userField, type BaseFieldOptions, type NumericFieldOptions, type PicklistFieldOptions, type TextFieldOptions, } from "../field/build.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * v2 element authoring — `defineElement`. Org-owned; deploys via the same
3
+ * wire client compose path apps use. Elements are not apps — see
4
+ * `src/elements/build.ts`'s header for why this is a dedicated module rather
5
+ * than folding into `src/aspects/` (which still owns `defineApp` and the
6
+ * field/print internals genuinely shared between both aspect kinds).
7
+ */
8
+ export { defineElement, } from "./build.js";
9
+ export { attachmentField, booleanField, dateField, dateTimeField, decimalField, groupField, htmlField, jsonField, multiPicklistField, numberField, picklistField, textField, userField, } from "../field/build.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Element locals.tf contribution — ei emits only title/id system lookups
3
+ * for `elementum_element` (no status/stage maps).
4
+ */
5
+ import { type TfValue } from "../../engine/tf/index.js";
6
+ /** Append one element's system lookup locals, keyed by its namespace (= tfLabel). */
7
+ export declare function appendElementLocals(attrs: Record<string, TfValue>, ns: string): void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Element locals.tf contribution — ei emits only title/id system lookups
3
+ * for `elementum_element` (no status/stage maps).
4
+ */
5
+ import { expr } from "../../engine/tf/index.js";
6
+ import { ELEMENT_RESOURCE_TYPE } from "./module.js";
7
+ /** Append one element's system lookup locals, keyed by its namespace (= tfLabel). */
8
+ export function appendElementLocals(attrs, ns) {
9
+ const element = (path) => expr.resourceAttr(ELEMENT_RESOURCE_TYPE, ns, [path]);
10
+ attrs[`${ns}_title_field_id`] = element("title_field_id");
11
+ attrs[`${ns}_id_field_id`] = element("id_field_id");
12
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Element kind graph declaration — managed stream root (`elementum_element`).
3
+ * Offline extract/build and live `edk pull element` (via `ei elements export
4
+ * --directory` with fields/imports/adoption flags).
5
+ */
6
+ import { type EntityKindModule } from "../../graph/types.js";
7
+ export declare const ELEMENT_RESOURCE_TYPE = "elementum_element";
8
+ export declare const elementModule: EntityKindModule;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Element kind graph declaration — managed stream root (`elementum_element`).
3
+ * Offline extract/build and live `edk pull element` (via `ei elements export
4
+ * --directory` with fields/imports/adoption flags).
5
+ */
6
+ import { NO_CATALOG, } from "../../graph/types.js";
7
+ import { appendFieldLocals } from "../field/locals.js";
8
+ import { LAYOUT_RESOURCE_TYPE, LIST_VIEW_RESOURCE_TYPE } from "../view/types.js";
9
+ import { elementFromTf } from "./from-tf.js";
10
+ import { appendElementLocals } from "./locals.js";
11
+ import { elementToTf } from "./to-tf.js";
12
+ export const ELEMENT_RESOURCE_TYPE = "elementum_element";
13
+ function extractElementStreamRoot(stream, ctx) {
14
+ const elementBlocks = stream.byKind.get("element") ?? [];
15
+ if (elementBlocks.length !== 1) {
16
+ throw new Error(`expected exactly one ${ELEMENT_RESOURCE_TYPE} resource in the export stream, found ${elementBlocks.length}` +
17
+ (elementBlocks.length > 1 ? " — was this exported with --recursive?" : ""));
18
+ }
19
+ const fieldBlocks = stream.byKind.get("field") ?? [];
20
+ const viewBlocks = stream.byKind.get("view") ?? [];
21
+ const layoutBlocks = viewBlocks.filter((b) => b.type === LAYOUT_RESOURCE_TYPE);
22
+ const listViewBlocks = viewBlocks.filter((b) => b.type === LIST_VIEW_RESOURCE_TYPE);
23
+ const managedViewOrderBlocks = stream.byKind.get("managed-view-order") ?? [];
24
+ const { element, cloudLinkHandle } = elementFromTf(elementBlocks[0], fieldBlocks, ctx, {
25
+ layoutBlocks,
26
+ listViewBlocks,
27
+ managedViewOrderBlocks,
28
+ });
29
+ return {
30
+ instance: element,
31
+ ...(cloudLinkHandle !== undefined && { cloudLinkHandle }),
32
+ };
33
+ }
34
+ export const elementModule = {
35
+ kind: "element",
36
+ stream: { role: "streamRoot", exportVerb: "elements" },
37
+ authoring: { unit: "ownFile", bag: "elements" },
38
+ parents: [{ parent: "org", child: "element" }],
39
+ resource: { shape: "single", resourceType: ELEMENT_RESOURCE_TYPE, adoptable: true },
40
+ // Foreign/referenced elements: `data.elementum_element` stubs (apps export
41
+ // --recursive=false) and build-time lookups share this facet.
42
+ data: { participates: true, lookupAttr: "name", referencedByBuild: true },
43
+ canvas: { participates: true, label: "Elements", glyph: "▦", component: "appDetail" },
44
+ lifecycle: {
45
+ participates: true,
46
+ extractStreamRoot: extractElementStreamRoot,
47
+ toTf: (entity, ctx) => {
48
+ const result = elementToTf(entity, {
49
+ appTfLabel: ctx.appTfLabel,
50
+ orgRefs: ctx.orgRefs,
51
+ diagnostics: ctx.diagnostics,
52
+ });
53
+ return { blocks: result.blocks, fieldAddresses: result.fieldAddresses };
54
+ },
55
+ appendLocals: (localsAttrs, ctx) => {
56
+ appendElementLocals(localsAttrs, ctx.appTfLabel);
57
+ if (ctx.fieldAddresses !== undefined) {
58
+ appendFieldLocals(localsAttrs, ctx.fieldAddresses);
59
+ }
60
+ },
61
+ },
62
+ catalog: NO_CATALOG,
63
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Element emission: `defineElement` DeployableEntity → `elementum_element` +
3
+ * field resources in ei's dialect. No status_options/stages (apps always
4
+ * emit those; element captures do not).
5
+ */
6
+ import type { ToTfContext } from "../../engine/build/context.js";
7
+ import { type DeployableEntity } from "../../engine/entity.js";
8
+ import { type TfBlock } from "../../engine/tf/index.js";
9
+ export interface ElementToTfResult {
10
+ readonly blocks: readonly TfBlock[];
11
+ readonly fieldAddresses: ReadonlyMap<string, string>;
12
+ }
13
+ /** `elementum_element` + one field resource per custom field. */
14
+ export declare function elementToTf(entity: DeployableEntity, ctx: ToTfContext): ElementToTfResult;