@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +462 -3
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
  3. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
  4. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
  5. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
  6. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
  7. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
  8. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
  9. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
  10. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
  11. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
  12. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
  13. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
  14. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
  15. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
  16. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
  17. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
  18. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
  19. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
  20. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
  21. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
  22. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
  23. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
  24. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
  25. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
  26. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
  27. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
  28. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
  29. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
  30. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
  31. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
  32. package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
  33. package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
  34. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
  35. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
  36. package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
  37. package/dist-sdk/elementum-entity-client/errors.js +111 -0
  38. package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
  39. package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
  40. package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
  41. package/dist-sdk/elementum-entity-client/types.js +1 -0
  42. package/dist-sdk/fs/entity.d.ts +104 -0
  43. package/dist-sdk/fs/entity.js +52 -0
  44. package/dist-sdk/pull/util.d.ts +130 -0
  45. package/dist-sdk/pull/util.js +204 -0
  46. package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
  47. package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
  48. package/dist-sdk/src/catalog/factories.d.ts +242 -0
  49. package/dist-sdk/src/catalog/factories.js +265 -0
  50. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  51. package/dist-sdk/src/catalog/from-authoring.js +467 -0
  52. package/dist-sdk/src/catalog/index.d.ts +12 -0
  53. package/dist-sdk/src/catalog/index.js +12 -0
  54. package/dist-sdk/src/catalog/org.d.ts +11 -0
  55. package/dist-sdk/src/catalog/org.js +288 -0
  56. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  57. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  58. package/dist-sdk/src/catalog/render.d.ts +48 -0
  59. package/dist-sdk/src/catalog/render.js +193 -0
  60. package/dist-sdk/src/catalog/token.d.ts +10 -0
  61. package/dist-sdk/src/catalog/token.js +76 -0
  62. package/dist-sdk/src/catalog/types.d.ts +215 -0
  63. package/dist-sdk/src/catalog/types.js +86 -0
  64. package/dist-sdk/src/catalog/write.d.ts +43 -0
  65. package/dist-sdk/src/catalog/write.js +109 -0
  66. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  67. package/dist-sdk/src/core/app-to-ui.js +75 -0
  68. package/dist-sdk/src/core/index.d.ts +10 -0
  69. package/dist-sdk/src/core/index.js +9 -0
  70. package/dist-sdk/src/core/system-fields.d.ts +95 -0
  71. package/dist-sdk/src/core/system-fields.js +153 -0
  72. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  73. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  74. package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
  75. package/dist-sdk/src/core/types/ai-provider.js +8 -0
  76. package/dist-sdk/src/core/types/app.d.ts +857 -0
  77. package/dist-sdk/src/core/types/app.js +210 -0
  78. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  79. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  80. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  81. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  82. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  83. package/dist-sdk/src/core/types/display-block.js +61 -0
  84. package/dist-sdk/src/core/types/group.d.ts +13 -0
  85. package/dist-sdk/src/core/types/group.js +6 -0
  86. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  87. package/dist-sdk/src/core/types/platform.js +1 -0
  88. package/dist-sdk/src/core/types/user.d.ts +20 -0
  89. package/dist-sdk/src/core/types/user.js +8 -0
  90. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  91. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  92. package/dist-sdk/src/engine/build/context.d.ts +67 -0
  93. package/dist-sdk/src/engine/build/context.js +6 -0
  94. package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
  95. package/dist-sdk/src/engine/build/source-context.js +23 -0
  96. package/dist-sdk/src/engine/entity.d.ts +44 -0
  97. package/dist-sdk/src/engine/entity.js +15 -0
  98. package/dist-sdk/src/engine/pull/context.d.ts +38 -0
  99. package/dist-sdk/src/engine/pull/context.js +44 -0
  100. package/dist-sdk/src/engine/pull/org.d.ts +54 -0
  101. package/dist-sdk/src/engine/pull/org.js +134 -0
  102. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  103. package/dist-sdk/src/engine/tf/escape.js +28 -0
  104. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  105. package/dist-sdk/src/engine/tf/expr.js +405 -0
  106. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  107. package/dist-sdk/src/engine/tf/index.js +11 -0
  108. package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
  109. package/dist-sdk/src/engine/tf/labels.js +196 -0
  110. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  111. package/dist-sdk/src/engine/tf/model.js +49 -0
  112. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  113. package/dist-sdk/src/engine/tf/parse.js +189 -0
  114. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  115. package/dist-sdk/src/engine/tf/render.js +102 -0
  116. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  117. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  118. package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
  119. package/dist-sdk/src/entities/access-policy/build.js +7 -0
  120. package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
  121. package/dist-sdk/src/entities/access-policy/filter.js +83 -0
  122. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
  123. package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
  124. package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
  125. package/dist-sdk/src/entities/access-policy/module.js +17 -0
  126. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
  127. package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
  128. package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
  129. package/dist-sdk/src/entities/access-policy/types.js +10 -0
  130. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  131. package/dist-sdk/src/entities/agent/build.js +148 -0
  132. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
  133. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
  134. package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
  135. package/dist-sdk/src/entities/agent/from-tf.js +289 -0
  136. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  137. package/dist-sdk/src/entities/agent/index.js +7 -0
  138. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  139. package/dist-sdk/src/entities/agent/module.js +122 -0
  140. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  141. package/dist-sdk/src/entities/agent/to-tf.js +188 -0
  142. package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
  143. package/dist-sdk/src/entities/agent/tools.js +238 -0
  144. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
  145. package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
  146. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  147. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  148. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
  149. package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
  150. package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
  151. package/dist-sdk/src/entities/agent-tool/types.js +102 -0
  152. package/dist-sdk/src/entities/app/build.d.ts +368 -0
  153. package/dist-sdk/src/entities/app/build.js +372 -0
  154. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
  155. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  156. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  157. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  158. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  159. package/dist-sdk/src/entities/app/from-tf.js +197 -0
  160. package/dist-sdk/src/entities/app/index.d.ts +14 -0
  161. package/dist-sdk/src/entities/app/index.js +11 -0
  162. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  163. package/dist-sdk/src/entities/app/locals.js +31 -0
  164. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  165. package/dist-sdk/src/entities/app/module.js +66 -0
  166. package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
  167. package/dist-sdk/src/entities/app/to-tf.js +212 -0
  168. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  169. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  170. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  171. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  172. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  173. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  174. package/dist-sdk/src/entities/automation/build.d.ts +259 -0
  175. package/dist-sdk/src/entities/automation/build.js +436 -0
  176. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  177. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  178. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
  179. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  180. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
  181. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
  182. package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
  183. package/dist-sdk/src/entities/automation/filter.js +156 -0
  184. package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
  185. package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
  186. package/dist-sdk/src/entities/automation/index.d.ts +22 -0
  187. package/dist-sdk/src/entities/automation/index.js +25 -0
  188. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  189. package/dist-sdk/src/entities/automation/module.js +150 -0
  190. package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
  191. package/dist-sdk/src/entities/automation/operators.js +69 -0
  192. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
  193. package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
  194. package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
  195. package/dist-sdk/src/entities/automation/script-code.js +633 -0
  196. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  197. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  198. package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
  199. package/dist-sdk/src/entities/automation/tasks.js +765 -0
  200. package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
  201. package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
  202. package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
  203. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  204. package/dist-sdk/src/entities/automation/types.d.ts +78 -0
  205. package/dist-sdk/src/entities/automation/types.js +131 -0
  206. package/dist-sdk/src/entities/element/build.d.ts +121 -0
  207. package/dist-sdk/src/entities/element/build.js +110 -0
  208. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  209. package/dist-sdk/src/entities/element/from-tf.js +170 -0
  210. package/dist-sdk/src/entities/element/index.d.ts +12 -0
  211. package/dist-sdk/src/entities/element/index.js +10 -0
  212. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  213. package/dist-sdk/src/entities/element/locals.js +12 -0
  214. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  215. package/dist-sdk/src/entities/element/module.js +65 -0
  216. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  217. package/dist-sdk/src/entities/element/to-tf.js +169 -0
  218. package/dist-sdk/src/entities/field/build.d.ts +112 -0
  219. package/dist-sdk/src/entities/field/build.js +84 -0
  220. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  221. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  222. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  223. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  224. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  225. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  226. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  227. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  228. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  229. package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
  230. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  231. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  232. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  233. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  234. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  235. package/dist-sdk/src/entities/field/calc.js +54 -0
  236. package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
  237. package/dist-sdk/src/entities/field/from-tf.js +184 -0
  238. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  239. package/dist-sdk/src/entities/field/locals.js +24 -0
  240. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  241. package/dist-sdk/src/entities/field/module.js +50 -0
  242. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  243. package/dist-sdk/src/entities/field/options.js +76 -0
  244. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  245. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  246. package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
  247. package/dist-sdk/src/entities/field/to-tf.js +142 -0
  248. package/dist-sdk/src/entities/field/types.d.ts +53 -0
  249. package/dist-sdk/src/entities/field/types.js +68 -0
  250. package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
  251. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  252. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
  253. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
  254. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
  255. package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
  256. package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
  257. package/dist-sdk/src/entities/file-reader/index.js +10 -0
  258. package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
  259. package/dist-sdk/src/entities/file-reader/module.js +115 -0
  260. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
  261. package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
  262. package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
  263. package/dist-sdk/src/entities/file-reader/types.js +30 -0
  264. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  265. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  266. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  267. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  268. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  269. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  270. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  271. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  272. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  273. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  274. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  275. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  276. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  277. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  278. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  279. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  280. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  281. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  282. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  283. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  284. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  285. package/dist-sdk/src/entities/flow/build.js +115 -0
  286. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  287. package/dist-sdk/src/entities/flow/index.js +7 -0
  288. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  289. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  290. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  291. package/dist-sdk/src/entities/flow/util.js +38 -0
  292. package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
  293. package/dist-sdk/src/entities/org/ai-provider.js +46 -0
  294. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  295. package/dist-sdk/src/entities/org/category.js +33 -0
  296. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  297. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  298. package/dist-sdk/src/entities/org/connector.d.ts +12 -0
  299. package/dist-sdk/src/entities/org/connector.js +35 -0
  300. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  301. package/dist-sdk/src/entities/org/group.js +40 -0
  302. package/dist-sdk/src/entities/org/index.d.ts +11 -0
  303. package/dist-sdk/src/entities/org/index.js +11 -0
  304. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  305. package/dist-sdk/src/entities/org/role.js +21 -0
  306. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  307. package/dist-sdk/src/entities/org/user.js +30 -0
  308. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  309. package/dist-sdk/src/entities/search-table/build.js +79 -0
  310. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  311. package/dist-sdk/src/entities/search-table/index.js +5 -0
  312. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  313. package/dist-sdk/src/entities/search-table/module.js +64 -0
  314. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  315. package/dist-sdk/src/entities/shared/context.js +156 -0
  316. package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
  317. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  318. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  319. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  320. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  321. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  322. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  323. package/dist-sdk/src/entities/shared/ref.js +119 -0
  324. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
  325. package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
  326. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  327. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  328. package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
  329. package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
  330. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  331. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  332. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  333. package/dist-sdk/src/entities/skill/build.js +50 -0
  334. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
  335. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
  336. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  337. package/dist-sdk/src/entities/skill/from-tf.js +96 -0
  338. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  339. package/dist-sdk/src/entities/skill/index.js +7 -0
  340. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  341. package/dist-sdk/src/entities/skill/module.js +111 -0
  342. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  343. package/dist-sdk/src/entities/skill/to-tf.js +59 -0
  344. package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
  345. package/dist-sdk/src/entities/skill/tools.js +105 -0
  346. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
  347. package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
  348. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  349. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  350. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
  351. package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
  352. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  353. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  354. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  355. package/dist-sdk/src/entities/table/build.js +339 -0
  356. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  357. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  358. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  359. package/dist-sdk/src/entities/table/fields.js +70 -0
  360. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  361. package/dist-sdk/src/entities/table/filter.js +89 -0
  362. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  363. package/dist-sdk/src/entities/table/index.js +12 -0
  364. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  365. package/dist-sdk/src/entities/table/joins.js +31 -0
  366. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  367. package/dist-sdk/src/entities/table/keys.js +25 -0
  368. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  369. package/dist-sdk/src/entities/table/module.js +25 -0
  370. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  371. package/dist-sdk/src/entities/table/state.js +43 -0
  372. package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
  373. package/dist-sdk/src/entities/view/from-tf.js +235 -0
  374. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  375. package/dist-sdk/src/entities/view/module.js +61 -0
  376. package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
  377. package/dist-sdk/src/entities/view/to-tf.js +171 -0
  378. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  379. package/dist-sdk/src/entities/view/types.js +89 -0
  380. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
  381. package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
  382. package/dist-sdk/src/graph/index.d.ts +91 -0
  383. package/dist-sdk/src/graph/index.js +211 -0
  384. package/dist-sdk/src/graph/modules.d.ts +7 -0
  385. package/dist-sdk/src/graph/modules.js +42 -0
  386. package/dist-sdk/src/graph/types.d.ts +375 -0
  387. package/dist-sdk/src/graph/types.js +102 -0
  388. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  389. package/dist-sdk/src/internal/sdk-package.js +23 -0
  390. package/package.json +201 -8
@@ -0,0 +1,108 @@
1
+ import type { Expr, ExprType } from "./calc/types.js";
2
+ import type { FieldRef } from "../../catalog/index.js";
3
+ /**
4
+ * Reference an app field inside a calc expression (e.g. `calc.gt(calc.field(
5
+ * app.fields.quantity), calc.num(0))`). Emits the field name — the platform
6
+ * resolves calc field refs by name on compose.
7
+ *
8
+ * The expr type defaults to the one implied by the field's `fieldType`, but is
9
+ * generic so it composes with strictly-typed operators when annotated
10
+ * (`calc.field<"number">(ref)`) — TS can't infer the literal type from the
11
+ * runtime `fieldType`.
12
+ */
13
+ export declare function field<T extends ExprType = ExprType>(ref: FieldRef): Expr<T>;
14
+ /** v2 calc namespace — v1's grammar plus `field()` for v2 field references. */
15
+ export declare const calc: {
16
+ field: typeof field;
17
+ num: (value: number) => Expr<"number">;
18
+ dec: (value: number) => Expr<"decimal">;
19
+ text: (value: string) => Expr<"text">;
20
+ bool: (value: boolean) => Expr<"bool">;
21
+ blank: <T extends ExprType>() => Expr<T>;
22
+ plus: {
23
+ (a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike): import("./calc/types.js").NumericExpr;
24
+ (a: import("./calc/types.js").ExprLike<"date">, b: import("./calc/types.js").NumericLike): Expr<"date">;
25
+ (a: import("./calc/types.js").ExprLike<"datetime">, b: import("./calc/types.js").NumericLike): Expr<"datetime">;
26
+ };
27
+ minus: {
28
+ (a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike): import("./calc/types.js").NumericExpr;
29
+ (a: import("./calc/types.js").ExprLike<"date">, b: import("./calc/types.js").NumericLike): Expr<"date">;
30
+ (a: import("./calc/types.js").ExprLike<"datetime">, b: import("./calc/types.js").NumericLike): Expr<"datetime">;
31
+ };
32
+ times: (a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike) => import("./calc/types.js").NumericExpr;
33
+ dividedBy: (a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike) => import("./calc/types.js").NumericExpr;
34
+ gt: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
35
+ lt: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
36
+ gte: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
37
+ lte: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
38
+ eq: <T extends ExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
39
+ ne: <T extends ExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
40
+ and: (a: import("./calc/types.js").BoolLike, b: import("./calc/types.js").BoolLike, ...rest: import("./calc/types.js").BoolLike[]) => Expr<"bool">;
41
+ or: (a: import("./calc/types.js").BoolLike, b: import("./calc/types.js").BoolLike, ...rest: import("./calc/types.js").BoolLike[]) => Expr<"bool">;
42
+ not: (value: import("./calc/types.js").BoolLike) => Expr<"bool">;
43
+ if: <T extends ExprType>(cond: import("./calc/types.js").BoolLike, thenArm: import("./calc/types.js").ExprLike<T>, elseArm: import("./calc/types.js").ExprLike<T>) => Expr<T>;
44
+ ifs: <T extends ExprType>(args_0: import("./calc/types.js").BoolLike, args_1: import("./calc/types.js").ExprLike<T>, ...args: (import("./calc/types.js").BoolLike | import("./calc/types.js").ExprLike<T>)[]) => Expr<T>;
45
+ coalesce: <T extends ExprType>(args_0: import("./calc/types.js").ExprLike<T>, args_1: import("./calc/types.js").ExprLike<T>, ...args: import("./calc/types.js").ExprLike<T>[]) => Expr<T>;
46
+ nullIf: <T extends ExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<T>;
47
+ isBlank: <T extends ExprType>(value: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
48
+ sum: (value: import("./calc/types.js").NumericLike) => import("./calc/types.js").NumericExpr;
49
+ count: <T extends ExprType>(value: import("./calc/types.js").ExprLike<T>) => Expr<"number">;
50
+ countUnique: <T extends ExprType>(value: import("./calc/types.js").ExprLike<T>) => Expr<"number">;
51
+ average: (value: import("./calc/types.js").NumericLike) => Expr<"decimal">;
52
+ stdev: (value: import("./calc/types.js").NumericLike) => Expr<"decimal">;
53
+ min: {
54
+ <T extends import("./calc/types.js").ComparableExprType>(value: import("./calc/types.js").ExprLike<T>): Expr<T>;
55
+ <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>, ...rest: import("./calc/types.js").ExprLike<T>[]): Expr<T>;
56
+ };
57
+ max: {
58
+ <T extends import("./calc/types.js").ComparableExprType>(value: import("./calc/types.js").ExprLike<T>): Expr<T>;
59
+ <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>, ...rest: import("./calc/types.js").ExprLike<T>[]): Expr<T>;
60
+ };
61
+ concat: typeof import("./calc/text.js").concat;
62
+ toText: typeof import("./calc/text.js").toText;
63
+ len: typeof import("./calc/text.js").len;
64
+ trim: typeof import("./calc/text.js").trim;
65
+ upper: typeof import("./calc/text.js").upper;
66
+ lower: typeof import("./calc/text.js").lower;
67
+ left: typeof import("./calc/text.js").left;
68
+ right: typeof import("./calc/text.js").right;
69
+ mid: typeof import("./calc/text.js").mid;
70
+ substitute: typeof import("./calc/text.js").substitute;
71
+ find: typeof import("./calc/text.js").find;
72
+ search: typeof import("./calc/text.js").search;
73
+ splitText: typeof import("./calc/text.js").splitText;
74
+ regexMatch: typeof import("./calc/text.js").regexMatch;
75
+ regexReplace: typeof import("./calc/text.js").regexReplace;
76
+ regexExtract: typeof import("./calc/text.js").regexExtract;
77
+ jsonEscape: typeof import("./calc/text.js").jsonEscape;
78
+ jsonUnescape: typeof import("./calc/text.js").jsonUnescape;
79
+ round: typeof import("./calc/numeric.js").round;
80
+ power: typeof import("./calc/numeric.js").power;
81
+ sqrt: typeof import("./calc/numeric.js").sqrt;
82
+ mod: typeof import("./calc/numeric.js").mod;
83
+ abs: typeof import("./calc/numeric.js").abs;
84
+ toNumber: typeof import("./calc/numeric.js").toNumber;
85
+ uuid: typeof import("./calc/numeric.js").uuid;
86
+ now: typeof import("./calc/date.js").now;
87
+ today: typeof import("./calc/date.js").today;
88
+ makeDate: typeof import("./calc/date.js").makeDate;
89
+ dateValue: typeof import("./calc/date.js").dateValue;
90
+ dateDif: typeof import("./calc/date.js").dateDif;
91
+ dateTimeTrunc: typeof import("./calc/date.js").dateTimeTrunc;
92
+ weekday: typeof import("./calc/date.js").weekday;
93
+ year: typeof import("./calc/date.js").year;
94
+ month: typeof import("./calc/date.js").month;
95
+ day: typeof import("./calc/date.js").day;
96
+ hour: typeof import("./calc/date.js").hour;
97
+ minute: typeof import("./calc/date.js").minute;
98
+ second: typeof import("./calc/date.js").second;
99
+ countIf: typeof import("./calc/aggregate.js").countIf;
100
+ sumIf: typeof import("./calc/aggregate.js").sumIf;
101
+ stringAgg: typeof import("./calc/aggregate.js").stringAgg;
102
+ stringAggUnique: typeof import("./calc/aggregate.js").stringAggUnique;
103
+ label: (field: import("./calc/types.js").ExprLike<"picklist">) => Expr<"text">;
104
+ id: <T extends "picklist" | "user" | "group" | "attachment">(field: import("./calc/types.js").ExprLike<T>) => Expr<T>;
105
+ email: (field: import("./calc/types.js").ExprLike<"user">) => Expr<"text">;
106
+ name: (field: import("./calc/types.js").ExprLike<"group">) => Expr<"text">;
107
+ };
108
+ export type { Expr, ExprType } from "./calc/types.js";
@@ -0,0 +1,54 @@
1
+ /**
2
+ * v2 calculated-field expressions. Reuses v1's `calc.*` grammar wholesale (all
3
+ * operators/functions, correct wire emission) and adds {@link field} for v2
4
+ * field references.
5
+ *
6
+ * The v2 twist: v1 emits a referenced field as its **id** when known, else its
7
+ * **name** — and the platform resolves calc field refs by name on compose. v2
8
+ * has no ids at author time, so a field reference emits the field **name**
9
+ * (carried on the `FieldRef` token). That sidesteps the token-resolution problem
10
+ * entirely (the id is buried in the expression *string*, which `resolvePayload`
11
+ * can't reach) — no deploy-time rewrite needed.
12
+ *
13
+ * Lives under `entities/field/` because calculated is a field sub-type
14
+ * (authored through `defineApp` fields, hence re-exported from the `/app`
15
+ * subpath). The terraform path does not support calculated fields yet —
16
+ * `fieldToTf` degrades them with a diagnostic.
17
+ */
18
+ import { calc as baseCalc } from "./calc/index.js";
19
+ import { makeExpr } from "./calc/runtime.js";
20
+ const FIELD_TYPE_TO_EXPR = {
21
+ TEXT: "text",
22
+ RICH_TEXT: "text",
23
+ HTML: "text",
24
+ NUMBER: "number",
25
+ DECIMAL: "decimal",
26
+ BOOLEAN: "bool",
27
+ DATE: "date",
28
+ DATETIME: "datetime",
29
+ PICKLIST: "picklist",
30
+ MULTI_PICKLIST: "picklist",
31
+ USER: "user",
32
+ USER_ID: "user",
33
+ GROUP: "group",
34
+ GROUP_ID: "group",
35
+ ATTACHMENT: "attachment",
36
+ ATTACHMENT_ID: "attachment",
37
+ JSON: "json",
38
+ };
39
+ /**
40
+ * Reference an app field inside a calc expression (e.g. `calc.gt(calc.field(
41
+ * app.fields.quantity), calc.num(0))`). Emits the field name — the platform
42
+ * resolves calc field refs by name on compose.
43
+ *
44
+ * The expr type defaults to the one implied by the field's `fieldType`, but is
45
+ * generic so it composes with strictly-typed operators when annotated
46
+ * (`calc.field<"number">(ref)`) — TS can't infer the literal type from the
47
+ * runtime `fieldType`.
48
+ */
49
+ export function field(ref) {
50
+ const exprType = (FIELD_TYPE_TO_EXPR[ref.fieldType] ?? "text");
51
+ return makeExpr(exprType, () => `"${ref.name.replace(/"/g, '""')}"`);
52
+ }
53
+ /** v2 calc namespace — v1's grammar plus `field()` for v2 field references. */
54
+ export const calc = { ...baseCalc, field };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Field extraction: one `elementum_*_field` resource block → the
3
+ * `NormalizedField` entry the owner's printer consumes. The owning aspect's
4
+ * from-tf drives the pass and says who the owner is — this module never
5
+ * names the owner's resource type. Platform ids come only from the stream's
6
+ * import blocks and stay data-side.
7
+ */
8
+ import { type FromTfContext } from "../../engine/pull/context.js";
9
+ import { type ChildResourceScope, type TfBlock, type TfValue } from "../../engine/tf/index.js";
10
+ import type { NormalizedField } from "../app/deserializer/normalize.js";
11
+ export interface FieldOwner {
12
+ /** The owner's resource type ("elementum_app") — what `object_id` must reference. */
13
+ readonly type: string;
14
+ /** The owner's tfLabel (namespace). */
15
+ readonly label: string;
16
+ /** Scope for stripping child label prefixes (defaults to app). */
17
+ readonly scope?: ChildResourceScope;
18
+ }
19
+ /**
20
+ * One field block → its normalized entry; undefined = skipped with a
21
+ * diagnostic (unknown resource type, or a field belonging to a different
22
+ * owner — a recursive stream carries discovered aspects' fields too).
23
+ */
24
+ export declare function fieldFromTf(block: TfBlock, owner: FieldOwner, ctx: FromTfContext): NormalizedField | undefined;
25
+ /**
26
+ * `<resourceType>.<tfLabel>.id` → the field's bag key — shared by anything
27
+ * that names a field by ref rather than owning it directly (agent-tool
28
+ * fields, view field_ids/columns). Undefined for any other shape or an
29
+ * unknown resource type.
30
+ */
31
+ export declare function fieldKeyFromTfRef(v: TfValue, ownerTfLabel?: string, scope?: ChildResourceScope): string | undefined;
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Field extraction: one `elementum_*_field` resource block → the
3
+ * `NormalizedField` entry the owner's printer consumes. The owning aspect's
4
+ * from-tf drives the pass and says who the owner is — this module never
5
+ * names the owner's resource type. Platform ids come only from the stream's
6
+ * import blocks and stay data-side.
7
+ */
8
+ import { EntityTfError } from "../../engine/entity.js";
9
+ import { dataRefLabel, optionalString, resourceRefLabel } from "../../engine/pull/context.js";
10
+ import { bareChildResourceLabel, isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
11
+ import { optionsFromTf } from "./options.js";
12
+ import { KNOWN_FIELD_ATTRS, SUB_TYPE_BY_RESOURCE } from "./types.js";
13
+ /**
14
+ * A related_object_id/related_label_field_id value → its raw platform id, if
15
+ * recoverable: a literal string as-is, or a `<type>.<label>.id` resource
16
+ * reference resolved through this stream's own import blocks (the same
17
+ * lookup adoption uses - `ctx.importId` is keyed by every resource address
18
+ * the stream imports, not just this field's). `data-attr` foreign lookups
19
+ * and `local` computed attributes carry no import block for their target
20
+ * and stay unresolvable.
21
+ */
22
+ function resolveRelatedId(v, ctx) {
23
+ if (typeof v === "string")
24
+ return v;
25
+ if (v !== undefined && isTfExpr(v) && v.$expr === "resource-attr" && v.path.length === 1 && v.path[0] === "id") {
26
+ return ctx.importId(`${v.type}.${v.label}`);
27
+ }
28
+ return undefined;
29
+ }
30
+ /**
31
+ * One field block → its normalized entry; undefined = skipped with a
32
+ * diagnostic (unknown resource type, or a field belonging to a different
33
+ * owner — a recursive stream carries discovered aspects' fields too).
34
+ */
35
+ export function fieldFromTf(block, owner, ctx) {
36
+ const subType = SUB_TYPE_BY_RESOURCE.get(block.type ?? "");
37
+ if (subType === undefined) {
38
+ ctx.diagnostics.push(`resource "${block.type}" is not a known field resource; skipped`);
39
+ return undefined;
40
+ }
41
+ const fieldLabel = block.label;
42
+ if (fieldLabel === undefined || fieldLabel === "") {
43
+ throw new EntityTfError(`${block.type} block is missing its label`);
44
+ }
45
+ if (subType.implemented !== true) {
46
+ // Declared but not yet round-tripped - see FIELD_SUB_TYPES for the
47
+ // current list of not-yet-implemented sub-types, if any.
48
+ // Reported to `skipped`, not just a diagnostic: this address still has a
49
+ // real import block in the stream and would otherwise get swept into
50
+ // adoption's targeted plan as a side effect of something else's
51
+ // reference to it (e.g. a layout's field_ids), even though nothing in
52
+ // authored source can ever reproduce it.
53
+ ctx.skipped.push(`${block.type}.${fieldLabel}`);
54
+ ctx.diagnostics.push(`${block.type}.${fieldLabel}: ${subType.typeKey} fields are not yet supported; skipped`);
55
+ return undefined;
56
+ }
57
+ const attrs = block.attrs;
58
+ const fieldName = optionalString(attrs, "name", `field "${fieldLabel}"`, ctx) ?? "";
59
+ const where = `field "${fieldName}" (${block.type}.${fieldLabel})`;
60
+ for (const key of Object.keys(attrs)) {
61
+ if (!KNOWN_FIELD_ATTRS.has(key)) {
62
+ ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend fieldFromTf deliberately`);
63
+ }
64
+ }
65
+ const objectLabel = resourceRefLabel(attrs["object_id"], owner.type);
66
+ if (objectLabel !== owner.label) {
67
+ ctx.diagnostics.push(`${where}: object_id does not reference ${owner.type}.${owner.label}; skipped`);
68
+ return undefined;
69
+ }
70
+ const options = subType.hasOptions === true ? optionsFromTf(attrs["options"], `${where} options`, ctx) : undefined;
71
+ let decimalPlaces;
72
+ if (subType.typeKey === "decimal" && attrs["decimal_places"] !== undefined) {
73
+ if (typeof attrs["decimal_places"] === "number")
74
+ decimalPlaces = attrs["decimal_places"];
75
+ else
76
+ ctx.diagnostics.push(`${where}: decimal_places is not a number; dropped`);
77
+ }
78
+ // related_object_id/related_label_field_id are raw platform ids on the
79
+ // wire when ei's beautifier finds nothing to resolve them against - a
80
+ // non-recursive export never discovers the related aspect's own identity,
81
+ // so this is the common case (confirmed live) and they stay literal
82
+ // strings. But whenever the beautifier CAN resolve one, it prefers a
83
+ // readable terraform reference over the raw id: a self-relation prints
84
+ // `related_object_id = elementum_app.<self>.id`, a relation into a
85
+ // resource this same stream also imports (e.g. a field on a recursively
86
+ // discovered dependency) prints `<type>.<label>.id` the same way. Both are
87
+ // `resource-attr` expressions whose target carries its own import block in
88
+ // this stream, so the raw id IS recoverable - via the same `ctx.importId`
89
+ // lookup adoption itself uses, keyed by the referenced resource's address,
90
+ // not this field's own. What's NOT recoverable: a `data-attr` foreign
91
+ // lookup (`data.elementum_element.<label>.id` - data blocks are never
92
+ // imported) or a `local` computed attribute (`local.<app>_id_field_id` -
93
+ // an app/element's system field ids are read-only outputs of that
94
+ // resource, never their own resource address). Both properties are
95
+ // required by RelationFieldOptions, so printing relationField(...) with
96
+ // either missing would be invalid TypeScript (item 117) - skip the whole
97
+ // field when either side can't be resolved, same convention as an
98
+ // unimplemented sub-type.
99
+ let relatedAspectId;
100
+ let relatedLabelFieldId;
101
+ let autoRelate;
102
+ if (subType.hasRelation === true) {
103
+ relatedAspectId = resolveRelatedId(attrs["related_object_id"], ctx);
104
+ relatedLabelFieldId = resolveRelatedId(attrs["related_label_field_id"], ctx);
105
+ if (typeof attrs["auto_relate"] === "boolean")
106
+ autoRelate = attrs["auto_relate"];
107
+ if (relatedAspectId === undefined || relatedLabelFieldId === undefined) {
108
+ const missing = [
109
+ relatedAspectId === undefined && "related_object_id",
110
+ relatedLabelFieldId === undefined && "related_label_field_id",
111
+ ].filter((v) => v !== false);
112
+ ctx.diagnostics.push(`${where}: ${missing.join(" and ")} does not resolve to a raw platform id - a RELATION field needs both to reconstruct relatedAspectId/relatedLabelFieldId; field skipped`);
113
+ ctx.skipped.push(`${block.type}.${fieldLabel}`);
114
+ return undefined;
115
+ }
116
+ }
117
+ const fieldRole = attrs["field_role"];
118
+ const tags = Array.isArray(fieldRole) && fieldRole.every((t) => typeof t === "string")
119
+ ? fieldRole
120
+ : undefined;
121
+ // A group/user field's default_value is a `data.elementum_group|user.<label>.id`
122
+ // EXPRESSION on the wire (the platform has no stable raw id to hand
123
+ // authored source, and the field is Optional-without-Computed — omitting
124
+ // it entirely would plan a destroy of the live default on every build).
125
+ // Round-trip the data block's own captured label + lookup value verbatim
126
+ // (see OrgFieldRefValue/fieldToTf's `rawLookup`) rather than resolving
127
+ // through the org.ts catalog: this is a pulled reference, not a
128
+ // hand-authored one, so there's no "does it still exist in the org"
129
+ // check to make.
130
+ let orgFieldRefDefault;
131
+ const orgRefDataType = subType.typeKey === "group" ? "elementum_group" : subType.typeKey === "user" ? "elementum_user" : undefined;
132
+ if (orgRefDataType !== undefined && isTfExpr(attrs["default_value"])) {
133
+ const label = dataRefLabel(attrs["default_value"], orgRefDataType);
134
+ const value = label !== undefined ? ctx.dataName(orgRefDataType, label) : undefined;
135
+ if (label !== undefined && value !== undefined) {
136
+ orgFieldRefDefault = { __kind: "orgFieldRef", dataType: orgRefDataType, label, value };
137
+ }
138
+ else {
139
+ ctx.diagnostics.push(`${where}: default_value references an unresolvable ${orgRefDataType} data lookup; dropped`);
140
+ }
141
+ }
142
+ const scope = owner.scope ?? "app";
143
+ return {
144
+ key: scopedLabelToBagKey(owner.label, fieldLabel, scope),
145
+ field: {
146
+ id: ctx.importId(`${block.type}.${fieldLabel}`) ?? "",
147
+ name: fieldName,
148
+ type: subType.authoringType,
149
+ // Only true flags are carried into authoring — false is the platform
150
+ // default and stays unwritten (build re-emits explicit false; ei's
151
+ // export does the same, so the build-vs-export sees both sides as false).
152
+ ...(attrs["required"] === true && { required: true }),
153
+ ...(attrs["required_on_close"] === true && { requiredOnClose: true }),
154
+ ...(attrs["show_on_create"] === true && { showOnCreate: true }),
155
+ ...(attrs["lock_on_create"] === true && { lockOnCreate: true }),
156
+ ...(typeof attrs["description"] === "string" && { description: attrs["description"] }),
157
+ ...(typeof attrs["column_name"] === "string" && { columnName: attrs["column_name"] }),
158
+ ...(orgFieldRefDefault !== undefined
159
+ ? { defaultValue: orgFieldRefDefault }
160
+ : attrs["default_value"] !== undefined &&
161
+ !isTfExpr(attrs["default_value"]) && { defaultValue: attrs["default_value"] }),
162
+ ...(options !== undefined && { options }),
163
+ ...(tags !== undefined && tags.length > 0 && { tags }),
164
+ ...(relatedAspectId !== undefined && { relatedAspectId }),
165
+ ...(relatedLabelFieldId !== undefined && { relatedLabelFieldId }),
166
+ ...(autoRelate !== undefined && { autoRelate }),
167
+ ...(decimalPlaces !== undefined && { decimalPlaces }),
168
+ },
169
+ };
170
+ }
171
+ /**
172
+ * `<resourceType>.<tfLabel>.id` → the field's bag key — shared by anything
173
+ * that names a field by ref rather than owning it directly (agent-tool
174
+ * fields, view field_ids/columns). Undefined for any other shape or an
175
+ * unknown resource type.
176
+ */
177
+ export function fieldKeyFromTfRef(v, ownerTfLabel, scope = "app") {
178
+ if (!isTfExpr(v) || v.$expr !== "resource-attr" || v.path.length !== 1 || v.path[0] !== "id")
179
+ return undefined;
180
+ if (!SUB_TYPE_BY_RESOURCE.has(v.type))
181
+ return undefined;
182
+ const bare = ownerTfLabel !== undefined ? bareChildResourceLabel(ownerTfLabel, v.label, scope) : v.label;
183
+ return ownerTfLabel !== undefined ? scopedLabelToBagKey(ownerTfLabel, v.label, scope) : tfLabelToTsLabel(bare);
184
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The field entity's locals.tf contribution, in ei's exact shape: one
3
+ * `<fieldLabel>_options_by_label` for-expression per option-carrying field
4
+ * resource (bare field label — ei does not namespace-prefix these).
5
+ */
6
+ import { type TfValue } from "../../engine/tf/index.js";
7
+ /** Append one app's field-level lookup locals, keyed by the emitted field addresses. */
8
+ export declare function appendFieldLocals(attrs: Record<string, TfValue>, fieldAddresses: ReadonlyMap<string, string>): void;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The field entity's locals.tf contribution, in ei's exact shape: one
3
+ * `<fieldLabel>_options_by_label` for-expression per option-carrying field
4
+ * resource (bare field label — ei does not namespace-prefix these).
5
+ */
6
+ import { expr } from "../../engine/tf/index.js";
7
+ // Dropdown ONLY, deliberately: ei's GenerateLocals has a multiselect branch,
8
+ // but it matches import blocks against "elementum_multi_select_field" — the
9
+ // real resource type is elementum_multiselect_field, so that branch never
10
+ // fires and real exports carry option-lookup locals for dropdowns only. The
11
+ // dialect is ei's actual output, not its intent (integration-harness build-vs-export
12
+ // finding, 2026-07-23).
13
+ const OPTION_LOOKUP_FIELD_RESOURCE_TYPES = new Set(["elementum_dropdown_field"]);
14
+ /** Append one app's field-level lookup locals, keyed by the emitted field addresses. */
15
+ export function appendFieldLocals(attrs, fieldAddresses) {
16
+ for (const address of [...fieldAddresses.values()].sort()) {
17
+ const dot = address.indexOf(".");
18
+ const type = address.slice(0, dot);
19
+ const label = address.slice(dot + 1);
20
+ if (!OPTION_LOOKUP_FIELD_RESOURCE_TYPES.has(type))
21
+ continue;
22
+ attrs[`${label}_options_by_label`] = expr.forObject("opt", expr.resourceAttr(type, label, ["options"]), expr.scopedAttr("opt", ["label"]), expr.scopedAttr("opt", ["id"]));
23
+ }
24
+ }
@@ -0,0 +1,3 @@
1
+ /** The field entity's registry entry (see src/graph/). */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ export declare const fieldModule: EntityKindModule;
@@ -0,0 +1,50 @@
1
+ /** The field entity's registry entry (see src/graph/). */
2
+ import { rootParentFactoryEntry } from "../../catalog/render-helpers.js";
3
+ import { NO_DATA, NO_LIFECYCLE, } from "../../graph/types.js";
4
+ import { FIELD_SUB_TYPES } from "./types.js";
5
+ export const fieldModule = {
6
+ kind: "field",
7
+ stream: { role: "streamMember" },
8
+ authoring: { unit: "inline", bag: "fields" },
9
+ parents: [
10
+ { parent: "app", child: "field" },
11
+ { parent: "element", child: "field" },
12
+ ],
13
+ resource: {
14
+ shape: "subTypes",
15
+ rows: FIELD_SUB_TYPES.map((t) => ({
16
+ key: t.typeKey,
17
+ resourceType: t.resourceType,
18
+ implemented: t.implemented === true,
19
+ })),
20
+ },
21
+ data: NO_DATA,
22
+ lifecycle: NO_LIFECYCLE,
23
+ canvas: { participates: true, label: "Fields", glyph: "▾", component: "fieldCard" },
24
+ // Inline under app — from-authoring still reads fields from app.ref(); this
25
+ // facet drives render bag name / order (replaces BAG_NAME.field).
26
+ catalog: {
27
+ participates: true,
28
+ refKind: "field",
29
+ catalogBag: "fields",
30
+ renderOrder: 50,
31
+ catalogRoot: "app",
32
+ renderEntry: rootParentFactoryEntry("fieldRef", (ref) => {
33
+ const field = ref;
34
+ const parts = [`fieldType: ${JSON.stringify(field.fieldType)}`];
35
+ if (field.tags !== undefined)
36
+ parts.push(`tags: ${JSON.stringify(field.tags)}`);
37
+ if (field.options !== undefined)
38
+ parts.push(`options: ${JSON.stringify(field.options)}`);
39
+ return parts;
40
+ }),
41
+ stubRef: (refName, parent) => ({
42
+ __kind: "field",
43
+ refName,
44
+ name: refName,
45
+ parent,
46
+ fieldType: "TEXT",
47
+ }),
48
+ refFromAuthoring: () => undefined,
49
+ },
50
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Picklist OPTIONS — the `[{label, color?, tags}, …]` shape shared by field
3
+ * `options` attributes and the app's `status_options` (the status system
4
+ * field is a picklist wearing an app attribute). Both directions live here:
5
+ * the wire→tf label projection and the tf→normalized-options extraction.
6
+ */
7
+ import { type FromTfContext } from "../../engine/pull/context.js";
8
+ import type { TfValue } from "../../engine/tf/index.js";
9
+ import type { PicklistOption, PicklistOptionTag } from "../../core/types/app.js";
10
+ /** The authored picklist-value shape (post-`slimTokens` compose body). */
11
+ export interface PicklistValueWire {
12
+ readonly label?: string;
13
+ readonly value?: string;
14
+ readonly tags?: readonly string[];
15
+ readonly color?: string;
16
+ readonly relatedParentValues?: unknown;
17
+ }
18
+ export declare function picklistLabel(pv: PicklistValueWire): string;
19
+ export declare const KNOWN_OPTION_TAGS: ReadonlySet<PicklistOptionTag>;
20
+ /**
21
+ * A `[{label, tags?}, ...]` attribute (status_options, dropdown options) →
22
+ * the keyed `options` record the normalized `AppField` carries. Keys derive
23
+ * from labels via `withUniqueKeys` — they never print (the printer emits
24
+ * labels), so they only need to be unique. Unknown tags drop with a
25
+ * diagnostic; option ids stay empty (identity lives in terraform state).
26
+ */
27
+ export declare function optionsFromTf(v: TfValue | undefined, where: string, ctx: FromTfContext): Record<string, PicklistOption> | undefined;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Picklist OPTIONS — the `[{label, color?, tags}, …]` shape shared by field
3
+ * `options` attributes and the app's `status_options` (the status system
4
+ * field is a picklist wearing an app attribute). Both directions live here:
5
+ * the wire→tf label projection and the tf→normalized-options extraction.
6
+ */
7
+ import { plainObject } from "../../engine/pull/context.js";
8
+ import { withUniqueKeys } from "../../../pull/util.js";
9
+ export function picklistLabel(pv) {
10
+ return pv.label ?? pv.value ?? "";
11
+ }
12
+ export const KNOWN_OPTION_TAGS = new Set([
13
+ "CLOSED",
14
+ "CRITICAL",
15
+ "HIGH",
16
+ "MEDIUM",
17
+ "LOW",
18
+ ]);
19
+ /**
20
+ * A `[{label, tags?}, ...]` attribute (status_options, dropdown options) →
21
+ * the keyed `options` record the normalized `AppField` carries. Keys derive
22
+ * from labels via `withUniqueKeys` — they never print (the printer emits
23
+ * labels), so they only need to be unique. Unknown tags drop with a
24
+ * diagnostic; option ids stay empty (identity lives in terraform state).
25
+ */
26
+ export function optionsFromTf(v, where, ctx) {
27
+ if (v === undefined)
28
+ return undefined;
29
+ if (!Array.isArray(v)) {
30
+ ctx.diagnostics.push(`${where}: expected a list; dropped`);
31
+ return undefined;
32
+ }
33
+ const parsed = [];
34
+ for (const item of v) {
35
+ const rec = plainObject(item);
36
+ const optLabel = typeof rec?.["label"] === "string" ? rec["label"] : undefined;
37
+ if (rec === undefined || optLabel === undefined) {
38
+ ctx.diagnostics.push(`${where}: option item has an unrecognized shape; dropped`);
39
+ continue;
40
+ }
41
+ for (const key of Object.keys(rec)) {
42
+ if (key !== "label" && key !== "tags" && key !== "color") {
43
+ ctx.diagnostics.push(`${where}: option "${optLabel}" has an unhandled property "${key}"; dropped`);
44
+ }
45
+ }
46
+ const color = typeof rec["color"] === "string" && rec["color"] !== "" ? rec["color"] : undefined;
47
+ const tags = [];
48
+ const rawTags = rec["tags"];
49
+ if (Array.isArray(rawTags)) {
50
+ for (const t of rawTags) {
51
+ if (typeof t === "string" && KNOWN_OPTION_TAGS.has(t)) {
52
+ tags.push(t);
53
+ }
54
+ else {
55
+ ctx.diagnostics.push(`${where}: option "${optLabel}" has an unknown tag ${JSON.stringify(t)}; dropped`);
56
+ }
57
+ }
58
+ }
59
+ else if (rawTags !== undefined) {
60
+ ctx.diagnostics.push(`${where}: option "${optLabel}" tags is not a list; dropped`);
61
+ }
62
+ parsed.push({ label: optLabel, ...(color !== undefined && { color }), tags });
63
+ }
64
+ if (parsed.length === 0)
65
+ return undefined;
66
+ const out = {};
67
+ for (const { key, item } of withUniqueKeys(parsed, (p) => p.label, "option")) {
68
+ out[key] = {
69
+ id: "",
70
+ label: item.label,
71
+ ...(item.color !== undefined && { color: item.color }),
72
+ ...(item.tags.length > 0 && { tags: item.tags }),
73
+ };
74
+ }
75
+ return out;
76
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Derives the typed shape of an app/element's records from its catalog
3
+ * `fields` bag — what `ctx.trigger.record` / `ctx.tasks.<name>.record` expose
4
+ * for record-bearing triggers and tasks (`recordCreated`, `recordSearch`,
5
+ * `createRecord`, …).
6
+ *
7
+ * Most field types are scalar leaves (`TEXT` → `string`, `NUMBER` → `number`,
8
+ * …). A few carry richer sub-properties that the platform resolves at
9
+ * runtime, so their record value is an object instead — `DeepRef` then
10
+ * exposes those sub-properties for drilling, e.g.
11
+ * `ctx.trigger.record.severity.label` or `ctx.trigger.record.owner.email`.
12
+ * Object shapes come from `entities/shared/types/platform.ts` so a
13
+ * `User`/`Attachment`/… means the same thing everywhere in the SDK.
14
+ *
15
+ * Lives under the field entity (not engine): this is authoring-time field
16
+ * value typing consumed by automations, not stream/build orchestration.
17
+ */
18
+ import type { FieldRef } from "../../catalog/types.js";
19
+ import type { Attachment, Group, PicklistValue, RichText, User } from "../shared/types/platform.js";
20
+ /** Map a platform field type literal to the TS type exposed on a record field. */
21
+ export type FieldValueType<FieldType extends string> = FieldType extends "NUMBER" | "DECIMAL" ? number : FieldType extends "BOOLEAN" ? boolean : FieldType extends "JSON" | "OBJECT" ? unknown : FieldType extends "PICKLIST" | "PICKLIST_ID" ? PicklistValue : FieldType extends "MULTI_PICKLIST" | "MULTI_PICKLIST_ID" ? readonly PicklistValue[] : FieldType extends "ATTACHMENT" | "ATTACHMENT_ID" | "FILE" ? Attachment : FieldType extends "RICH_TEXT" ? RichText : FieldType extends "USER" | "USER_ID" ? User : FieldType extends "GROUP" | "GROUP_ID" ? Group : string;
22
+ /**
23
+ * Extract the `fields` bag off an app/element-like ref, e.g. `typeof catalog.myApp`.
24
+ * `undefined` when the ref carries no `fields` bag (a hand-built `AspectRef`
25
+ * literal, or a ref kind — like a search table — that isn't field-typed yet).
26
+ */
27
+ export type AppFieldsOf<A> = A extends {
28
+ readonly fields: infer F extends Record<string, FieldRef>;
29
+ } ? F : undefined;
30
+ /**
31
+ * The typed record shape for an app/element ref. When `A` carries a concrete
32
+ * `fields` bag (a real catalog app), this is a closed, per-field-typed object —
33
+ * an unknown field name is a compile error. Otherwise (no `fields` bag known,
34
+ * e.g. a caller that can't supply one, like `aiSearchTable`'s search-table
35
+ * ref) it falls back to an open `Record<string, unknown>`, matching the
36
+ * pre-existing loose behavior rather than forcing an unusable empty shape.
37
+ *
38
+ * Every record also carries its own HANDLE/ID under two different synthetic
39
+ * keys, matching two independent (and both intentional) wire conventions —
40
+ * neither has a bag key in `fields`:
41
+ * - `id` — for a trigger-sourced record (`ctx.trigger.record.id`), per
42
+ * `normalizeTriggerRefPath`'s `recordIdFieldClientHandle` → `"id"` case
43
+ * in `automations/materialize/ref-deserializer.ts`.
44
+ * - `recordId` — for a task-output record (`ctx.tasks.<t>.record.recordId`,
45
+ * `recordSearch`/`createRecord`/`findRelatedRecords`), per
46
+ * `rewriteForwardTaskRefName`'s `record.recordId` → wire `recordId`
47
+ * collapse in `automations/build.ts` (and its inverse in
48
+ * `ref-deserializer.ts`'s `buildTaskRef`).
49
+ * `RecordShape` backs both trigger and task record accessors, so both keys
50
+ * live here regardless of which context a given call site is in.
51
+ */
52
+ export type RecordShape<A> = {
53
+ readonly id: string;
54
+ readonly recordId: string;
55
+ } & (AppFieldsOf<A> extends Record<string, FieldRef> ? {
56
+ readonly [K in keyof AppFieldsOf<A>]: FieldValueType<AppFieldsOf<A>[K]["fieldType"]>;
57
+ } : Record<string, unknown>);
@@ -0,0 +1 @@
1
+ export {};