@elementumai/edk 0.9.2 → 0.9.6

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 (296) hide show
  1. package/README.md +34 -26
  2. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +1 -1
  3. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
  4. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
  5. package/dist-sdk/pull/util.d.ts +1 -1
  6. package/dist-sdk/pull/util.js +3 -3
  7. package/dist-sdk/src/catalog/factories.d.ts +49 -10
  8. package/dist-sdk/src/catalog/factories.js +94 -13
  9. package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
  10. package/dist-sdk/src/catalog/from-authoring.js +7 -7
  11. package/dist-sdk/src/catalog/index.d.ts +2 -2
  12. package/dist-sdk/src/catalog/index.js +1 -1
  13. package/dist-sdk/src/catalog/org.js +62 -4
  14. package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
  15. package/dist-sdk/src/catalog/render-helpers.js +1 -1
  16. package/dist-sdk/src/catalog/render.d.ts +1 -0
  17. package/dist-sdk/src/catalog/render.js +2 -2
  18. package/dist-sdk/src/catalog/token.js +11 -4
  19. package/dist-sdk/src/catalog/types.d.ts +33 -4
  20. package/dist-sdk/src/catalog/types.js +5 -0
  21. package/dist-sdk/src/core/index.d.ts +10 -10
  22. package/dist-sdk/src/core/index.js +9 -9
  23. package/dist-sdk/src/core/render-tree.d.ts +1 -1
  24. package/dist-sdk/src/core/render-tree.js +1 -2
  25. package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
  26. package/dist-sdk/src/core/types/ai-provider.js +1 -1
  27. package/dist-sdk/src/core/types/app.d.ts +66 -30
  28. package/dist-sdk/src/core/types/app.js +2 -2
  29. package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
  30. package/dist-sdk/src/core/types/aspect-category.js +4 -4
  31. package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
  32. package/dist-sdk/src/core/types/cloud-link.js +3 -3
  33. package/dist-sdk/src/core/types/display-block.d.ts +2 -2
  34. package/dist-sdk/src/core/types/display-block.js +2 -2
  35. package/dist-sdk/src/core/types/group.d.ts +1 -1
  36. package/dist-sdk/src/core/types/group.js +1 -1
  37. package/dist-sdk/src/core/types/user.d.ts +1 -1
  38. package/dist-sdk/src/core/types/user.js +1 -1
  39. package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
  40. package/dist-sdk/src/engine/build/context.d.ts +20 -13
  41. package/dist-sdk/src/engine/entity.d.ts +1 -1
  42. package/dist-sdk/src/engine/pull/context.d.ts +34 -0
  43. package/dist-sdk/src/engine/pull/context.js +14 -0
  44. package/dist-sdk/src/engine/pull/org.d.ts +9 -0
  45. package/dist-sdk/src/engine/pull/org.js +33 -0
  46. package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
  47. package/dist-sdk/src/engine/pull/ref-only.js +204 -0
  48. package/dist-sdk/src/engine/tf/expr.d.ts +6 -2
  49. package/dist-sdk/src/engine/tf/expr.js +18 -13
  50. package/dist-sdk/src/engine/tf/index.d.ts +1 -1
  51. package/dist-sdk/src/engine/tf/index.js +1 -1
  52. package/dist-sdk/src/engine/tf/model.d.ts +8 -1
  53. package/dist-sdk/src/engine/tf/model.js +4 -0
  54. package/dist-sdk/src/engine/tf/parse.js +13 -2
  55. package/dist-sdk/src/engine/tf/render.js +4 -0
  56. package/dist-sdk/src/entities/access-policy/build.d.ts +4 -5
  57. package/dist-sdk/src/entities/access-policy/build.js +1 -1
  58. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +4 -4
  59. package/dist-sdk/src/entities/access-policy/from-tf.js +12 -13
  60. package/dist-sdk/src/entities/access-policy/principal.d.ts +14 -4
  61. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +14 -2
  62. package/dist-sdk/src/entities/access-policy/to-tf.js +36 -6
  63. package/dist-sdk/src/entities/agent/build.d.ts +3 -3
  64. package/dist-sdk/src/entities/agent/build.js +5 -5
  65. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +6 -1
  66. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -18
  67. package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
  68. package/dist-sdk/src/entities/agent/from-tf.js +12 -4
  69. package/dist-sdk/src/entities/agent/index.d.ts +2 -2
  70. package/dist-sdk/src/entities/agent/index.js +1 -1
  71. package/dist-sdk/src/entities/agent/module.js +2 -0
  72. package/dist-sdk/src/entities/agent/to-tf.d.ts +5 -2
  73. package/dist-sdk/src/entities/agent/to-tf.js +56 -8
  74. package/dist-sdk/src/entities/agent/tools.d.ts +38 -23
  75. package/dist-sdk/src/entities/agent/tools.js +21 -7
  76. package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
  77. package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
  78. package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
  79. package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
  80. package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
  81. package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
  82. package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
  83. package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
  84. package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
  85. package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
  86. package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
  87. package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
  88. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -7
  89. package/dist-sdk/src/entities/agent-tool/from-tf.js +48 -6
  90. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +10 -2
  91. package/dist-sdk/src/entities/agent-tool/to-tf.js +76 -28
  92. package/dist-sdk/src/entities/agent-tool/types.d.ts +0 -1
  93. package/dist-sdk/src/entities/agent-tool/types.js +10 -37
  94. package/dist-sdk/src/entities/app/build.d.ts +97 -42
  95. package/dist-sdk/src/entities/app/build.js +25 -14
  96. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +32 -24
  97. package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +1 -1
  98. package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +2 -0
  99. package/dist-sdk/src/entities/app/index.d.ts +11 -8
  100. package/dist-sdk/src/entities/app/index.js +10 -7
  101. package/dist-sdk/src/entities/app/module.js +2 -2
  102. package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
  103. package/dist-sdk/src/entities/app/to-tf.js +22 -6
  104. package/dist-sdk/src/entities/approval-chain/build.d.ts +1 -1
  105. package/dist-sdk/src/entities/approval-chain/build.js +5 -5
  106. package/dist-sdk/src/entities/approval-chain/index.d.ts +1 -1
  107. package/dist-sdk/src/entities/approval-chain/index.js +1 -1
  108. package/dist-sdk/src/entities/approval-chain/printer.js +2 -2
  109. package/dist-sdk/src/entities/automation/build.d.ts +172 -94
  110. package/dist-sdk/src/entities/automation/build.js +159 -68
  111. package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
  112. package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
  113. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +11 -4
  114. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
  115. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +164 -198
  116. package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -2
  117. package/dist-sdk/src/entities/automation/from-tf.js +510 -80
  118. package/dist-sdk/src/entities/automation/index.d.ts +9 -12
  119. package/dist-sdk/src/entities/automation/index.js +11 -13
  120. package/dist-sdk/src/entities/automation/module.js +74 -6
  121. package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
  122. package/dist-sdk/src/entities/automation/operators.js +10 -37
  123. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
  124. package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
  125. package/dist-sdk/src/entities/automation/script-code.js +13 -22
  126. package/dist-sdk/src/entities/automation/serialize.js +1 -1
  127. package/dist-sdk/src/entities/automation/tasks.d.ts +153 -89
  128. package/dist-sdk/src/entities/automation/tasks.js +64 -11
  129. package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -1
  130. package/dist-sdk/src/entities/automation/to-tf.js +342 -71
  131. package/dist-sdk/src/entities/automation/triggers.d.ts +17 -10
  132. package/dist-sdk/src/entities/automation/triggers.js +7 -1
  133. package/dist-sdk/src/entities/automation/types.d.ts +3 -2
  134. package/dist-sdk/src/entities/automation/types.js +3 -2
  135. package/dist-sdk/src/entities/chart/build.d.ts +95 -0
  136. package/dist-sdk/src/entities/chart/build.js +42 -0
  137. package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
  138. package/dist-sdk/src/entities/chart/from-tf.js +269 -0
  139. package/dist-sdk/src/entities/chart/index.d.ts +4 -0
  140. package/dist-sdk/src/entities/chart/index.js +3 -0
  141. package/dist-sdk/src/entities/chart/module.d.ts +3 -0
  142. package/dist-sdk/src/entities/chart/module.js +61 -0
  143. package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
  144. package/dist-sdk/src/entities/chart/printer.js +104 -0
  145. package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
  146. package/dist-sdk/src/entities/chart/to-tf.js +150 -0
  147. package/dist-sdk/src/entities/chart/types.d.ts +53 -0
  148. package/dist-sdk/src/entities/chart/types.js +22 -0
  149. package/dist-sdk/src/entities/dashboard/build.d.ts +34 -7
  150. package/dist-sdk/src/entities/dashboard/build.js +16 -1
  151. package/dist-sdk/src/entities/dashboard/from-tf.js +22 -4
  152. package/dist-sdk/src/entities/dashboard/to-tf.d.ts +16 -3
  153. package/dist-sdk/src/entities/dashboard/to-tf.js +37 -10
  154. package/dist-sdk/src/entities/datamine/module.js +1 -1
  155. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +4 -3
  156. package/dist-sdk/src/entities/dynamic-layout/build.js +1 -1
  157. package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
  158. package/dist-sdk/src/entities/dynamic-layout/dialect.js +43 -5
  159. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +12 -6
  160. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +10 -10
  161. package/dist-sdk/src/entities/element/build.d.ts +25 -32
  162. package/dist-sdk/src/entities/element/build.js +15 -32
  163. package/dist-sdk/src/entities/element/index.d.ts +7 -5
  164. package/dist-sdk/src/entities/element/index.js +7 -4
  165. package/dist-sdk/src/entities/element/module.js +7 -3
  166. package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
  167. package/dist-sdk/src/entities/element/to-tf.js +7 -3
  168. package/dist-sdk/src/entities/field/build.d.ts +51 -24
  169. package/dist-sdk/src/entities/field/build.js +31 -6
  170. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
  171. package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
  172. package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
  173. package/dist-sdk/src/entities/field/calc/date.js +120 -29
  174. package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
  175. package/dist-sdk/src/entities/field/calc/index.js +82 -139
  176. package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
  177. package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
  178. package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
  179. package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
  180. package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
  181. package/dist-sdk/src/entities/field/calc/text.js +43 -31
  182. package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
  183. package/dist-sdk/src/entities/field/calc/types.js +1 -22
  184. package/dist-sdk/src/entities/field/calc.d.ts +71 -48
  185. package/dist-sdk/src/entities/field/calc.js +5 -15
  186. package/dist-sdk/src/entities/field/calculation-types.js +10 -3
  187. package/dist-sdk/src/entities/field/from-tf.js +156 -10
  188. package/dist-sdk/src/entities/field/locals.d.ts +11 -3
  189. package/dist-sdk/src/entities/field/locals.js +15 -2
  190. package/dist-sdk/src/entities/field/module.js +23 -6
  191. package/dist-sdk/src/entities/field/record-shape.d.ts +24 -10
  192. package/dist-sdk/src/entities/field/to-tf.d.ts +40 -1
  193. package/dist-sdk/src/entities/field/to-tf.js +293 -35
  194. package/dist-sdk/src/entities/field/types.d.ts +1 -1
  195. package/dist-sdk/src/entities/field/types.js +7 -1
  196. package/dist-sdk/src/entities/file-reader/build.d.ts +5 -0
  197. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +1 -1
  198. package/dist-sdk/src/entities/org/cloud-link.js +4 -5
  199. package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
  200. package/dist-sdk/src/entities/org/email-alias.js +12 -0
  201. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  202. package/dist-sdk/src/entities/org/index.js +1 -0
  203. package/dist-sdk/src/entities/org/phone-provider.js +4 -7
  204. package/dist-sdk/src/entities/organization/build.d.ts +214 -2
  205. package/dist-sdk/src/entities/organization/build.js +145 -4
  206. package/dist-sdk/src/entities/organization/index.d.ts +1 -1
  207. package/dist-sdk/src/entities/organization/index.js +1 -1
  208. package/dist-sdk/src/entities/organization/module.js +4 -1
  209. package/dist-sdk/src/entities/organization/to-tf.d.ts +1 -0
  210. package/dist-sdk/src/entities/organization/to-tf.js +118 -1
  211. package/dist-sdk/src/entities/phone-service/build.d.ts +1 -1
  212. package/dist-sdk/src/entities/phone-service/build.js +2 -2
  213. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +5 -3
  214. package/dist-sdk/src/entities/phone-service/index.d.ts +1 -1
  215. package/dist-sdk/src/entities/phone-service/index.js +1 -1
  216. package/dist-sdk/src/entities/phone-service/types.js +1 -1
  217. package/dist-sdk/src/entities/record-create-form/to-tf.js +9 -1
  218. package/dist-sdk/src/entities/relationship/to-tf.d.ts +1 -0
  219. package/dist-sdk/src/entities/relationship/to-tf.js +5 -13
  220. package/dist-sdk/src/entities/search-table/build.d.ts +4 -4
  221. package/dist-sdk/src/entities/search-table/build.js +13 -13
  222. package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
  223. package/dist-sdk/src/entities/search-table/index.js +2 -2
  224. package/dist-sdk/src/entities/search-table/printer.js +5 -5
  225. package/dist-sdk/src/entities/service-account/to-tf.d.ts +21 -0
  226. package/dist-sdk/src/entities/service-account/to-tf.js +32 -1
  227. package/dist-sdk/src/entities/shared/context.d.ts +25 -24
  228. package/dist-sdk/src/entities/shared/context.js +36 -35
  229. package/dist-sdk/src/entities/shared/filters/ast.d.ts +10 -3
  230. package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
  231. package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -1
  232. package/dist-sdk/src/entities/shared/filters/index.js +11 -4
  233. package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
  234. package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
  235. package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
  236. package/dist-sdk/src/entities/shared/ref.js +8 -3
  237. package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
  238. package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
  239. package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
  240. package/dist-sdk/src/entities/skill/build.d.ts +2 -2
  241. package/dist-sdk/src/entities/skill/build.js +3 -3
  242. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +1 -1
  243. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +26 -7
  244. package/dist-sdk/src/entities/skill/index.d.ts +1 -1
  245. package/dist-sdk/src/entities/skill/index.js +1 -1
  246. package/dist-sdk/src/entities/skill/module.js +2 -2
  247. package/dist-sdk/src/entities/skill/to-tf.d.ts +1 -1
  248. package/dist-sdk/src/entities/skill/to-tf.js +2 -2
  249. package/dist-sdk/src/entities/skill/tools.d.ts +4 -3
  250. package/dist-sdk/src/entities/skill/tools.js +4 -3
  251. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +13 -0
  252. package/dist-sdk/src/entities/skill-tool/from-tf.js +42 -0
  253. package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -6
  254. package/dist-sdk/src/entities/table/build.d.ts +1 -1
  255. package/dist-sdk/src/entities/table/build.js +9 -9
  256. package/dist-sdk/src/entities/table/catalog-render.js +9 -1
  257. package/dist-sdk/src/entities/table/deserializer/normalize.js +4 -4
  258. package/dist-sdk/src/entities/table/fields/types.d.ts +1 -1
  259. package/dist-sdk/src/entities/table/fields/types.js +1 -1
  260. package/dist-sdk/src/entities/table/index.d.ts +2 -2
  261. package/dist-sdk/src/entities/table/index.js +3 -3
  262. package/dist-sdk/src/entities/table/module.js +1 -1
  263. package/dist-sdk/src/entities/table/to-tf.js +22 -30
  264. package/dist-sdk/src/entities/task/build.d.ts +1 -1
  265. package/dist-sdk/src/entities/task/build.js +5 -5
  266. package/dist-sdk/src/entities/task/index.d.ts +1 -1
  267. package/dist-sdk/src/entities/task/index.js +1 -1
  268. package/dist-sdk/src/entities/view/build.d.ts +46 -0
  269. package/dist-sdk/src/entities/view/build.js +19 -0
  270. package/dist-sdk/src/entities/view/from-tf.js +68 -18
  271. package/dist-sdk/src/entities/view/module.d.ts +6 -13
  272. package/dist-sdk/src/entities/view/module.js +7 -14
  273. package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
  274. package/dist-sdk/src/entities/view/sharing.js +6 -0
  275. package/dist-sdk/src/entities/view/to-tf.d.ts +21 -19
  276. package/dist-sdk/src/entities/view/to-tf.js +61 -26
  277. package/dist-sdk/src/entities/view/types.js +3 -0
  278. package/dist-sdk/src/entities/visual-flow/build.d.ts +1 -1
  279. package/dist-sdk/src/entities/visual-flow/build.js +8 -8
  280. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
  281. package/dist-sdk/src/entities/visual-flow/index.js +1 -1
  282. package/dist-sdk/src/entities/visual-flow/module.js +1 -1
  283. package/dist-sdk/src/entities/visual-flow/printer.js +3 -3
  284. package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +1 -0
  285. package/dist-sdk/src/entities/visual-flow/to-tf.js +3 -7
  286. package/dist-sdk/src/entities/widget/to-tf.d.ts +1 -0
  287. package/dist-sdk/src/entities/widget/to-tf.js +9 -7
  288. package/dist-sdk/src/graph/index.d.ts +5 -1
  289. package/dist-sdk/src/graph/index.js +4 -1
  290. package/dist-sdk/src/graph/modules.js +6 -1
  291. package/dist-sdk/src/graph/types.d.ts +52 -1
  292. package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
  293. package/dist-sdk/src/internal/safe-identifier.js +13 -0
  294. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  295. package/dist-sdk/src/internal/sdk-package.js +1 -0
  296. package/package.json +12 -3
package/README.md CHANGED
@@ -15,7 +15,7 @@ the bridge and OpenTofu; neither is a separate public executable or checkout.
15
15
  Install the authenticated macOS or Linux x64 toolchain:
16
16
 
17
17
  ```sh
18
- curl -fsSL https://elementum-toolchain-distribution.vercel.app | sh
18
+ curl -fsSL https://install.elementum.tools | sh
19
19
  elementum init
20
20
  ```
21
21
 
@@ -247,24 +247,23 @@ tools, and supported automations. A file target renders the first export with
247
247
  Import public package subpaths, not repository-relative modules:
248
248
 
249
249
  ```ts
250
- import { calc, defineApp } from "@elementumai/edk/app";
251
- import { defineElement } from "@elementumai/edk/elements";
250
+ import { calc, app } from "@elementumai/edk/app";
251
+ import { element } from "@elementumai/edk/elements";
252
252
  import {
253
- defineAutomation,
254
- defineWorkflow,
255
- executeScript,
253
+ actions,
254
+ automation,
256
255
  onDemand,
257
256
  } from "@elementumai/edk/automations";
258
257
  import {
259
258
  agentCreateRecord,
260
259
  agentRunAutomation,
261
260
  agentSearchRecords,
262
- defineAgent,
261
+ agent,
263
262
  } from "@elementumai/edk/agents";
264
- import { defineSkill } from "@elementumai/edk/agents/skills";
265
- import { defineLinkedSearchTable, defineSearchTable, searchTableDuration } from "@elementumai/edk/searchTables";
266
- import { defineApprovalProcess } from "@elementumai/edk/approvalProcesses";
267
- import { defineTable } from "@elementumai/edk/tables";
263
+ import { skill } from "@elementumai/edk/agents/skills";
264
+ import { linkedSearchTable, searchTable, searchTableDuration } from "@elementumai/edk/searchTables";
265
+ import { approvalProcess } from "@elementumai/edk/approvalProcesses";
266
+ import { table } from "@elementumai/edk/tables";
268
267
  import { eq } from "@elementumai/edk/core/filters";
269
268
  import catalog from "@catalog";
270
269
  ```
@@ -278,7 +277,9 @@ EDK uses names and typed tokens in source, with the configured OpenTofu state
278
277
  backend providing platform identity:
279
278
 
280
279
  1. `pull org --data-only` writes org reference bags to `org.ts`, including
281
- cloud links, categories, connectors, and groups.
280
+ cloud links, phone providers, categories, connectors, and groups. Plain
281
+ `pull org` also writes editable categories, groups, CloudLinks, email
282
+ aliases, and Twilio providers to `organization.ts`.
282
283
  2. `pull app` or `pull element` writes editable source and adopts existing
283
284
  resources into the required locking remote backend.
284
285
  3. `generated/catalog.ts` is a pure barrel derived from the authored file tree.
@@ -292,27 +293,34 @@ is the Terraform label in camelCase through a lossless label conversion. For
292
293
  example, a field's key in `fields: {}` is its identity; its display `name` can
293
294
  change.
294
295
 
295
- Configured builders such as `defineAgent` and `defineAutomation` return
296
+ Organization credentials use `secret("variableName")`; the build emits a
297
+ sensitive Terraform variable and reads its value from `TF_VAR_variableName`.
298
+ Pull never serializes write-only credentials. It leaves `redactedSecret(...)`
299
+ or `unavailableValue(...)` markers and reports those addresses as skipped until
300
+ the missing input is supplied, while still adopting fully recoverable org
301
+ resources.
302
+
303
+ Configured builders such as `agent` and `automation` return
296
304
  `{ ref(refName), def(refName) }`. Workspace discovery supplies the ref name from
297
305
  the file path. There is no `.deploy()` method.
298
306
 
299
307
  ## Automation example
300
308
 
301
- The Terraform path currently round-trips on-demand triggers plus execute-script
302
- and create-variable tasks. Other typed trigger/task factories remain available
303
- to the authoring API but are reported as unsupported by `build` until their
304
- Terraform mappings land.
309
+ The Terraform path round-trips typed triggers and actions. Public authoring uses
310
+ direct fluent action methods; provider task resource names remain an internal
311
+ wire concern.
305
312
 
306
313
  ```ts
307
- import { defineAutomation, onDemand } from "@elementumai/edk/automations";
314
+ import { automation, onDemand } from "@elementumai/edk/automations";
308
315
  import { template } from "@elementumai/edk/core";
309
316
  import catalog from "@catalog";
310
317
 
311
- export default defineAutomation({
318
+ export default automation({
312
319
  name: "Greet New Student",
313
320
  app: catalog.students,
314
- workflowRevision: "1.0.0",
315
- workflow: onDemand({ STUDENT_NAME: "text" })
321
+ revision: "1.0.0",
322
+ actions: actions()
323
+ .trigger(onDemand({ STUDENT_NAME: "text" }))
316
324
  .setVariable("GREETING", {
317
325
  value: (ctx) => template("Welcome, ", ctx.trigger.STUDENT_NAME),
318
326
  })
@@ -323,14 +331,14 @@ export default defineAutomation({
323
331
  }),
324
332
  })
325
333
  .outputs((ctx) => ({
326
- message: ctx.tasks.FORMAT_GREETING.result.message,
334
+ message: ctx.actions.FORMAT_GREETING.result.message,
327
335
  })),
328
336
  });
329
337
  ```
330
338
 
331
339
  The file path supplies the automation ref; `app` is the strongly typed owning app ref.
332
- `workflowRevision` is required SemVer and is the explicit publish gate. Editing
333
- tasks or triggers updates the draft; bump the revision only when that draft
340
+ `revision` is required SemVer and is the explicit publish gate. Editing
341
+ actions or triggers updates the draft; bump the revision only when that draft
334
342
  should be published.
335
343
 
336
344
  ## Agent example
@@ -339,11 +347,11 @@ Agents live under `apps/<appRef>/agents/<agentRef>.ts`. Their connector comes
339
347
  from the org catalog, while app and field targets come from `@catalog`:
340
348
 
341
349
  ```ts
342
- import { agentSearchRecords, defineAgent } from "@elementumai/edk/agents";
350
+ import { agentSearchRecords, agent } from "@elementumai/edk/agents";
343
351
  import catalog from "@catalog";
344
352
  import { org } from "../../../org.js";
345
353
 
346
- export default defineAgent({
354
+ export default agent({
347
355
  name: "Support Agent",
348
356
  app: catalog.support,
349
357
  connector: org.connectors.claudeSonnet,
@@ -149,7 +149,7 @@ export interface Workflow {
149
149
  * `workflowCurrent` and `workflowDraft` are antman-aliased fields
150
150
  * (`current` / `draft` on the underlying GraphQL `Automation`).
151
151
  * Each carries its own `Workflow.id` (a versioned workflow id) —
152
- * that's what `defineAutomation.fromJSON(workflowId)` needs. Pull
152
+ * that's what `automation.fromJSON(workflowId)` needs. Pull
153
153
  * flows prefer `workflowDraft.id` when present (the in-progress
154
154
  * edit) and fall back to `workflowCurrent.id` (the deployed live
155
155
  * version).
@@ -18,7 +18,7 @@
18
18
  * for org-scoped skills. The EDK builder today only supports
19
19
  * authoring app-scoped skills, so the pull deserializer drops
20
20
  * org-scoped skills with a structured miss (the skill body is still
21
- * readable, but no `defineSkill({...})` source is emitted).
21
+ * readable, but no `skill({...})` source is emitted).
22
22
  */
23
23
  import type { Connection } from "../../../models/connection.js";
24
24
  import type { SkillTool } from "./skill-tool.js";
@@ -18,6 +18,6 @@
18
18
  * for org-scoped skills. The EDK builder today only supports
19
19
  * authoring app-scoped skills, so the pull deserializer drops
20
20
  * org-scoped skills with a structured miss (the skill body is still
21
- * readable, but no `defineSkill({...})` source is emitted).
21
+ * readable, but no `skill({...})` source is emitted).
22
22
  */
23
23
  export {};
@@ -3,7 +3,7 @@
3
3
  * translates wire data into EDK TypeScript source — both the
4
4
  * `defineX.fromJSON` deserializer pipeline and the
5
5
  * `fetch-app-definition` renderer that emits standalone
6
- * `defineApp({...})` files.
6
+ * `app({...})` files.
7
7
  *
8
8
  * Helpers that turn out to be useful across more than one of those
9
9
  * paths live here so we have a single implementation of each
@@ -3,7 +3,7 @@
3
3
  * translates wire data into EDK TypeScript source — both the
4
4
  * `defineX.fromJSON` deserializer pipeline and the
5
5
  * `fetch-app-definition` renderer that emits standalone
6
- * `defineApp({...})` files.
6
+ * `app({...})` files.
7
7
  *
8
8
  * Helpers that turn out to be useful across more than one of those
9
9
  * paths live here so we have a single implementation of each
@@ -173,10 +173,10 @@ export function unwrapConnection(conn) {
173
173
  * - `aspects/serializer/index.ts` (no-delete picklist guard) and
174
174
  * `normalizePicklistValueIds` drop non-UUID `id` slots on
175
175
  * picklist values for the same reason.
176
- * - `aspects/index.ts` routes `defineApp({...}).deploy()` to PUT
176
+ * - `aspects/index.ts` routes `app({...}).deploy()` to PUT
177
177
  * when `app.id` is a real aspect UUID (existing aspect, update
178
178
  * path) and POST when it's a placeholder (new aspect, create
179
- * path). Pulled sources from `defineApp.fromJSON` always carry
179
+ * path). Pulled sources from `app.fromJSON` always carry
180
180
  * a real UUID, so the round-trip naturally goes through update.
181
181
  *
182
182
  * Lives in `pull/util.ts` next to the other shared identifier helpers
@@ -19,7 +19,7 @@
19
19
  * nothing reads those interim values.
20
20
  */
21
21
  import type { AiProviderLlmModel, AiProviderType } from "./ai-provider-models.js";
22
- import type { AgentRef, AiProviderRef, ApprovalChainRef, AutomationCatalogRef, CatalogRef, CategoryRef, CloudLinkRef, ConnectorRef, DatamineRef, GroupRef, PhoneProviderRef, PhoneServiceRef, FileReaderCatalogRef, DocumentModelFieldRef, FieldRef, OutputPropertyRef, SearchTableRef, SkillRef, TableColumnRef, TableRef, TriggerParameterRef } from "./types.js";
22
+ import type { AgentEvaluationRef, AgentRef, AppCatalogRef, AiProviderRef, ApprovalChainRef, AutomationCatalogRef, CatalogRef, CategoryRef, ChartRef, DashboardRef, CloudLinkRef, ConnectorRef, DatamineRef, GroupRef, PhoneProviderRef, PhoneServiceRef, FileReaderCatalogRef, DocumentModelFieldRef, ElementCatalogRef, FieldRef, OutputPropertyRef, SearchTableRef, StoredFunctionRef, StoredFunctionScalarType, SkillRef, TableColumnRef, TableRef, TriggerParameterRef } from "./types.js";
23
23
  /** Fixed platform user-directory schema used by userSearch filters. */
24
24
  export declare const usersCatalog: {
25
25
  readonly fields: {
@@ -50,9 +50,13 @@ export declare const usersCatalog: {
50
50
  };
51
51
  };
52
52
  /** Lightweight typed owner token for tests and generated bootstrap code. Prefer the generated catalog in app source. */
53
- export declare function appRef<const RefName extends string>(refName: RefName, name?: string): CatalogRef<"app", RefName>;
53
+ export declare function appRef<const RefName extends string>(refName: RefName, name?: string, namespace?: string): CatalogRef<"app", RefName> & {
54
+ readonly namespace?: string;
55
+ };
54
56
  /** Lightweight typed element-owner token. Prefer the generated catalog in authored workspace source. */
55
- export declare function elementRef<const RefName extends string>(refName: RefName, name?: string): CatalogRef<"element", RefName>;
57
+ export declare function elementRef<const RefName extends string>(refName: RefName, name?: string, namespace?: string): CatalogRef<"element", RefName> & {
58
+ readonly namespace?: string;
59
+ };
56
60
  /** An app/element catalog's bags: reference-only kinds plus behavioral kinds sourced from authoring files. */
57
61
  interface AppCatalogBags {
58
62
  readonly fields?: Record<string, FieldRef>;
@@ -60,10 +64,13 @@ interface AppCatalogBags {
60
64
  readonly fileReaders?: Record<string, FileReaderCatalogRef>;
61
65
  readonly automations?: Record<string, AutomationCatalogRef>;
62
66
  readonly agents?: Record<string, AgentRef>;
67
+ readonly evaluations?: Record<string, AgentEvaluationRef>;
68
+ readonly charts?: Record<string, ChartRef>;
63
69
  readonly skills?: Record<string, SkillRef>;
64
70
  readonly approvalChains?: Record<string, ApprovalChainRef>;
65
71
  readonly phoneServices?: Record<string, PhoneServiceRef>;
66
72
  }
73
+ type ElementCatalogBags = Omit<AppCatalogBags, "charts">;
67
74
  /** Preserve an app catalog's literal owner and agent keys after parent stamping. */
68
75
  type WithOwnedAgents<B extends AppCatalogBags, Parent extends string> = B extends {
69
76
  readonly agents: infer A extends Record<string, AgentRef>;
@@ -72,6 +79,14 @@ type WithOwnedAgents<B extends AppCatalogBags, Parent extends string> = B extend
72
79
  readonly [K in keyof A]: A[K] & AgentRef<Parent, Extract<K, string>>;
73
80
  };
74
81
  } : B;
82
+ type WithOwnedCharts<B extends AppCatalogBags, Parent extends string> = B extends {
83
+ readonly charts: infer C extends Record<string, ChartRef>;
84
+ } ? Omit<B, "charts"> & {
85
+ readonly charts: {
86
+ readonly [K in keyof C]: C[K] & ChartRef<Parent, Extract<K, string>>;
87
+ };
88
+ } : B;
89
+ type WithOwnedCatalogChildren<B extends AppCatalogBags, Parent extends string> = WithOwnedCharts<WithOwnedAgents<B, Parent>, Parent>;
75
90
  /**
76
91
  * Automation ref. Accepts optional `trigger` and `outputs` bags of typed parameter/property refs —
77
92
  * e.g. `automationRef({ trigger: { topic: triggerParameterRef({ name: "topic", parent: "auto" }) } })`
@@ -135,6 +150,20 @@ export declare function agentRef(opts?: {
135
150
  readonly name?: string;
136
151
  readonly parent?: string;
137
152
  }): AgentRef;
153
+ export declare function agentEvaluationRef(opts?: {
154
+ readonly name?: string;
155
+ readonly parent?: string;
156
+ }): AgentEvaluationRef;
157
+ export declare function chartRef<const Parent extends string = string, const RefName extends string = string>(opts?: {
158
+ readonly refName?: RefName;
159
+ readonly name?: string;
160
+ readonly parent?: Parent;
161
+ }): ChartRef<Parent, RefName>;
162
+ export declare function dashboardRef<const Parent extends string = string, const RefName extends string = string>(opts?: {
163
+ readonly refName?: RefName;
164
+ readonly name?: string;
165
+ readonly parent?: Parent;
166
+ }): DashboardRef<Parent, RefName>;
138
167
  /**
139
168
  * Skill ref — no required arguments, same shape as {@link agentRef}. `handle` and `parent`
140
169
  * are injected by the enclosing `appCatalog`/`elementCatalog`; `name` defaults to `""`.
@@ -142,6 +171,7 @@ export declare function agentRef(opts?: {
142
171
  export declare function skillRef(opts?: {
143
172
  readonly name?: string;
144
173
  readonly parent?: string;
174
+ readonly parentName?: string;
145
175
  }): SkillRef;
146
176
  export declare function phoneServiceRef(opts?: {
147
177
  readonly name?: string;
@@ -180,17 +210,24 @@ export declare const connectorRef: (opts: Omit<import("./types.js").AiServiceRef
180
210
  * its literal) — same `const T extends ...` trick as {@link fieldRef} so
181
211
  * `type: "anthropic"` narrows which models are valid at each call site.
182
212
  */
183
- export declare function defineAiProvider<T extends AiProviderType, M extends Readonly<Record<string, ConnectorRef | AiProviderLlmModel<T>>> | undefined = undefined>(opts: {
213
+ export declare function aiProvider<T extends AiProviderType, M extends Readonly<Record<string, ConnectorRef | AiProviderLlmModel<T>>> | undefined = undefined>(opts: {
184
214
  readonly name: string;
185
215
  readonly type: T;
186
216
  readonly models?: M;
187
217
  }): AiProviderRef<T> & {
188
218
  readonly models: M;
189
219
  };
190
- export declare const cloudLinkRef: (opts: Omit<CloudLinkRef, "refName" | "__kind">) => Omit<CloudLinkRef, "refName" | "__kind"> & {
191
- readonly __kind: "cloudLink";
192
- readonly refName: string;
220
+ export declare function cloudLinkRef<const Functions extends Readonly<Record<string, StoredFunctionRef>> | undefined = undefined>(opts: {
221
+ readonly name: string;
222
+ readonly storedFunctions?: Functions;
223
+ }): CloudLinkRef & {
224
+ readonly storedFunctions: Functions;
193
225
  };
226
+ export declare function storedFunctionRef<const Parameters extends readonly StoredFunctionScalarType[], const Result extends StoredFunctionScalarType>(opts: {
227
+ readonly name: string;
228
+ readonly parameters: Parameters;
229
+ readonly result: Result;
230
+ }): StoredFunctionRef<Parameters, Result>;
194
231
  export declare const categoryRef: (opts: Omit<CategoryRef, "refName" | "__kind">) => Omit<CategoryRef, "refName" | "__kind"> & {
195
232
  readonly __kind: "category";
196
233
  readonly refName: string;
@@ -245,12 +282,14 @@ export declare const fieldRef: <const T extends Omit<FieldRef, "__kind" | "refNa
245
282
  export declare function appCatalog<const RefName extends string, B extends AppCatalogBags>(identity: {
246
283
  readonly refName: RefName;
247
284
  readonly name: string;
248
- }, bags: B): CatalogRef<"app", RefName> & WithOwnedAgents<B, RefName>;
285
+ readonly namespace?: string;
286
+ }, bags: B): AppCatalogRef<RefName> & WithOwnedCatalogChildren<B, RefName>;
249
287
  /** Same as {@link appCatalog}, but for an element catalog root. */
250
- export declare function elementCatalog<const RefName extends string, B extends AppCatalogBags>(identity: {
288
+ export declare function elementCatalog<const RefName extends string, B extends ElementCatalogBags>(identity: {
251
289
  readonly refName: RefName;
252
290
  readonly name: string;
253
- }, bags: B): CatalogRef<"element", RefName> & B;
291
+ readonly namespace?: string;
292
+ }, bags: B): ElementCatalogRef<RefName> & B;
254
293
  /**
255
294
  * Assemble the org catalog object. Produces `{ handle: "org", name: "Org", ...bags }`.
256
295
  * No `__kind` — the org is not a `CatalogRef` kind and is referenced only as
@@ -8,12 +8,12 @@ export const usersCatalog = {
8
8
  },
9
9
  };
10
10
  /** Lightweight typed owner token for tests and generated bootstrap code. Prefer the generated catalog in app source. */
11
- export function appRef(refName, name = refName) {
12
- return { __kind: "app", refName, name };
11
+ export function appRef(refName, name = refName, namespace) {
12
+ return { __kind: "app", refName, name, ...(namespace !== undefined ? { namespace } : {}) };
13
13
  }
14
14
  /** Lightweight typed element-owner token. Prefer the generated catalog in authored workspace source. */
15
- export function elementRef(refName, name = refName) {
16
- return { __kind: "element", refName, name };
15
+ export function elementRef(refName, name = refName, namespace) {
16
+ return { __kind: "element", refName, name, ...(namespace !== undefined ? { namespace } : {}) };
17
17
  }
18
18
  /** Build a ref-kind factory: no identity parameter, `.refName` defaults to `name` (stamped over by the enclosing bag). */
19
19
  function refFactory(kind) {
@@ -76,12 +76,27 @@ export function outputPropertyRef(opts) {
76
76
  export function agentRef(opts) {
77
77
  return { __kind: "agent", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
78
78
  }
79
+ export function agentEvaluationRef(opts) {
80
+ return { __kind: "agent-evaluation", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
81
+ }
82
+ export function chartRef(opts) {
83
+ return { __kind: "chart", refName: opts?.refName ?? "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
84
+ }
85
+ export function dashboardRef(opts) {
86
+ return { __kind: "dashboard", refName: opts?.refName ?? "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
87
+ }
79
88
  /**
80
89
  * Skill ref — no required arguments, same shape as {@link agentRef}. `handle` and `parent`
81
90
  * are injected by the enclosing `appCatalog`/`elementCatalog`; `name` defaults to `""`.
82
91
  */
83
92
  export function skillRef(opts) {
84
- return { __kind: "skill", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
93
+ return {
94
+ __kind: "skill",
95
+ refName: "",
96
+ name: opts?.name ?? "",
97
+ ...(opts?.parent !== undefined ? { parent: opts.parent } : {}),
98
+ ...(opts?.parentName !== undefined ? { parentName: opts.parentName } : {}),
99
+ };
85
100
  }
86
101
  export function phoneServiceRef(opts) {
87
102
  return { __kind: "phone-service", refName: "", name: opts?.name ?? "", ...(opts?.parent !== undefined ? { parent: opts.parent } : {}) };
@@ -126,7 +141,7 @@ export const connectorRef = refFactory("connector");
126
141
  * its literal) — same `const T extends ...` trick as {@link fieldRef} so
127
142
  * `type: "anthropic"` narrows which models are valid at each call site.
128
143
  */
129
- export function defineAiProvider(opts) {
144
+ export function aiProvider(opts) {
130
145
  return {
131
146
  __kind: "aiProvider",
132
147
  refName: opts.name,
@@ -135,7 +150,27 @@ export function defineAiProvider(opts) {
135
150
  ...(opts.models !== undefined ? { models: opts.models } : {}),
136
151
  };
137
152
  }
138
- export const cloudLinkRef = refFactory("cloudLink");
153
+ export function cloudLinkRef(opts) {
154
+ const functions = opts.storedFunctions === undefined
155
+ ? undefined
156
+ : Object.fromEntries(Object.entries(opts.storedFunctions).map(([refName, fn]) => [refName, { ...fn, refName, parent: "" }]));
157
+ return {
158
+ __kind: "cloudLink",
159
+ refName: opts.name,
160
+ name: opts.name,
161
+ ...(functions !== undefined ? { storedFunctions: functions } : {}),
162
+ };
163
+ }
164
+ export function storedFunctionRef(opts) {
165
+ return {
166
+ __kind: "storedFunction",
167
+ refName: opts.name,
168
+ name: opts.name,
169
+ parent: "",
170
+ parameterTypes: opts.parameters,
171
+ resultType: opts.result,
172
+ };
173
+ }
139
174
  export const categoryRef = refFactory("category");
140
175
  export const groupRef = refFactory("group");
141
176
  export const phoneProviderRef = refFactory("phoneProvider");
@@ -208,7 +243,36 @@ function stampFieldRefs(bag, identity, parentKind) {
208
243
  return undefined;
209
244
  const out = {};
210
245
  for (const [refName, ref] of Object.entries(bag)) {
211
- out[refName] = { ...ref, refName, parent: identity.refName, parentKind, parentName: identity.name };
246
+ out[refName] = {
247
+ ...ref,
248
+ refName,
249
+ parent: identity.refName,
250
+ parentKind,
251
+ parentName: identity.name,
252
+ ...(identity.namespace !== undefined ? { parentNamespace: identity.namespace } : {}),
253
+ };
254
+ }
255
+ return out;
256
+ }
257
+ function stampOwnedRefs(bag, identity, parentKind) {
258
+ if (bag === undefined)
259
+ return undefined;
260
+ return Object.fromEntries(Object.entries(bag).map(([refName, ref]) => [refName, {
261
+ ...ref,
262
+ refName,
263
+ parent: identity.refName,
264
+ parentKind,
265
+ parentName: identity.name,
266
+ ...(identity.namespace !== undefined ? { parentNamespace: identity.namespace } : {}),
267
+ }]));
268
+ }
269
+ /** Stamp the owning app's stable key and display name onto each skill token. */
270
+ function stampSkillRefs(bag, identity) {
271
+ if (bag === undefined)
272
+ return undefined;
273
+ const out = {};
274
+ for (const [refName, ref] of Object.entries(bag)) {
275
+ out[refName] = { ...ref, refName, parent: identity.refName, parentName: identity.name };
212
276
  }
213
277
  return out;
214
278
  }
@@ -248,13 +312,16 @@ export function appCatalog(identity, bags) {
248
312
  __kind: "app",
249
313
  refName: identity.refName,
250
314
  name: identity.name,
315
+ ...(identity.namespace !== undefined ? { namespace: identity.namespace } : {}),
251
316
  ...bags,
252
317
  fields: stampFieldRefs(bags.fields, identity, "app") ?? {},
253
318
  searchTables: withOwnKeyAsHandle(bags.searchTables, identity.refName) ?? {},
254
319
  fileReaders: withOwnKeyAsHandle(bags.fileReaders, identity.refName) ?? {},
255
- automations: withOwnKeyAsHandle(bags.automations, identity.refName) ?? {},
320
+ automations: stampOwnedRefs(bags.automations, identity, "app") ?? {},
256
321
  agents: withOwnKeyAsHandle(bags.agents, identity.refName) ?? {},
257
- skills: withOwnKeyAsHandle(bags.skills, identity.refName) ?? {},
322
+ evaluations: withOwnKeyAsHandle(bags.evaluations, identity.refName) ?? {},
323
+ charts: withOwnKeyAsHandle(bags.charts, identity.refName) ?? {},
324
+ skills: stampSkillRefs(bags.skills, identity) ?? {},
258
325
  approvalChains: withOwnKeyAsHandle(bags.approvalChains, identity.refName) ?? {},
259
326
  phoneServices: withOwnKeyAsHandle(bags.phoneServices, identity.refName) ?? {},
260
327
  };
@@ -265,13 +332,15 @@ export function elementCatalog(identity, bags) {
265
332
  __kind: "element",
266
333
  refName: identity.refName,
267
334
  name: identity.name,
335
+ ...(identity.namespace !== undefined ? { namespace: identity.namespace } : {}),
268
336
  ...bags,
269
337
  fields: stampFieldRefs(bags.fields, identity, "element") ?? {},
270
338
  searchTables: withOwnKeyAsHandle(bags.searchTables, identity.refName) ?? {},
271
339
  fileReaders: withOwnKeyAsHandle(bags.fileReaders, identity.refName) ?? {},
272
- automations: withOwnKeyAsHandle(bags.automations, identity.refName) ?? {},
340
+ automations: stampOwnedRefs(bags.automations, identity, "element") ?? {},
273
341
  agents: withOwnKeyAsHandle(bags.agents, identity.refName) ?? {},
274
- skills: withOwnKeyAsHandle(bags.skills, identity.refName) ?? {},
342
+ evaluations: withOwnKeyAsHandle(bags.evaluations, identity.refName) ?? {},
343
+ skills: stampSkillRefs(bags.skills, identity) ?? {},
275
344
  approvalChains: withOwnKeyAsHandle(bags.approvalChains, identity.refName) ?? {},
276
345
  phoneServices: withOwnKeyAsHandle(bags.phoneServices, identity.refName) ?? {},
277
346
  };
@@ -282,13 +351,25 @@ export function orgCatalog(bags) {
282
351
  name: "Org",
283
352
  ...bags,
284
353
  aiProviders: stampAiProviders(bags.aiProviders),
285
- cloudLinks: withOwnKeyAsHandle(bags.cloudLinks) ?? {},
354
+ cloudLinks: stampCloudLinks(bags.cloudLinks) ?? {},
286
355
  categories: withOwnKeyAsHandle(bags.categories) ?? {},
287
356
  groups: withOwnKeyAsHandle(bags.groups) ?? {},
288
357
  phoneProviders: withOwnKeyAsHandle(bags.phoneProviders) ?? {},
289
358
  tables: stampTableRefs(bags.tables) ?? {},
290
359
  };
291
360
  }
361
+ function stampCloudLinks(bag) {
362
+ const stamped = withOwnKeyAsHandle(bag);
363
+ if (stamped === undefined)
364
+ return undefined;
365
+ return Object.fromEntries(Object.entries(stamped).map(([cloudLinkKey, cloudLink]) => [
366
+ cloudLinkKey,
367
+ {
368
+ ...cloudLink,
369
+ storedFunctions: withOwnKeyAsHandle(cloudLink.storedFunctions, cloudLinkKey) ?? {},
370
+ },
371
+ ]));
372
+ }
292
373
  /**
293
374
  * Stamp each provider's own `.refName`/`.handle` from its bag key (same as
294
375
  * `withOwnKeyAsHandle`), and — since a provider's `models` bag is nested
@@ -1,8 +1,8 @@
1
1
  import type { CatalogRef } from "./types.js";
2
2
  import { type AuthoringTenantContext } from "../engine/workspace/authoring-layout.js";
3
3
  /**
4
- * An authoring file's default export — what `defineApp`/`defineAgent`/
5
- * `defineAutomation` produce. `ref()`/`def()` both take the ref name as a
4
+ * An authoring file's default export — what `app`/`agent`/
5
+ * `automation` produce. `ref()`/`def()` both take the ref name as a
6
6
  * call-time argument (never a stored property the authoring file declares).
7
7
  */
8
8
  export interface ConfiguredEntity<TRef extends CatalogRef = CatalogRef> {
@@ -36,7 +36,7 @@ export interface AppAuthoringCatalog {
36
36
  }
37
37
  /**
38
38
  * Assemble an app's catalog from authoring files on disk — no server
39
- * round-trip. `appFile` is the app's own authoring file (a `defineApp(...)`
39
+ * round-trip. `appFile` is the app's own authoring file (a `app(...)`
40
40
  * result); `appDir` is its containing folder.
41
41
  *
42
42
  * Writes a throwaway stub version of `<appDir>/generated/catalog.ts` before
@@ -65,13 +65,13 @@ export declare function writeAppCatalogFromAuthoring(appDir: string, appRefName:
65
65
  /**
66
66
  * Write/refresh `<appDir>/generated/catalog.ts` regardless of whether the app has been
67
67
  * fully pulled yet. If `appFile` already default-exports a configured app (a
68
- * `defineApp(...)` pull), this is exactly {@link writeAppCatalogFromAuthoring}.
68
+ * `app(...)` pull), this is exactly {@link writeAppCatalogFromAuthoring}.
69
69
  * Otherwise — `edk import app` ran but `edk pull app` hasn't, so `appFile` is
70
70
  * just the old reference-only stub with no default export — falls back to
71
71
  * `importRefs` (the import-time fields/searchTables) merged with whatever
72
72
  * own-file children already have authoring files in this folder.
73
73
  */
74
- export declare function writeAppCatalog(appDir: string, appRefName: string, appName: string, appFile: string, importRefs?: readonly CatalogRef[], kind?: "app" | "element"): Promise<{
74
+ export declare function writeAppCatalog(appDir: string, appRefName: string, appName: string, appFile: string, importRefs?: readonly CatalogRef[], kind?: "app" | "element", namespace?: string): Promise<{
75
75
  catalogPath: string;
76
76
  }>;
77
77
  /** One app's catalog regenerated by {@link regenerateAppCatalogsUnder}. */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Build an app's catalog by scanning its **authoring files** rather than
3
- * round-tripping the server. Stream-root builders (`defineApp`, …) and
3
+ * round-tripping the server. Stream-root builders (`app`, …) and
4
4
  * own-file children default-export either a `{ ref(refName), def(refName) }`
5
5
  * configured entity or a plain `DeployableEntity`. Per-kind catalog shape
6
6
  * (stub refs, trigger/outputs bags, `searchTable` vs bag dir) lives on each
@@ -36,7 +36,7 @@ function isConfiguredEntity(value) {
36
36
  // whatever's *currently* on disk. Within a single `edk pull` an app's own
37
37
  // file gets imported here once while it's still the import-time
38
38
  // reference-only stub (no default export), then overwritten with the real
39
- // `defineApp(...)` call via plain `writeFile` (not through jiti), then
39
+ // `app(...)` call via plain `writeFile` (not through jiti), then
40
40
  // imported here again. A cached jiti would return the stale pre-overwrite
41
41
  // result for that second import — exactly the "does not default-export a
42
42
  // configured app" failure this avoids. Re-transpiling on every call is the
@@ -280,7 +280,7 @@ async function writeStubCatalog(appDir, appRefName, appName, kind, fields, child
280
280
  }
281
281
  /**
282
282
  * Assemble an app's catalog from authoring files on disk — no server
283
- * round-trip. `appFile` is the app's own authoring file (a `defineApp(...)`
283
+ * round-trip. `appFile` is the app's own authoring file (a `app(...)`
284
284
  * result); `appDir` is its containing folder.
285
285
  *
286
286
  * Writes a throwaway stub version of `<appDir>/generated/catalog.ts` before
@@ -295,7 +295,7 @@ export async function buildAppCatalogFromAuthoring(appDir, appFile, orgCatalogPa
295
295
  const jiti = authoringJiti(resolvedOrgCatalogPath);
296
296
  const appMod = (await jiti.import(appFile));
297
297
  if (!isConfiguredEntity(appMod.default)) {
298
- throw new Error(`${appFile} does not default-export a configured app (a defineApp(...) result)`);
298
+ throw new Error(`${appFile} does not default-export a configured app (a app(...) result)`);
299
299
  }
300
300
  const app = appMod.default;
301
301
  const appRefName = refNameOf(appFile);
@@ -388,13 +388,13 @@ export async function writeAppCatalogFromAuthoring(appDir, appRefName, appName,
388
388
  /**
389
389
  * Write/refresh `<appDir>/generated/catalog.ts` regardless of whether the app has been
390
390
  * fully pulled yet. If `appFile` already default-exports a configured app (a
391
- * `defineApp(...)` pull), this is exactly {@link writeAppCatalogFromAuthoring}.
391
+ * `app(...)` pull), this is exactly {@link writeAppCatalogFromAuthoring}.
392
392
  * Otherwise — `edk import app` ran but `edk pull app` hasn't, so `appFile` is
393
393
  * just the old reference-only stub with no default export — falls back to
394
394
  * `importRefs` (the import-time fields/searchTables) merged with whatever
395
395
  * own-file children already have authoring files in this folder.
396
396
  */
397
- export async function writeAppCatalog(appDir, appRefName, appName, appFile, importRefs = [], kind = "app") {
397
+ export async function writeAppCatalog(appDir, appRefName, appName, appFile, importRefs = [], kind = "app", namespace) {
398
398
  // Derive the workspace catalog path for the `@catalog` alias so entity files
399
399
  // that `import catalog from "@catalog"` can be loaded. `appDir` is
400
400
  // `<wsRoot>/apps/<handle>`; the org catalog lives at `<wsRoot>/generated/catalog.ts`.
@@ -424,7 +424,7 @@ export async function writeAppCatalog(appDir, appRefName, appName, appFile, impo
424
424
  fromBags.push(...Object.values(bag));
425
425
  }
426
426
  const flatRefs = dedupeCatalogRefs([...importRefs, ...fromBags]);
427
- const source = renderCatalog({ kind, refName: appRefName, name: appName }, flatRefs);
427
+ const source = renderCatalog({ kind, refName: appRefName, name: appName, ...(namespace !== undefined ? { namespace } : {}) }, flatRefs);
428
428
  const generatedDir = join(appDir, "generated");
429
429
  const catalogPath = join(generatedDir, CATALOG_FILENAME);
430
430
  await mkdir(generatedDir, { recursive: true });
@@ -4,9 +4,9 @@
4
4
  * ids appear here (identity lives in `src/deploy/state`).
5
5
  */
6
6
  export { AI_PROVIDER_LLM_MODELS, type AiProviderLlmModel, type AiProviderType } from "./ai-provider-models.js";
7
- export { REF_SCOPE, REF_UPDATABLE, type AgentRef, type AiProviderRef, type ApprovalChainRef, type ApprovalProcessRef, type AppCatalogRef, type AppOrElementRef, type AutomationCatalogRef, type AutomationRef, type CatalogRef, type CatalogRefKind, type CategoryRef, type CloudLinkRef, type AiServiceRef, type ConnectorRef, type GroupRef, type PhoneProviderRef, type PhoneServiceRef, type FileReaderCatalogRef, type DocumentModelFieldRef, type ElementCatalogRef, type FieldRef, type OutputPropertyRef, type SearchTableRef, type DatamineRef, type SkillRef, type TableColumnRef, type TableRef, type TriggerParameterRef, USER_FIELD_KEYS, type UserFieldKey, type UserFieldRef, } from "./types.js";
7
+ export { REF_SCOPE, REF_UPDATABLE, type AgentRef, type AgentEvaluationRef, type AiProviderRef, type ApprovalChainRef, type ApprovalProcessRef, type AppCatalogRef, type AppOrElementRef, type AutomationCatalogRef, type AutomationRef, type CatalogRef, type CatalogRefKind, type CategoryRef, type ChartRef, type DashboardRef, type CloudLinkRef, type AiServiceRef, type ConnectorRef, type GroupRef, type PhoneProviderRef, type PhoneServiceRef, type FileReaderCatalogRef, type DocumentModelFieldRef, type ElementCatalogRef, type FieldRef, type OutputPropertyRef, type SearchTableRef, type StoredFunctionRef, type StoredFunctionScalarType, type DatamineRef, type SkillRef, type TableColumnRef, type TableRef, type TriggerParameterRef, USER_FIELD_KEYS, type UserFieldKey, type UserFieldRef, } from "./types.js";
8
8
  export { renderBarrel, renderCatalog, renderFragment, type BarrelEntry, type BarrelRoot, } from "./render.js";
9
9
  export { appCatalogTarget, barrelPathFor, orgCatalogTarget, regenerateBarrel, writeCatalog, writeFlatCatalog, writeFragment, type CatalogTarget, } from "./write.js";
10
10
  export { isCatalogToken, slimToken, slimTokens } from "./token.js";
11
11
  export { buildAppCatalogFromAuthoring, listEntityFilesFromPaths, refNameOf, regenerateAppCatalogsUnder, writeAppCatalog, writeAppCatalogFromAuthoring, type AppAuthoringCatalog, type AppCatalogRegenResult, type ConfiguredEntity, } from "./from-authoring.js";
12
- export { agentRef, appRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, defineAiProvider, groupRef, linkedSearchTableRef, phoneProviderRef, phoneServiceRef, documentModelFieldRef, documentModelRef, elementCatalog, elementRef, fieldRef, orgCatalog, outputPropertyRef, searchTableRef, datamineRef, skillRef, tableColumnRef, tableRef, tableSearchTableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
12
+ export { agentRef, agentEvaluationRef, appRef, appCatalog, approvalChainRef, automationRef, categoryRef, chartRef, dashboardRef, cloudLinkRef, connectorRef, aiProvider, groupRef, linkedSearchTableRef, phoneProviderRef, phoneServiceRef, documentModelFieldRef, documentModelRef, elementCatalog, elementRef, fieldRef, orgCatalog, outputPropertyRef, searchTableRef, datamineRef, skillRef, storedFunctionRef, tableColumnRef, tableRef, tableSearchTableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
@@ -9,4 +9,4 @@ export { renderBarrel, renderCatalog, renderFragment, } from "./render.js";
9
9
  export { appCatalogTarget, barrelPathFor, orgCatalogTarget, regenerateBarrel, writeCatalog, writeFlatCatalog, writeFragment, } from "./write.js";
10
10
  export { isCatalogToken, slimToken, slimTokens } from "./token.js";
11
11
  export { buildAppCatalogFromAuthoring, listEntityFilesFromPaths, refNameOf, regenerateAppCatalogsUnder, writeAppCatalog, writeAppCatalogFromAuthoring, } from "./from-authoring.js";
12
- export { agentRef, appRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, defineAiProvider, groupRef, linkedSearchTableRef, phoneProviderRef, phoneServiceRef, documentModelFieldRef, documentModelRef, elementCatalog, elementRef, fieldRef, orgCatalog, outputPropertyRef, searchTableRef, datamineRef, skillRef, tableColumnRef, tableRef, tableSearchTableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
12
+ export { agentRef, agentEvaluationRef, appRef, appCatalog, approvalChainRef, automationRef, categoryRef, chartRef, dashboardRef, cloudLinkRef, connectorRef, aiProvider, groupRef, linkedSearchTableRef, phoneProviderRef, phoneServiceRef, documentModelFieldRef, documentModelRef, elementCatalog, elementRef, fieldRef, orgCatalog, outputPropertyRef, searchTableRef, datamineRef, skillRef, storedFunctionRef, tableColumnRef, tableRef, tableSearchTableRef, triggerParameterRef, usersCatalog, } from "./factories.js";