@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,41 @@
1
+ import type { FieldRef, TableColumnRef } from "../../catalog/index.js";
2
+ export type TableFilterField = FieldRef | TableColumnRef | string | {
3
+ readonly id: string;
4
+ };
5
+ export type TableFilterInput = string | boolean | null;
6
+ export type TableFilterType = "AND" | "API_REQUEST" | "BETWEEN" | "CALCULATION" | "CONSECUTIVE_RANGE" | "CONTAINS" | "CURRENT_RANGE" | "EQUALS" | "FALSE" | "GREATER_THAN" | "GREATER_THAN_EQUALS" | "IN" | "IS_NULL" | "LESS_THAN" | "LESS_THAN_EQUALS" | "LIKE" | "OR" | "OVERLAPS" | "SEARCH" | "TRUE";
7
+ export type TableFilter = {
8
+ readonly type: TableFilterType | (string & {});
9
+ } & Record<string, unknown>;
10
+ export declare function raw<T extends TableFilter>(input: T): T;
11
+ export declare function eq(field: TableFilterField, value: TableFilterInput): TableFilter;
12
+ export declare function neq(field: TableFilterField, value: TableFilterInput): TableFilter;
13
+ export declare function contains(field: TableFilterField, value: string, caseInsensitive?: boolean): TableFilter;
14
+ export declare function doesNotContain(field: TableFilterField, value: string, caseInsensitive?: boolean): TableFilter;
15
+ export declare function startsWith(field: TableFilterField, value: string, caseInsensitive?: boolean): TableFilter;
16
+ export declare function doesNotStartWith(field: TableFilterField, value: string, caseInsensitive?: boolean): TableFilter;
17
+ export declare function endsWith(field: TableFilterField, value: string, caseInsensitive?: boolean): TableFilter;
18
+ export declare function doesNotEndWith(field: TableFilterField, value: string, caseInsensitive?: boolean): TableFilter;
19
+ export declare function isNull(field: TableFilterField): TableFilter;
20
+ export declare function isNotNull(field: TableFilterField): TableFilter;
21
+ export declare function and(...children: readonly TableFilter[]): TableFilter;
22
+ export declare function or(...children: readonly TableFilter[]): TableFilter;
23
+ export declare function whereTrue(): TableFilter;
24
+ export declare function whereFalse(): TableFilter;
25
+ export declare const filter: {
26
+ readonly eq: typeof eq;
27
+ readonly neq: typeof neq;
28
+ readonly startsWith: typeof startsWith;
29
+ readonly doesNotStartWith: typeof doesNotStartWith;
30
+ readonly endsWith: typeof endsWith;
31
+ readonly doesNotEndWith: typeof doesNotEndWith;
32
+ readonly isNull: typeof isNull;
33
+ readonly isNotNull: typeof isNotNull;
34
+ readonly contains: typeof contains;
35
+ readonly doesNotContain: typeof doesNotContain;
36
+ readonly and: typeof and;
37
+ readonly or: typeof or;
38
+ readonly whereTrue: typeof whereTrue;
39
+ readonly whereFalse: typeof whereFalse;
40
+ readonly raw: typeof raw;
41
+ };
@@ -0,0 +1,89 @@
1
+ function fieldOf(field) {
2
+ if (typeof field === "string")
3
+ return field;
4
+ if ("__kind" in field)
5
+ return field;
6
+ return field.id;
7
+ }
8
+ function valueOf(input) {
9
+ if (input === null)
10
+ return { type: "NULL" };
11
+ switch (typeof input) {
12
+ case "string":
13
+ return { type: "TEXT", value: input };
14
+ case "boolean":
15
+ return { type: "BOOLEAN", value: input };
16
+ }
17
+ }
18
+ export function raw(input) {
19
+ return input;
20
+ }
21
+ export function eq(field, value) {
22
+ return { type: "EQUALS", field: fieldOf(field), value: valueOf(value) };
23
+ }
24
+ export function neq(field, value) {
25
+ return { ...eq(field, value), not: true };
26
+ }
27
+ function like(field, value, caseInsensitive, options) {
28
+ return {
29
+ type: "LIKE",
30
+ field: fieldOf(field),
31
+ value: valueOf(value),
32
+ ...(options?.not === true ? { not: true } : {}),
33
+ caseInsensitive,
34
+ ...(options?.mode !== undefined ? { mode: options.mode } : {}),
35
+ };
36
+ }
37
+ export function contains(field, value, caseInsensitive = true) {
38
+ return like(field, value, caseInsensitive, { mode: "CONTAINS" });
39
+ }
40
+ export function doesNotContain(field, value, caseInsensitive = true) {
41
+ return like(field, value, caseInsensitive, { mode: "CONTAINS", not: true });
42
+ }
43
+ export function startsWith(field, value, caseInsensitive = true) {
44
+ return like(field, value, caseInsensitive, { mode: "STARTS_WITH" });
45
+ }
46
+ export function doesNotStartWith(field, value, caseInsensitive = true) {
47
+ return like(field, value, caseInsensitive, { mode: "STARTS_WITH", not: true });
48
+ }
49
+ export function endsWith(field, value, caseInsensitive = true) {
50
+ return like(field, value, caseInsensitive, { mode: "ENDS_WITH" });
51
+ }
52
+ export function doesNotEndWith(field, value, caseInsensitive = true) {
53
+ return like(field, value, caseInsensitive, { mode: "ENDS_WITH", not: true });
54
+ }
55
+ export function isNull(field) {
56
+ return { type: "IS_NULL", field: fieldOf(field) };
57
+ }
58
+ export function isNotNull(field) {
59
+ return { ...isNull(field), not: true };
60
+ }
61
+ export function and(...children) {
62
+ return { type: "AND", children };
63
+ }
64
+ export function or(...children) {
65
+ return { type: "OR", children };
66
+ }
67
+ export function whereTrue() {
68
+ return { type: "TRUE" };
69
+ }
70
+ export function whereFalse() {
71
+ return { type: "FALSE" };
72
+ }
73
+ export const filter = {
74
+ eq,
75
+ neq,
76
+ startsWith,
77
+ doesNotStartWith,
78
+ endsWith,
79
+ doesNotEndWith,
80
+ isNull,
81
+ isNotNull,
82
+ contains,
83
+ doesNotContain,
84
+ and,
85
+ or,
86
+ whereTrue,
87
+ whereFalse,
88
+ raw,
89
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * v2 table authoring — `defineTable`. Org-owned top-level entity; create-only.
3
+ * Standalone from v1's `src/tables`.
4
+ */
5
+ export { defineTable, tablePayloadToCreateRequest, tablePayloadToReadOnlyUpdateRequest, tablePayloadToUpdateRequest, type CloudMapping, type DefineTableV2Options, type TableAuthoringPayload, type TableConfigured, type TableView, } from "./build.js";
6
+ export { calculationColumn, calculationField, cloudColumn, cloudField, referenceField, serializeTableField, sourceColumn, type CalculationFieldV2Options, type CloudFieldV2Options, type ReferenceFieldV2Options, type TableColumn, type TableCalculationField, type TableCloudField, type TableField, type TableReferenceField, } from "./fields.js";
7
+ export { serializeJoin, tableJoin, type TableJoinFieldPair, type TableJoin, } from "./joins.js";
8
+ export { and, contains, doesNotContain, doesNotEndWith, doesNotStartWith, endsWith, eq, filter, isNotNull, isNull, neq, or, raw, startsWith, whereFalse, whereTrue, type TableFilter, type TableFilterField, type TableFilterInput, type TableFilterType, } from "./filter.js";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * v2 table authoring — `defineTable`. Org-owned top-level entity; create-only.
3
+ * Standalone from v1's `src/tables`.
4
+ */
5
+ export { defineTable, tablePayloadToCreateRequest, tablePayloadToReadOnlyUpdateRequest, tablePayloadToUpdateRequest, } from "./build.js";
6
+ export { calculationColumn, calculationField, cloudColumn, cloudField, referenceField, serializeTableField, sourceColumn, } from "./fields.js";
7
+ export { serializeJoin, tableJoin, } from "./joins.js";
8
+ export { and, contains, doesNotContain, doesNotEndWith, doesNotStartWith, endsWith, eq, filter, isNotNull, isNull, neq, or, raw, startsWith, whereFalse, whereTrue, } from "./filter.js";
9
+ // `defineTable.fromJSON` has no callable to attach to (tables are create-only
10
+ // and the builder returns a plain object), so the table pull orchestrator
11
+ // ships as a standalone named export — mirroring the other materialize-backed
12
+ // entities (agents, skills, aspects, automations).
@@ -0,0 +1,26 @@
1
+ /**
2
+ * v2 table joins — `tableJoin`. Parallel to v1 `src/tables/joins`. The join's
3
+ * `source` (the table/aspect joined in) is a catalog token resolved at deploy;
4
+ * the `(left, right)` field-id pairs may be raw ids, app/element field tokens,
5
+ * or table-column tokens resolved at deploy.
6
+ */
7
+ import type { TableJoinType } from "../../../elementum-entity-client/clients/tables/models/index.js";
8
+ import type { AspectRef, FieldRef, TableColumnRef, TableRef } from "../../catalog/index.js";
9
+ type TableJoinFieldRef = string | {
10
+ readonly id: string;
11
+ } | FieldRef | TableColumnRef;
12
+ export interface TableJoinFieldPair {
13
+ readonly left: TableJoinFieldRef;
14
+ readonly right: TableJoinFieldRef;
15
+ }
16
+ export interface TableJoin {
17
+ /** The table/aspect joined into this one (token → id at deploy). */
18
+ readonly source: AspectRef | TableRef;
19
+ readonly type: TableJoinType;
20
+ readonly on: readonly TableJoinFieldPair[];
21
+ readonly filter?: unknown;
22
+ }
23
+ export declare function tableJoin(opts: TableJoin): TableJoin;
24
+ /** Serialize a join to the wire shape (source token left in place for deploy). */
25
+ export declare function serializeJoin(def: TableJoin): Record<string, unknown>;
26
+ export {};
@@ -0,0 +1,31 @@
1
+ import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
2
+ export function tableJoin(opts) {
3
+ if (opts.on.length === 0) {
4
+ throw new EdkValidationError("tableJoin: `on` must list at least one (left, right) field pair.");
5
+ }
6
+ return opts;
7
+ }
8
+ function idOf(v) {
9
+ if (isFieldRef(v) || isTableColumnRef(v))
10
+ return v;
11
+ return typeof v === "string" ? v : v.id;
12
+ }
13
+ function isFieldRef(value) {
14
+ return (typeof value === "object" &&
15
+ value !== null &&
16
+ value.__kind === "field");
17
+ }
18
+ function isTableColumnRef(value) {
19
+ return (typeof value === "object" &&
20
+ value !== null &&
21
+ value.__kind === "tableColumn");
22
+ }
23
+ /** Serialize a join to the wire shape (source token left in place for deploy). */
24
+ export function serializeJoin(def) {
25
+ return {
26
+ source: def.source, // AspectRef / TableRef token → id at deploy
27
+ type: def.type,
28
+ joinOn: def.on.map((p) => ({ leftFieldId: idOf(p.left), rightFieldId: idOf(p.right) })),
29
+ ...(def.filter !== undefined ? { filter: def.filter } : {}),
30
+ };
31
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Convert a table/column label to the identifier convention used by table
3
+ * authoring and state. Table keys intentionally normalize the whole first
4
+ * word (`ID` -> `id`) and prefix digit-leading keys (`123` -> `f_123`).
5
+ */
6
+ export declare function tableIdentifierKey(input: string, fallback?: string): string | undefined;
7
+ /** Pair items with stable, source-ordered, unique table identifier keys. */
8
+ export declare function withTableKeys<T>(items: readonly T[], nameOf: (item: T) => string, fallback?: string): readonly {
9
+ readonly key: string;
10
+ readonly item: T;
11
+ }[];
@@ -0,0 +1,25 @@
1
+ import { camelCase } from "../../../pull/util.js";
2
+ /**
3
+ * Convert a table/column label to the identifier convention used by table
4
+ * authoring and state. Table keys intentionally normalize the whole first
5
+ * word (`ID` -> `id`) and prefix digit-leading keys (`123` -> `f_123`).
6
+ */
7
+ export function tableIdentifierKey(input, fallback) {
8
+ const key = camelCase(input.toLowerCase()) || fallback;
9
+ if (key === undefined || key === "")
10
+ return undefined;
11
+ return /^[0-9]/.test(key) ? `f_${key}` : key;
12
+ }
13
+ /** Pair items with stable, source-ordered, unique table identifier keys. */
14
+ export function withTableKeys(items, nameOf, fallback = "item") {
15
+ const used = new Set();
16
+ return items.map((item) => {
17
+ const base = tableIdentifierKey(nameOf(item), fallback) ?? "item";
18
+ let key = base;
19
+ let suffix = 2;
20
+ while (used.has(key))
21
+ key = `${base}${suffix++}`;
22
+ used.add(key);
23
+ return { key, item };
24
+ });
25
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Org-owned table kind graph stub — authoring root `tables/`; TF bridge later.
3
+ */
4
+ import { type EntityKindModule } from "../../graph/types.js";
5
+ export declare const tableModule: EntityKindModule;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Org-owned table kind graph stub — authoring root `tables/`; TF bridge later.
3
+ */
4
+ import { NO_DATA, NO_LIFECYCLE, } from "../../graph/types.js";
5
+ import { renderTableCatalogEntry } from "./catalog-render.js";
6
+ export const tableModule = {
7
+ kind: "table",
8
+ stream: { role: "streamReported" },
9
+ authoring: { unit: "ownFile", bag: "tables" },
10
+ parents: [{ parent: "org", child: "table" }],
11
+ resource: { shape: "none" },
12
+ data: NO_DATA,
13
+ lifecycle: NO_LIFECYCLE,
14
+ canvas: { participates: true, label: "Tables", glyph: "▤", component: "generic" },
15
+ catalog: {
16
+ participates: true,
17
+ refKind: "table",
18
+ catalogBag: "tables",
19
+ renderOrder: 40,
20
+ catalogRoot: "org",
21
+ renderEntry: renderTableCatalogEntry,
22
+ stubRef: (refName) => ({ __kind: "table", refName, name: refName }),
23
+ refFromAuthoring: () => undefined,
24
+ },
25
+ };
@@ -0,0 +1,39 @@
1
+ import type { TableFieldWire, TableWire } from "../../../elementum-entity-client/clients/tables/models/index.js";
2
+ /**
3
+ * Column/table shapes formerly recorded in the deleted REST deploy state —
4
+ * kept because the table normalizer/builder still exchange them (the
5
+ * terraform-path tables tranche will re-home or replace them).
6
+ */
7
+ export interface TableColumnLinkedStateV2 {
8
+ readonly id: string;
9
+ readonly clientHandle?: string;
10
+ readonly __typename?: string;
11
+ }
12
+ export interface TableColumnStateV2 {
13
+ readonly id: string;
14
+ readonly clientHandle?: string;
15
+ readonly name: string;
16
+ readonly fieldType?: string;
17
+ readonly tags?: readonly string[];
18
+ readonly rawTags?: readonly string[];
19
+ readonly field?: TableColumnLinkedStateV2;
20
+ readonly source?: TableColumnLinkedStateV2;
21
+ readonly isAggregated?: boolean;
22
+ readonly configured?: boolean;
23
+ readonly __typename?: string;
24
+ }
25
+ /** The table-relevant slice of the deleted state binding shape. */
26
+ export interface TableBindingState {
27
+ readonly id: string;
28
+ readonly handle: string;
29
+ readonly clientHandle?: string;
30
+ readonly name?: string;
31
+ readonly editable?: boolean;
32
+ readonly cloudManaged?: boolean;
33
+ readonly configured?: boolean;
34
+ readonly tableType?: string;
35
+ readonly tableColumns?: Record<string, TableColumnStateV2>;
36
+ }
37
+ export declare function tableColumnLinkedState(value: unknown): TableColumnLinkedStateV2 | undefined;
38
+ export declare function tableColumnStateFromWire(field: TableFieldWire): TableColumnStateV2;
39
+ export declare function tableRuntimeStateFromWire(table: TableWire): Pick<TableBindingState, "editable" | "cloudManaged" | "configured" | "tableType">;
@@ -0,0 +1,43 @@
1
+ function stringArray(value) {
2
+ return Array.isArray(value) && value.every((v) => typeof v === "string")
3
+ ? value
4
+ : undefined;
5
+ }
6
+ export function tableColumnLinkedState(value) {
7
+ if (value === null || typeof value !== "object")
8
+ return undefined;
9
+ const rec = value;
10
+ if (typeof rec.id !== "string" || rec.id === "")
11
+ return undefined;
12
+ return {
13
+ id: rec.id,
14
+ ...(typeof rec.clientHandle === "string" ? { clientHandle: rec.clientHandle } : {}),
15
+ ...(typeof rec.__typename === "string" ? { __typename: rec.__typename } : {}),
16
+ };
17
+ }
18
+ export function tableColumnStateFromWire(field) {
19
+ const rawTags = stringArray(field.tags);
20
+ const semanticTags = stringArray(field.semanticTags);
21
+ const tags = semanticTags !== undefined && semanticTags.length > 0 ? semanticTags : rawTags;
22
+ return {
23
+ id: field.id,
24
+ ...(typeof field.clientHandle === "string" ? { clientHandle: field.clientHandle } : {}),
25
+ name: field.name,
26
+ ...(typeof field.fieldType === "string" ? { fieldType: field.fieldType } : {}),
27
+ ...(tags !== undefined && tags.length > 0 ? { tags } : {}),
28
+ ...(rawTags !== undefined ? { rawTags } : {}),
29
+ ...(tableColumnLinkedState(field.field) !== undefined ? { field: tableColumnLinkedState(field.field) } : {}),
30
+ ...(tableColumnLinkedState(field.source) !== undefined ? { source: tableColumnLinkedState(field.source) } : {}),
31
+ ...(typeof field.isAggregated === "boolean" ? { isAggregated: field.isAggregated } : {}),
32
+ ...(typeof field.configured === "boolean" ? { configured: field.configured } : {}),
33
+ ...(typeof field.__typename === "string" ? { __typename: field.__typename } : {}),
34
+ };
35
+ }
36
+ export function tableRuntimeStateFromWire(table) {
37
+ return {
38
+ ...(typeof table.editable === "boolean" ? { editable: table.editable } : {}),
39
+ ...(typeof table.cloudManaged === "boolean" ? { cloudManaged: table.cloudManaged } : {}),
40
+ ...(typeof table.configured === "boolean" ? { configured: table.configured } : {}),
41
+ ...(typeof table.type === "string" ? { tableType: table.type } : {}),
42
+ };
43
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * View extraction: `elementum_layout` / `elementum_list_view` /
3
+ * `elementum_managed_view_order` resource blocks → the normalized
4
+ * `layouts`/`listViews`/`viewOrder` entries the app printer consumes. The
5
+ * owning app's from-tf drives this pass and says who the owner is — this
6
+ * module never names the app's own resource type.
7
+ */
8
+ import { type FromTfContext } from "../../engine/pull/context.js";
9
+ import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
10
+ import type { NormalizedLayout, NormalizedListView } from "../app/deserializer/normalize.js";
11
+ export interface ViewOwner {
12
+ /** The owner's resource type ("elementum_app") — what `object_id`/`aspect_id` must reference. */
13
+ readonly type: string;
14
+ /** The owner's tfLabel (namespace). */
15
+ readonly label: string;
16
+ /** Namespace tf label for stripping child label prefixes. */
17
+ readonly ownerTfLabel: string;
18
+ /** App vs element scope for prefix stripping. */
19
+ readonly scope?: ChildResourceScope;
20
+ /** Stage keys declared by the owning app, used when ei exports a raw stage UUID. */
21
+ readonly stageKeys?: ReadonlySet<string>;
22
+ }
23
+ export interface ViewsFromTfResult {
24
+ readonly layouts: readonly NormalizedLayout[];
25
+ readonly listViews: readonly NormalizedListView[];
26
+ readonly viewOrder?: readonly string[];
27
+ }
28
+ /** All three view resource kinds → the normalized shapes the app printer consumes. */
29
+ export declare function viewsFromTf(layoutBlocks: readonly TfBlock[], listViewBlocks: readonly TfBlock[], managedViewOrderBlocks: readonly TfBlock[], owner: ViewOwner, ctx: FromTfContext): ViewsFromTfResult;
@@ -0,0 +1,235 @@
1
+ /**
2
+ * View extraction: `elementum_layout` / `elementum_list_view` /
3
+ * `elementum_managed_view_order` resource blocks → the normalized
4
+ * `layouts`/`listViews`/`viewOrder` entries the app printer consumes. The
5
+ * owning app's from-tf drives this pass and says who the owner is — this
6
+ * module never names the app's own resource type.
7
+ */
8
+ import { optionalString, plainObject, resourceRefLabel } from "../../engine/pull/context.js";
9
+ import { isTfExpr, scopedLabelToBagKey } from "../../engine/tf/index.js";
10
+ import { fieldKeyFromTfRef } from "../field/from-tf.js";
11
+ import { GROUP_SECTION_WIRE_TYPE, KNOWN_LAYOUT_ATTRS, KNOWN_LAYOUT_SECTION_ATTRS, KNOWN_LIST_VIEW_ATTRS, KNOWN_MANAGED_VIEW_ORDER_ATTRS, LIST_VIEW_RESOURCE_TYPE, SECTION_TYPE_FROM_WIRE, SYSTEM_FIELD_KEY_BY_ID_ATTR, UPDATE_SECTION_WIRE_TYPE, } from "./types.js";
12
+ /** Report every attribute key not in `known` as dialect growth — shared by all four view/section passes below. */
13
+ function reportUnknownAttrs(attrs, known, where, passName, ctx) {
14
+ for (const key of Object.keys(attrs)) {
15
+ if (!known.has(key)) {
16
+ ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend ${passName} deliberately`);
17
+ }
18
+ }
19
+ }
20
+ /** All three view resource kinds → the normalized shapes the app printer consumes. */
21
+ export function viewsFromTf(layoutBlocks, listViewBlocks, managedViewOrderBlocks, owner, ctx) {
22
+ const layouts = [];
23
+ for (const block of layoutBlocks) {
24
+ const layout = layoutFromTf(block, owner, ctx);
25
+ if (layout !== undefined)
26
+ layouts.push(layout);
27
+ }
28
+ const listViews = [];
29
+ const keyByTfLabel = new Map();
30
+ for (const block of listViewBlocks) {
31
+ const view = listViewFromTf(block, owner, ctx);
32
+ if (view !== undefined) {
33
+ listViews.push(view);
34
+ keyByTfLabel.set(block.label ?? "", view.key);
35
+ }
36
+ }
37
+ // Singleton per aspect — at most one block is expected; extras are reported.
38
+ let viewOrder;
39
+ for (const [i, block] of managedViewOrderBlocks.entries()) {
40
+ if (i > 0) {
41
+ ctx.diagnostics.push(`unexpected additional elementum_managed_view_order.${block.label ?? "?"} for one aspect; ignored`);
42
+ continue;
43
+ }
44
+ viewOrder = managedViewOrderFromTf(block, owner, keyByTfLabel, ctx);
45
+ }
46
+ return { layouts, listViews, ...(viewOrder !== undefined ? { viewOrder } : {}) };
47
+ }
48
+ function layoutFromTf(block, owner, ctx) {
49
+ const label = block.label ?? "";
50
+ const attrs = block.attrs;
51
+ const where = `layout "${label}"`;
52
+ reportUnknownAttrs(attrs, KNOWN_LAYOUT_ATTRS, where, "layoutFromTf", ctx);
53
+ const objectLabel = resourceRefLabel(attrs["object_id"], owner.type);
54
+ if (objectLabel !== owner.label) {
55
+ ctx.diagnostics.push(`${where}: object_id does not reference ${owner.type}.${owner.label}; skipped`);
56
+ return undefined;
57
+ }
58
+ const stageKey = stageKeyFromTf(attrs["stage_id"], owner.label);
59
+ const scope = owner.scope ?? "app";
60
+ const labelStageKey = scopedLabelToBagKey(owner.ownerTfLabel, label, scope);
61
+ const canInferStageKey = typeof attrs["stage_id"] === "string" && owner.stageKeys?.has(labelStageKey) === true;
62
+ if (stageKey === undefined && !canInferStageKey) {
63
+ ctx.diagnostics.push(`${where}: stage_id is not a "local.${owner.label}_stage_ids_by_key[...]" reference; using the layout's own label "${label}" as the stage key (may not match the platform's real stage key)`);
64
+ }
65
+ const sectionsAttr = attrs["sections"];
66
+ const sections = [];
67
+ if (Array.isArray(sectionsAttr)) {
68
+ for (const item of sectionsAttr) {
69
+ const section = sectionFromTf(item, owner.label, owner.ownerTfLabel, scope, where, ctx);
70
+ if (section !== undefined)
71
+ sections.push(section);
72
+ }
73
+ }
74
+ else if (sectionsAttr !== undefined) {
75
+ ctx.diagnostics.push(`${where}: sections is not a list; dropped`);
76
+ }
77
+ return { stageKey: stageKey ?? labelStageKey, sections };
78
+ }
79
+ function stageKeyFromTf(v, ownerLabel) {
80
+ if (v === undefined || !isTfExpr(v) || v.$expr !== "local")
81
+ return undefined;
82
+ if (v.name !== `${ownerLabel}_stage_ids_by_key`)
83
+ return undefined;
84
+ const seg = v.path[0];
85
+ return v.path.length === 1 && typeof seg === "object" && "index" in seg ? seg.index : undefined;
86
+ }
87
+ function sectionFromTf(raw, ownerLabel, ownerTfLabel, scope, where, ctx) {
88
+ const rec = plainObject(raw);
89
+ if (rec === undefined) {
90
+ ctx.diagnostics.push(`${where}: a sections entry has an unrecognized shape; dropped`);
91
+ return undefined;
92
+ }
93
+ reportUnknownAttrs(rec, KNOWN_LAYOUT_SECTION_ATTRS, where, "layoutFromTf", ctx);
94
+ const wireType = typeof rec["type"] === "string" ? rec["type"] : GROUP_SECTION_WIRE_TYPE;
95
+ const authoringType = SECTION_TYPE_FROM_WIRE.get(wireType);
96
+ if (authoringType === undefined) {
97
+ ctx.diagnostics.push(`${where}: section type "${wireType}" is not a known layout section type; dropped`);
98
+ return undefined;
99
+ }
100
+ const section = { type: authoringType };
101
+ if (typeof rec["display_location"] === "string")
102
+ section.displayLocation = rec["display_location"];
103
+ if (typeof rec["display_order"] === "number")
104
+ section.displayOrder = rec["display_order"];
105
+ if (typeof rec["side_nav_item"] === "boolean")
106
+ section.sideNavItem = rec["side_nav_item"];
107
+ if (wireType === GROUP_SECTION_WIRE_TYPE) {
108
+ if (typeof rec["name"] === "string")
109
+ section.name = rec["name"];
110
+ if (typeof rec["icon"] === "string")
111
+ section.icon = rec["icon"];
112
+ if (typeof rec["color"] === "string")
113
+ section.color = rec["color"];
114
+ const fieldIds = rec["field_ids"];
115
+ if (Array.isArray(fieldIds)) {
116
+ const fields = [];
117
+ for (const f of fieldIds) {
118
+ const key = fieldRefFromTf(f, ownerLabel, ownerTfLabel, scope, ctx);
119
+ if (key !== undefined)
120
+ fields.push(key);
121
+ }
122
+ section.fields = fields;
123
+ }
124
+ }
125
+ else if (wireType === UPDATE_SECTION_WIRE_TYPE && typeof rec["name"] === "string") {
126
+ section.name = rec["name"];
127
+ }
128
+ return section;
129
+ }
130
+ /** A `field_ids`/`columns` entry → a system-field key or a custom field's bag key. */
131
+ function fieldRefFromTf(v, ownerLabel, ownerTfLabel, scope, ctx) {
132
+ if (!isTfExpr(v)) {
133
+ ctx.diagnostics.push(`field reference has an unrecognized (non-expression) shape; dropped`);
134
+ return undefined;
135
+ }
136
+ if (v.$expr === "local" && v.path.length === 0) {
137
+ const attr = v.name.startsWith(`${ownerLabel}_`) ? v.name.slice(ownerLabel.length + 1) : undefined;
138
+ const systemKey = attr !== undefined ? SYSTEM_FIELD_KEY_BY_ID_ATTR.get(attr) : undefined;
139
+ if (systemKey !== undefined)
140
+ return systemKey;
141
+ }
142
+ // Custom field ref resolution is shared with agent-tool's field refs
143
+ // (src/entities/agent-tool/from-tf.ts) via entities/field/from-tf.ts.
144
+ const fieldKey = fieldKeyFromTfRef(v, ownerTfLabel, scope);
145
+ if (fieldKey !== undefined)
146
+ return fieldKey;
147
+ ctx.diagnostics.push(`field reference ${JSON.stringify(v)} does not resolve to a known field; dropped`);
148
+ return undefined;
149
+ }
150
+ function listViewFromTf(block, owner, ctx) {
151
+ const label = block.label;
152
+ if (label === undefined || label === "") {
153
+ ctx.diagnostics.push(`${LIST_VIEW_RESOURCE_TYPE} block is missing its label; skipped`);
154
+ return undefined;
155
+ }
156
+ const attrs = block.attrs;
157
+ const where = `list view "${label}"`;
158
+ reportUnknownAttrs(attrs, KNOWN_LIST_VIEW_ATTRS, where, "listViewFromTf", ctx);
159
+ const aspectLabel = resourceRefLabel(attrs["aspect_id"], owner.type);
160
+ if (aspectLabel !== owner.label) {
161
+ ctx.diagnostics.push(`${where}: aspect_id does not reference ${owner.type}.${owner.label}; skipped`);
162
+ return undefined;
163
+ }
164
+ const scope = owner.scope ?? "app";
165
+ const name = optionalString(attrs, "name", where, ctx) ?? "";
166
+ const columnsAttr = attrs["columns"];
167
+ const columns = [];
168
+ if (Array.isArray(columnsAttr)) {
169
+ for (const c of columnsAttr) {
170
+ const key = fieldRefFromTf(c, owner.label, owner.ownerTfLabel, scope, ctx);
171
+ if (key !== undefined)
172
+ columns.push(key);
173
+ }
174
+ }
175
+ else if (columnsAttr !== undefined) {
176
+ ctx.diagnostics.push(`${where}: columns is not a list; dropped`);
177
+ }
178
+ // Opaque JSON pass-through: `elementum build` is stateless and never reads
179
+ // current state, so if these were left unauthored, `to-tf` would author
180
+ // "absent" — forcing terraform to null out whatever's actually live on
181
+ // every plan. Confirmed live: that trips a real provider bug ("provider
182
+ // produced inconsistent result after apply", .sort was null but is still
183
+ // reported non-null) on ANY list view with either attribute set. Round-
184
+ // tripping the raw value, opaque and untyped, avoids ever manufacturing
185
+ // that diff in the first place.
186
+ const filter = jsonencodeValue(attrs["filter"]);
187
+ const sort = jsonencodeValue(attrs["sort"]);
188
+ if (attrs["filter"] !== undefined && filter === undefined) {
189
+ ctx.diagnostics.push(`${where}: filter is not a jsonencode(...) expression; dropped`);
190
+ }
191
+ if (attrs["sort"] !== undefined && sort === undefined) {
192
+ ctx.diagnostics.push(`${where}: sort is not a jsonencode(...) expression; dropped`);
193
+ }
194
+ return {
195
+ key: scopedLabelToBagKey(owner.ownerTfLabel, label, scope),
196
+ name,
197
+ columns,
198
+ ...(typeof attrs["allow_record_creation"] === "boolean" && { allowRecordCreation: attrs["allow_record_creation"] }),
199
+ ...(typeof attrs["density"] === "string" && { density: attrs["density"] }),
200
+ ...(typeof attrs["rows"] === "number" && { rows: attrs["rows"] }),
201
+ ...(filter !== undefined && { filter }),
202
+ ...(sort !== undefined && { sort }),
203
+ };
204
+ }
205
+ /** `jsonencode({...})` → its decoded payload; undefined for any other shape. */
206
+ function jsonencodeValue(v) {
207
+ return v !== undefined && isTfExpr(v) && v.$expr === "jsonencode" ? v.value : undefined;
208
+ }
209
+ function managedViewOrderFromTf(block, owner, keyByTfLabel, ctx) {
210
+ const label = block.label ?? "?";
211
+ const attrs = block.attrs;
212
+ const where = `managed view order "${label}"`;
213
+ reportUnknownAttrs(attrs, KNOWN_MANAGED_VIEW_ORDER_ATTRS, where, "managedViewOrderFromTf", ctx);
214
+ const objectLabel = resourceRefLabel(attrs["object_id"], owner.type);
215
+ if (objectLabel !== owner.label) {
216
+ ctx.diagnostics.push(`${where}: object_id does not reference ${owner.type}.${owner.label}; skipped`);
217
+ return undefined;
218
+ }
219
+ const viewIdsAttr = attrs["view_ids"];
220
+ if (!Array.isArray(viewIdsAttr)) {
221
+ ctx.diagnostics.push(`${where}: view_ids is not a list; dropped`);
222
+ return undefined;
223
+ }
224
+ const order = [];
225
+ for (const v of viewIdsAttr) {
226
+ const tfLabel = resourceRefLabel(v, LIST_VIEW_RESOURCE_TYPE);
227
+ const key = tfLabel !== undefined ? keyByTfLabel.get(tfLabel) : undefined;
228
+ if (key === undefined) {
229
+ ctx.diagnostics.push(`${where}: a view_ids entry does not resolve to a known list view; dropped`);
230
+ continue;
231
+ }
232
+ order.push(key);
233
+ }
234
+ return order;
235
+ }
@@ -0,0 +1,24 @@
1
+ /** The view entity's registry entries (see src/graph/). */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ /**
4
+ * Layouts + list views are stream members folded into the app authoring file
5
+ * (inline), extracted by `appFromTf` — not own-file kinds.
6
+ */
7
+ export declare const viewModule: EntityKindModule;
8
+ /**
9
+ * `elementum_managed_view_order` is a singleton per aspect with no identity
10
+ * of its own — ei's export carries the OWNING APP's id as its import id
11
+ * (confirmed live against `prestonhigh`: both `elementum_app.prestonhigh`
12
+ * and `elementum_managed_view_order.preston_high_students_view_order` import
13
+ * the same platform id). Adopting it through the generic targeted-import
14
+ * gate would collide with the app's own state binding (same id, two
15
+ * addresses) — the gate correctly refuses to guess rather than silently
16
+ * mis-binding it. So: scoped for the build-vs-export (build does emit it, so a
17
+ * stream mismatch still gets caught) but NOT adoptable. Left unresolved:
18
+ * whether a plan/apply against an app whose view order already exists on
19
+ * the platform treats this as a safe no-op create or errors "already
20
+ * exists" — not yet verified live. Until confirmed, treat a fresh
21
+ * `elementum apply` on an adopted app with pre-existing list views as a real open
22
+ * risk, not a settled case.
23
+ */
24
+ export declare const managedViewOrderModule: EntityKindModule;