@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.0-preview.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/README.md +408 -3
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
  3. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
  4. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
  5. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
  6. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
  7. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
  8. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
  9. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
  10. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
  11. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
  12. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
  13. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
  14. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
  15. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
  16. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
  17. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
  18. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
  19. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
  20. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
  21. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
  22. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
  23. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
  24. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
  25. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
  26. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
  27. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
  28. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
  29. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
  30. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
  31. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
  32. package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
  33. package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
  34. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
  35. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
  36. package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
  37. package/dist-sdk/elementum-entity-client/errors.js +111 -0
  38. package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
  39. package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
  40. package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
  41. package/dist-sdk/elementum-entity-client/types.js +1 -0
  42. package/dist-sdk/fs/entity.d.ts +104 -0
  43. package/dist-sdk/fs/entity.js +52 -0
  44. package/dist-sdk/pull/util.d.ts +130 -0
  45. package/dist-sdk/pull/util.js +204 -0
  46. package/dist-sdk/src/catalog/factories.d.ts +189 -0
  47. package/dist-sdk/src/catalog/factories.js +202 -0
  48. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  49. package/dist-sdk/src/catalog/from-authoring.js +462 -0
  50. package/dist-sdk/src/catalog/index.d.ts +11 -0
  51. package/dist-sdk/src/catalog/index.js +11 -0
  52. package/dist-sdk/src/catalog/org.d.ts +11 -0
  53. package/dist-sdk/src/catalog/org.js +211 -0
  54. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  55. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  56. package/dist-sdk/src/catalog/render.d.ts +36 -0
  57. package/dist-sdk/src/catalog/render.js +176 -0
  58. package/dist-sdk/src/catalog/token.d.ts +10 -0
  59. package/dist-sdk/src/catalog/token.js +62 -0
  60. package/dist-sdk/src/catalog/types.d.ts +158 -0
  61. package/dist-sdk/src/catalog/types.js +83 -0
  62. package/dist-sdk/src/catalog/write.d.ts +43 -0
  63. package/dist-sdk/src/catalog/write.js +109 -0
  64. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  65. package/dist-sdk/src/core/app-to-ui.js +75 -0
  66. package/dist-sdk/src/core/index.d.ts +10 -0
  67. package/dist-sdk/src/core/index.js +9 -0
  68. package/dist-sdk/src/core/system-fields.d.ts +93 -0
  69. package/dist-sdk/src/core/system-fields.js +151 -0
  70. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  71. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  72. package/dist-sdk/src/core/types/ai-provider.d.ts +36 -0
  73. package/dist-sdk/src/core/types/ai-provider.js +32 -0
  74. package/dist-sdk/src/core/types/app.d.ts +838 -0
  75. package/dist-sdk/src/core/types/app.js +210 -0
  76. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  77. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  78. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  79. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  80. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  81. package/dist-sdk/src/core/types/display-block.js +61 -0
  82. package/dist-sdk/src/core/types/group.d.ts +13 -0
  83. package/dist-sdk/src/core/types/group.js +6 -0
  84. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  85. package/dist-sdk/src/core/types/platform.js +1 -0
  86. package/dist-sdk/src/core/types/user.d.ts +20 -0
  87. package/dist-sdk/src/core/types/user.js +8 -0
  88. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  89. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  90. package/dist-sdk/src/engine/build/context.d.ts +49 -0
  91. package/dist-sdk/src/engine/build/context.js +6 -0
  92. package/dist-sdk/src/engine/entity.d.ts +44 -0
  93. package/dist-sdk/src/engine/entity.js +15 -0
  94. package/dist-sdk/src/engine/pull/context.d.ts +23 -0
  95. package/dist-sdk/src/engine/pull/context.js +44 -0
  96. package/dist-sdk/src/engine/pull/org.d.ts +44 -0
  97. package/dist-sdk/src/engine/pull/org.js +104 -0
  98. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  99. package/dist-sdk/src/engine/tf/escape.js +28 -0
  100. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  101. package/dist-sdk/src/engine/tf/expr.js +405 -0
  102. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  103. package/dist-sdk/src/engine/tf/index.js +11 -0
  104. package/dist-sdk/src/engine/tf/labels.d.ts +31 -0
  105. package/dist-sdk/src/engine/tf/labels.js +125 -0
  106. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  107. package/dist-sdk/src/engine/tf/model.js +49 -0
  108. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  109. package/dist-sdk/src/engine/tf/parse.js +189 -0
  110. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  111. package/dist-sdk/src/engine/tf/render.js +102 -0
  112. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  113. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  114. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  115. package/dist-sdk/src/entities/agent/build.js +148 -0
  116. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +18 -0
  117. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +177 -0
  118. package/dist-sdk/src/entities/agent/from-tf.d.ts +50 -0
  119. package/dist-sdk/src/entities/agent/from-tf.js +169 -0
  120. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  121. package/dist-sdk/src/entities/agent/index.js +7 -0
  122. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  123. package/dist-sdk/src/entities/agent/module.js +116 -0
  124. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  125. package/dist-sdk/src/entities/agent/to-tf.js +136 -0
  126. package/dist-sdk/src/entities/agent/tools.d.ts +205 -0
  127. package/dist-sdk/src/entities/agent/tools.js +199 -0
  128. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +63 -0
  129. package/dist-sdk/src/entities/agent-tool/from-tf.js +169 -0
  130. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  131. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  132. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +38 -0
  133. package/dist-sdk/src/entities/agent-tool/to-tf.js +164 -0
  134. package/dist-sdk/src/entities/agent-tool/types.d.ts +42 -0
  135. package/dist-sdk/src/entities/agent-tool/types.js +70 -0
  136. package/dist-sdk/src/entities/app/build.d.ts +318 -0
  137. package/dist-sdk/src/entities/app/build.js +325 -0
  138. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +165 -0
  139. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  140. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  141. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  142. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  143. package/dist-sdk/src/entities/app/from-tf.js +180 -0
  144. package/dist-sdk/src/entities/app/index.d.ts +11 -0
  145. package/dist-sdk/src/entities/app/index.js +10 -0
  146. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  147. package/dist-sdk/src/entities/app/locals.js +31 -0
  148. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  149. package/dist-sdk/src/entities/app/module.js +59 -0
  150. package/dist-sdk/src/entities/app/to-tf.d.ts +28 -0
  151. package/dist-sdk/src/entities/app/to-tf.js +183 -0
  152. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  153. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  154. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  155. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  156. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  157. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  158. package/dist-sdk/src/entities/automation/build.d.ts +215 -0
  159. package/dist-sdk/src/entities/automation/build.js +424 -0
  160. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  161. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  162. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +135 -0
  163. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  164. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +40 -0
  165. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1040 -0
  166. package/dist-sdk/src/entities/automation/filter.d.ts +81 -0
  167. package/dist-sdk/src/entities/automation/filter.js +146 -0
  168. package/dist-sdk/src/entities/automation/from-tf.d.ts +36 -0
  169. package/dist-sdk/src/entities/automation/from-tf.js +252 -0
  170. package/dist-sdk/src/entities/automation/index.d.ts +18 -0
  171. package/dist-sdk/src/entities/automation/index.js +21 -0
  172. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  173. package/dist-sdk/src/entities/automation/module.js +153 -0
  174. package/dist-sdk/src/entities/automation/operators.d.ts +66 -0
  175. package/dist-sdk/src/entities/automation/operators.js +43 -0
  176. package/dist-sdk/src/entities/automation/script-code.d.ts +62 -0
  177. package/dist-sdk/src/entities/automation/script-code.js +366 -0
  178. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  179. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  180. package/dist-sdk/src/entities/automation/tasks.d.ts +535 -0
  181. package/dist-sdk/src/entities/automation/tasks.js +697 -0
  182. package/dist-sdk/src/entities/automation/to-tf.d.ts +38 -0
  183. package/dist-sdk/src/entities/automation/to-tf.js +266 -0
  184. package/dist-sdk/src/entities/automation/triggers.d.ts +197 -0
  185. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  186. package/dist-sdk/src/entities/automation/types.d.ts +53 -0
  187. package/dist-sdk/src/entities/automation/types.js +101 -0
  188. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +76 -0
  189. package/dist-sdk/src/entities/automation/value-ref-tf.js +190 -0
  190. package/dist-sdk/src/entities/element/build.d.ts +108 -0
  191. package/dist-sdk/src/entities/element/build.js +109 -0
  192. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  193. package/dist-sdk/src/entities/element/from-tf.js +155 -0
  194. package/dist-sdk/src/entities/element/index.d.ts +9 -0
  195. package/dist-sdk/src/entities/element/index.js +9 -0
  196. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  197. package/dist-sdk/src/entities/element/locals.js +12 -0
  198. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  199. package/dist-sdk/src/entities/element/module.js +63 -0
  200. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  201. package/dist-sdk/src/entities/element/to-tf.js +151 -0
  202. package/dist-sdk/src/entities/field/build.d.ts +69 -0
  203. package/dist-sdk/src/entities/field/build.js +74 -0
  204. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  205. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  206. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  207. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  208. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  209. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  210. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  211. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  212. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  213. package/dist-sdk/src/entities/field/calc/runtime.js +170 -0
  214. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  215. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  216. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  217. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  218. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  219. package/dist-sdk/src/entities/field/calc.js +54 -0
  220. package/dist-sdk/src/entities/field/from-tf.d.ts +29 -0
  221. package/dist-sdk/src/entities/field/from-tf.js +73 -0
  222. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  223. package/dist-sdk/src/entities/field/locals.js +24 -0
  224. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  225. package/dist-sdk/src/entities/field/module.js +49 -0
  226. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  227. package/dist-sdk/src/entities/field/options.js +76 -0
  228. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  229. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  230. package/dist-sdk/src/entities/field/to-tf.d.ts +55 -0
  231. package/dist-sdk/src/entities/field/to-tf.js +97 -0
  232. package/dist-sdk/src/entities/field/types.d.ts +27 -0
  233. package/dist-sdk/src/entities/field/types.js +46 -0
  234. package/dist-sdk/src/entities/file-reader/build.d.ts +124 -0
  235. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  236. package/dist-sdk/src/entities/file-reader/index.d.ts +5 -0
  237. package/dist-sdk/src/entities/file-reader/index.js +5 -0
  238. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  239. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  240. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  241. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  242. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  243. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  244. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  245. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  246. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  247. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  248. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  249. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  250. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  251. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  252. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  253. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  254. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  255. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  256. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  257. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  258. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  259. package/dist-sdk/src/entities/flow/build.js +115 -0
  260. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  261. package/dist-sdk/src/entities/flow/index.js +7 -0
  262. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  263. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  264. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  265. package/dist-sdk/src/entities/flow/util.js +38 -0
  266. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  267. package/dist-sdk/src/entities/org/category.js +33 -0
  268. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  269. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  270. package/dist-sdk/src/entities/org/connector.d.ts +5 -0
  271. package/dist-sdk/src/entities/org/connector.js +37 -0
  272. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  273. package/dist-sdk/src/entities/org/group.js +31 -0
  274. package/dist-sdk/src/entities/org/index.d.ts +10 -0
  275. package/dist-sdk/src/entities/org/index.js +10 -0
  276. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  277. package/dist-sdk/src/entities/org/role.js +21 -0
  278. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  279. package/dist-sdk/src/entities/org/user.js +21 -0
  280. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  281. package/dist-sdk/src/entities/search-table/build.js +79 -0
  282. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  283. package/dist-sdk/src/entities/search-table/index.js +5 -0
  284. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  285. package/dist-sdk/src/entities/search-table/module.js +64 -0
  286. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  287. package/dist-sdk/src/entities/shared/context.js +156 -0
  288. package/dist-sdk/src/entities/shared/filters/ast.d.ts +242 -0
  289. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  290. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  291. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  292. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  293. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  294. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  295. package/dist-sdk/src/entities/shared/ref.js +119 -0
  296. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  297. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  298. package/dist-sdk/src/entities/shared/types/field-types.d.ts +49 -0
  299. package/dist-sdk/src/entities/shared/types/field-types.js +48 -0
  300. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  301. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  302. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  303. package/dist-sdk/src/entities/skill/build.js +50 -0
  304. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +20 -0
  305. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +96 -0
  306. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  307. package/dist-sdk/src/entities/skill/from-tf.js +95 -0
  308. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  309. package/dist-sdk/src/entities/skill/index.js +7 -0
  310. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  311. package/dist-sdk/src/entities/skill/module.js +106 -0
  312. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  313. package/dist-sdk/src/entities/skill/to-tf.js +58 -0
  314. package/dist-sdk/src/entities/skill/tools.d.ts +71 -0
  315. package/dist-sdk/src/entities/skill/tools.js +88 -0
  316. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +47 -0
  317. package/dist-sdk/src/entities/skill-tool/from-tf.js +121 -0
  318. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  319. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  320. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +32 -0
  321. package/dist-sdk/src/entities/skill-tool/to-tf.js +107 -0
  322. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  323. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  324. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  325. package/dist-sdk/src/entities/table/build.js +339 -0
  326. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  327. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  328. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  329. package/dist-sdk/src/entities/table/fields.js +70 -0
  330. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  331. package/dist-sdk/src/entities/table/filter.js +89 -0
  332. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  333. package/dist-sdk/src/entities/table/index.js +12 -0
  334. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  335. package/dist-sdk/src/entities/table/joins.js +31 -0
  336. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  337. package/dist-sdk/src/entities/table/keys.js +25 -0
  338. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  339. package/dist-sdk/src/entities/table/module.js +25 -0
  340. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  341. package/dist-sdk/src/entities/table/state.js +43 -0
  342. package/dist-sdk/src/entities/view/from-tf.d.ts +25 -0
  343. package/dist-sdk/src/entities/view/from-tf.js +233 -0
  344. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  345. package/dist-sdk/src/entities/view/module.js +61 -0
  346. package/dist-sdk/src/entities/view/to-tf.d.ts +63 -0
  347. package/dist-sdk/src/entities/view/to-tf.js +156 -0
  348. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  349. package/dist-sdk/src/entities/view/types.js +89 -0
  350. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +14 -0
  351. package/dist-sdk/src/graph/deferred-catalog-render.js +37 -0
  352. package/dist-sdk/src/graph/index.d.ts +83 -0
  353. package/dist-sdk/src/graph/index.js +207 -0
  354. package/dist-sdk/src/graph/modules.d.ts +7 -0
  355. package/dist-sdk/src/graph/modules.js +37 -0
  356. package/dist-sdk/src/graph/types.d.ts +301 -0
  357. package/dist-sdk/src/graph/types.js +102 -0
  358. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  359. package/dist-sdk/src/internal/sdk-package.js +23 -0
  360. package/package.json +173 -8
@@ -0,0 +1,838 @@
1
+ /**
2
+ * App object pattern — a single typed object per Elementum app that
3
+ * carries all related IDs (fields, agents, search tables, automations).
4
+ *
5
+ * Each app is code-generated from its platform definition and imported into
6
+ * automation files. Downstream task configs (e.g. `recordSearch`,
7
+ * `updateField`, `aiSearchTable`) accept the imported app value directly;
8
+ * the generics infer field / record shapes from it.
9
+ */
10
+ import { type Ref, type ValueOrRef } from "../../entities/shared/ref.js";
11
+ import type { WorkflowFieldType } from "../../entities/shared/types/field-types.js";
12
+ import type { CloudLink } from "./cloud-link.js";
13
+ import type { DisplayBlockBag } from "./display-block.js";
14
+ import type { SerializedRenderTree } from "../../entities/flow/activities/render-catalog.js";
15
+ import type { AspectFieldQrFormat, AspectNumericFieldFormat, AspectReferenceFieldFormat, PicklistConfigInput, PicklistValueExInput } from "../../../elementum-entity-client/clients/aspects/models/index.js";
16
+ /**
17
+ * One static picklist value; in `createRecord` / `updateField` pick via
18
+ * `(options) => options.Name` — only `id` is sent to the API.
19
+ *
20
+ * `parentValues` is the per-option half of dependent dropdowns: each
21
+ * entry is an option on the field's `parentField` that gates this
22
+ * option's availability. Authors pass typed refs (`country.options.usa`)
23
+ * rather than raw ids — the serializer flattens to id strings on the
24
+ * wire. Server-side validation rejects a record save whose child
25
+ * selection isn't valid for the current parent value. Leave the slot
26
+ * unset on plain (non-dependent) options.
27
+ */
28
+ /**
29
+ * Tag values the platform recognises on a picklist option. `CLOSED`
30
+ * on a STATUS field's option tells the platform to auto-stamp the
31
+ * close timestamp / closed-by system fields when a record moves into
32
+ * that value. The priority tags drive cosmetic-priority surfaces.
33
+ *
34
+ * Authors picking a closed-state for a status field set
35
+ * `tags: ["CLOSED"]` on the relevant option.
36
+ */
37
+ export type PicklistOptionTag = "CLOSED" | "CRITICAL" | "HIGH" | "MEDIUM" | "LOW";
38
+ export interface PicklistOption {
39
+ readonly id: string;
40
+ readonly label: string;
41
+ readonly parentValues?: readonly PicklistOption[];
42
+ /**
43
+ * Optional tags on this option. See {@link PicklistOptionTag}
44
+ * for the supported values and what they drive on the platform.
45
+ */
46
+ readonly tags?: readonly PicklistOptionTag[];
47
+ /**
48
+ * Optional display color (hex, e.g. `"#3B82F6"`). Surfaced on status
49
+ * options; cosmetic only.
50
+ */
51
+ readonly color?: string;
52
+ }
53
+ export declare function picklistOption(id: string, label: string, parentValues?: readonly PicklistOption[]): PicklistOption;
54
+ /** If `value` is a static picklist option for this field, return its API id; otherwise return `value`. */
55
+ export declare function picklistStaticValueToApiId(field: AppField<FieldScope>, value: unknown): unknown;
56
+ /**
57
+ * Phantom marker — distinguishes a field descriptor reachable at module scope
58
+ * (`app.fields.X`) from one handed in by a row-scoped filter callback
59
+ * (`(row) => ...`). The marker has no runtime presence; it exists purely so
60
+ * the type system can gate filter helpers that only make sense when a row is
61
+ * in scope.
62
+ *
63
+ * - `"unscoped"` — the default for `app.fields.X`; these descriptors can be
64
+ * consumed by row-less APIs (e.g. `recordFieldLocking`) but cannot be the
65
+ * left-hand side of a row-based filter comparison.
66
+ * - `"row"` — produced only by a row-scoped callback's row proxy. These are
67
+ * the descriptors filter helpers like `eq` / `gt` / `like` accept.
68
+ *
69
+ * This replaces earlier prompt-only guidance that forbade `APP.fields.x` in
70
+ * switch conditions: the ban is now a compile error instead of a rule the
71
+ * agent has to remember.
72
+ */
73
+ export type FieldScope = "row" | "unscoped";
74
+ /**
75
+ * Names that Ultron auto-provisions on every `APP` aspect. A user field
76
+ * whose `name` collides with one of these causes compose to fail with a
77
+ * raw Postgres unique-constraint 500 instead of a typed validation error,
78
+ * so we reject the collision at `defineApp()` time.
79
+ *
80
+ * This list is hand-maintained — if Ultron adds a new system field, add
81
+ * the literal here and regenerate. A long-term improvement is to source
82
+ * this list from an Ultron endpoint at codegen time (see
83
+ * plans/edk-shortcomings.md #14).
84
+ */
85
+ /**
86
+ * Field names ultron auto-creates on every aspect at create time and
87
+ * reserves for system bookkeeping. Source of truth: ultron's
88
+ * `FieldTag.REQUIRED_TAGS` map (`shared/.../field/model/FieldTag.java:114`)
89
+ * and the i18n display bundle (`shared/.../bundle/aspect.json` →
90
+ * `aspect.requiredTags`).
91
+ *
92
+ * The list is the union across all `AspectType` variants — APP has the
93
+ * full 10, TASK omits Stage, ELEMENT/TRANSACTION only have ID + Title.
94
+ * Reserving the union is slightly stricter than ultron per-variant but
95
+ * avoids any author-time/runtime-collision class.
96
+ */
97
+ export type ReservedSystemFieldName = "ID" | "Title" | "Status" | "Stage" | "Created on" | "Created by" | "Updated on" | "Updated by" | "Closed on" | "Closed by";
98
+ /**
99
+ * Branded `never` alias that surfaces a readable error message when a
100
+ * field `name` collides with a reserved system field. The `tsc` hover
101
+ * shows the offending name, so authors see:
102
+ *
103
+ * Type 'Status' is not assignable to type
104
+ * '__edk_error_field_name_is_reserved_for_system_use<"Status">__'
105
+ */
106
+ export type _ReservedSystemFieldName<N extends string> = `__edk_error_field_name_is_reserved_for_system_use<${N}>__` & never;
107
+ export type SystemFieldSemanticTag = "HANDLE" | "TITLE" | "STATUS" | "STAGE" | "CREATED_AT" | "CREATED_BY" | "UPDATED_AT" | "UPDATED_BY" | "CLOSED_AT" | "CLOSED_BY";
108
+ export type WritableSystemFieldSemanticTag = "TITLE" | "STATUS";
109
+ type TagsOf<F> = F extends {
110
+ readonly tags: readonly (infer T)[];
111
+ } ? T : never;
112
+ type HasLiteralTags<F> = string extends TagsOf<F> ? false : true;
113
+ type HasKnownSystemSemanticTag<F> = HasLiteralTags<F> extends true ? [Extract<TagsOf<F>, SystemFieldSemanticTag>] extends [never] ? false : true : false;
114
+ type WritableFieldValues<TFields extends Record<string, AppField>> = {
115
+ [K in keyof TFields]?: AppFieldInputForTask<TFields[K] & AppField>;
116
+ };
117
+ /**
118
+ * Shared base for every per-variant `AppField`. Carries identity
119
+ * (`id`, `name`) plus the cross-variant authoring options that ultron
120
+ * accepts on every `AbstractAspectFieldInput` (required, description,
121
+ * tags, etc.). Per-variant interfaces below extend this with their
122
+ * variant-specific extras.
123
+ */
124
+ export interface AspectFieldBase<Scope extends FieldScope = "unscoped"> {
125
+ /** Phantom — never read or written at runtime; see `FieldScope`. */
126
+ readonly __scope?: Scope;
127
+ readonly id: string;
128
+ readonly name: string;
129
+ readonly columnName?: string;
130
+ readonly required?: boolean;
131
+ readonly requiredOnClose?: boolean;
132
+ readonly showOnCreate?: boolean;
133
+ readonly description?: string;
134
+ /**
135
+ * Platform semantic-role tags (HANDLE, TITLE, STATUS, ...).
136
+ */
137
+ readonly tags?: readonly string[];
138
+ readonly lockOnCreate?: boolean;
139
+ readonly defaultValue?: unknown;
140
+ /**
141
+ * Runtime metadata stamped on pulled fields by `print-aspect.ts`.
142
+ * Records the variant the field was when pulled — `serializeAspectForUpdate`
143
+ * compares it against the current `type` and throws if they differ.
144
+ * Belt to the `satisfies <VariantInterface>` brace's compile-time
145
+ * check: catches the pathological case where an agent edits the
146
+ * `type:` literal AND removes the `satisfies` clause (or otherwise
147
+ * bypasses the type system) but leaves the rest of the source.
148
+ *
149
+ * Hand-authored sources don't set this; the guard is a no-op there.
150
+ * Never serialized to ultron — `serializeBaseField` projects only
151
+ * the wire-relevant properties.
152
+ */
153
+ readonly __pulledType?: "TEXT" | "RICH_TEXT" | "HANDLE" | "HTML" | "NUMBER" | "DECIMAL" | "BOOLEAN" | "DATE" | "DATETIME" | "JSON" | "PICKLIST" | "MULTI_PICKLIST" | "USER" | "USER_ID" | "GROUP" | "GROUP_ID" | "ATTACHMENT" | "ATTACHMENT_ID" | "CALCULATED";
154
+ }
155
+ /** TEXT and RICH_TEXT fields. `qrFormat` opts in to QR rendering. */
156
+ export interface TextAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
157
+ readonly type: "TEXT" | "RICH_TEXT";
158
+ readonly qrFormat?: AspectFieldQrFormat;
159
+ }
160
+ /** HANDLE fields. Aspect compose accepts user-authored handles in addition to ultron's auto-generated `ID` field. */
161
+ export interface HandleAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
162
+ readonly type: "HANDLE";
163
+ readonly qrFormat?: AspectFieldQrFormat;
164
+ }
165
+ /** Integer NUMBER fields. `numericFormat` controls currency/percent/etc. rendering. */
166
+ export interface NumberAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
167
+ readonly type: "NUMBER";
168
+ readonly numericFormat?: AspectNumericFieldFormat;
169
+ }
170
+ /** DECIMAL fields. Same `numericFormat` slot as `NumberAppField`. */
171
+ export interface DecimalAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
172
+ readonly type: "DECIMAL";
173
+ readonly numericFormat?: AspectNumericFieldFormat;
174
+ }
175
+ /** BOOLEAN fields. */
176
+ export interface BooleanAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
177
+ readonly type: "BOOLEAN";
178
+ }
179
+ /** DATE fields (date-only, no time). */
180
+ export interface DateAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
181
+ readonly type: "DATE";
182
+ }
183
+ /** DATETIME fields. */
184
+ export interface DateTimeAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
185
+ readonly type: "DATETIME";
186
+ }
187
+ /** HTML fields (rich-text body). */
188
+ export interface HtmlAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
189
+ readonly type: "HTML";
190
+ }
191
+ /** JSON-blob fields. */
192
+ export interface JsonAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
193
+ readonly type: "JSON";
194
+ }
195
+ /**
196
+ * Shared base for `PicklistAppField` / `MultiPicklistAppField`. The
197
+ * three value-source mechanisms are mutually exclusive at the wire
198
+ * layer:
199
+ * - `options` — static value list emitted by `fetch-app-definition`
200
+ * and consumed by the serializer's `optionsToPicklistValues`
201
+ * translation (the agent-friendly authoring shape)
202
+ * - `picklistValues` — explicit `PicklistValueExInput[]` for richer
203
+ * authoring (color, icon)
204
+ * - `config: PicklistConfigInput` — typed wrapper for static /
205
+ * dynamic picklist config (related-aspect refs, filters, etc.)
206
+ *
207
+ * The legacy `values: string[]` slot is preserved for update flows
208
+ * that re-send id-only ordering data.
209
+ *
210
+ * `parentField` is the field-level half of dependent dropdowns: a
211
+ * typed reference to another picklist (single or multi) whose
212
+ * selected value(s) gate which of THIS field's options are available.
213
+ * Authors pass the parent field directly:
214
+ *
215
+ * ```ts
216
+ * const country = { ..., type: "PICKLIST" as const, options: { usa, canada } } satisfies PicklistAppField;
217
+ * const state = {
218
+ * ..., type: "PICKLIST" as const,
219
+ * parentField: country,
220
+ * options: {
221
+ * ca: { id, label, parentValues: [country.options.usa] },
222
+ * on: { id, label, parentValues: [country.options.canada] },
223
+ * },
224
+ * } satisfies PicklistAppField;
225
+ * ```
226
+ *
227
+ * The serializer flattens this into the wire form: `parentField.id`
228
+ * lands on `config.static.parentFieldId` (or `config.dynamic.parentFieldId`
229
+ * when the picklist is dynamic), and each option's `parentValues` ids
230
+ * land on its `relatedParentValues`. For the related-aspect-backed
231
+ * (dynamic) case, the cross-aspect field mappings live on
232
+ * `config.dynamic.parentMappings` and are still authored through the
233
+ * `config` slot directly.
234
+ */
235
+ export interface PicklistAppFieldBase<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
236
+ readonly options?: Readonly<Record<string, PicklistOption>>;
237
+ readonly picklistValues?: readonly PicklistValueExInput[];
238
+ readonly config?: PicklistConfigInput;
239
+ readonly values?: readonly string[];
240
+ readonly referenceFormat?: AspectReferenceFieldFormat;
241
+ readonly parentField?: PicklistAppField<Scope> | MultiPicklistAppField<Scope>;
242
+ /**
243
+ * Runtime metadata stamped on pulled picklist fields by
244
+ * `print-aspect.ts`. Records the picklist value ids that existed
245
+ * at pull time. `serializeAspectForUpdate` checks every id in this
246
+ * set is still present in the current `picklistValues`; missing
247
+ * ids → throw, since the EDK doesn't support deleting picklist
248
+ * values (matching the create/update-only pattern across
249
+ * `defineAutomation`, `defineAgent`, etc.).
250
+ *
251
+ * Hand-authored fields don't set this; the guard is a no-op.
252
+ * Never serialized to ultron — `resolvePicklistValues` projects
253
+ * only the wire-relevant fields.
254
+ */
255
+ readonly __pulledValueIds?: readonly string[];
256
+ }
257
+ /** Single-value PICKLIST fields. */
258
+ export interface PicklistAppField<Scope extends FieldScope = "unscoped"> extends PicklistAppFieldBase<Scope> {
259
+ readonly type: "PICKLIST";
260
+ }
261
+ /** Multi-value MULTI_PICKLIST fields. */
262
+ export interface MultiPicklistAppField<Scope extends FieldScope = "unscoped"> extends PicklistAppFieldBase<Scope> {
263
+ readonly type: "MULTI_PICKLIST";
264
+ }
265
+ /** USER fields (user references). `USER` and `USER_ID` are accepted aliases. */
266
+ export interface UserAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
267
+ readonly type: "USER" | "USER_ID";
268
+ }
269
+ /** GROUP fields (group references). `GROUP` and `GROUP_ID` are accepted aliases. */
270
+ export interface GroupAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
271
+ readonly type: "GROUP" | "GROUP_ID";
272
+ }
273
+ /** ATTACHMENT fields. `mediaTypes` restricts uploads to the listed MIME types. */
274
+ export interface AttachmentAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
275
+ readonly type: "ATTACHMENT" | "ATTACHMENT_ID";
276
+ readonly mediaTypes?: readonly string[];
277
+ }
278
+ /**
279
+ * Branded result of the `calc.*` builder. The brand is opaque on the
280
+ * author surface — agents never construct this directly; they call
281
+ * `calc.if(...)` / `calc.plus(...)` / etc. and the builder returns one
282
+ * of these. The compose serializer reads `toCalcString()` to emit the
283
+ * wire text.
284
+ *
285
+ * Pulled sources carry a different shape (an opaque marker that holds
286
+ * the server's stored expression string verbatim) — the marker is
287
+ * assignable to this slot but its `toCalcString` round-trips the
288
+ * server text byte-for-byte instead of walking a typed AST. See
289
+ * `src/aspects/calc/` for the DSL and (in a follow-up PR) the
290
+ * deserializer's `__pulledExpression` marker.
291
+ */
292
+ export interface CalculationExpression {
293
+ readonly __calc: true;
294
+ readonly toCalcString: () => string;
295
+ }
296
+ /**
297
+ * Calculated fields. The output field type (NUMBER/DECIMAL/TEXT/...)
298
+ * is server-inferred from the expression text; the EDK doesn't declare
299
+ * it explicitly. `numericFormat` is the only format slot supported
300
+ * today (wraps as `AspectReferenceFieldFormat.numeric` on the wire).
301
+ *
302
+ * Authors build `expression` with the `calc.*` builder exported from
303
+ * `src/aspects/index.js`; the compose serializer walks the resulting
304
+ * AST and emits the wire string.
305
+ */
306
+ export interface CalculatedAppField<Scope extends FieldScope = "unscoped"> extends AspectFieldBase<Scope> {
307
+ readonly type: "CALCULATED";
308
+ readonly expression: CalculationExpression;
309
+ readonly numericFormat?: AspectNumericFieldFormat;
310
+ }
311
+ /**
312
+ * Discriminated union of every authorable aspect field. Routed by the
313
+ * `type` literal — TypeScript narrows the variant when authors set
314
+ * `type: "PICKLIST"` etc., so per-variant fields (`numericFormat` on
315
+ * NumberAppField, `picklistValues` on PicklistAppField, etc.) are
316
+ * statically gated to the right variant.
317
+ */
318
+ export type AppField<Scope extends FieldScope = "unscoped"> = TextAppField<Scope> | HandleAppField<Scope> | NumberAppField<Scope> | DecimalAppField<Scope> | BooleanAppField<Scope> | DateAppField<Scope> | DateTimeAppField<Scope> | HtmlAppField<Scope> | JsonAppField<Scope> | PicklistAppField<Scope> | MultiPicklistAppField<Scope> | UserAppField<Scope> | GroupAppField<Scope> | AttachmentAppField<Scope> | CalculatedAppField<Scope>;
319
+ export interface AppAgent {
320
+ readonly id: string;
321
+ readonly name?: string;
322
+ readonly model?: string;
323
+ }
324
+ /**
325
+ * A reusable agentic skill owned by the app — an AI capability bundle
326
+ * (prompt + tools) that one of the app's agents can be granted via
327
+ * `defineAgent({ skills: [...] })`. The agent doesn't author the skill
328
+ * here; it only references it by id/name. Authoring lives on the
329
+ * separate `defineSkill` factory and lands in this bag once deployed.
330
+ */
331
+ export interface AppAgenticSkill {
332
+ readonly id: string;
333
+ readonly name?: string;
334
+ }
335
+ export interface AppSearchTable<TFields extends Record<string, AppField> = {}> {
336
+ readonly id: string;
337
+ readonly name?: string;
338
+ readonly fields: TFields;
339
+ }
340
+ /**
341
+ * Descriptor for one on-demand trigger parameter of a target automation.
342
+ * Produced by `fetch-app-definition.ts` and consumed by `runAutomation`'s
343
+ * static-mode `inputs:` shape, which resolves names to `parameterId` at
344
+ * serialize time so the author never sees a UUID.
345
+ *
346
+ * `type` is required — the renderer reads it from antman's wire
347
+ * (`TriggerParameter.fieldType`, surfaced from mobius's
348
+ * `ServiceTaskParam.fieldType`). Hand-authored `defineApp({ ... })`
349
+ * entries must set it explicitly so `runAutomation`'s input typing can
350
+ * derive value types.
351
+ */
352
+ export interface AppAutomationParam {
353
+ readonly id: string;
354
+ readonly name: string;
355
+ readonly type: WorkflowFieldType;
356
+ readonly multiple?: boolean;
357
+ readonly required?: boolean;
358
+ }
359
+ /**
360
+ * Workflow metadata attached to an automation in an AppAutomation
361
+ * entry — the part the agent needs to pull the automation back as
362
+ * editable source via `defineAutomation.fromJSON`.
363
+ *
364
+ * Substantive type, not a wrapper over the entity-client's `Workflow`:
365
+ * - `id` is required, so the agent can't author an entry with
366
+ * workflow metadata but no actual id (typecheck catches it at
367
+ * `defineApp({...})` construction time).
368
+ * - Surface is narrow to authoring concerns. Heavier wire fields
369
+ * (triggers, tasks, outputs, owner, etc.) live on the
370
+ * entity-client's `Workflow` and are read at pull time, not
371
+ * authored into the AppAutomation entry.
372
+ *
373
+ * Each AppAutomation can carry both `workflowCurrent` (live
374
+ * published version) and `workflowDraft` (in-progress edits) since
375
+ * antman's app definition response surfaces both. The agent picks
376
+ * which to pull at the call site:
377
+ *
378
+ * ```ts
379
+ * defineAutomation.fromJSON(myApp.automations.foo.workflowDraft!)
380
+ * ```
381
+ *
382
+ * (The ref is passed directly, not its `.id` — `fromJSON` takes the
383
+ * typed `AppAutomationWorkflow` shape, mirroring F22's update path.)
384
+ */
385
+ export interface AppAutomationWorkflow<TParams extends Record<string, AppAutomationParam> = {}> {
386
+ /**
387
+ * Runtime-injected discriminator stamped by `defineApp` so the SDK
388
+ * can distinguish a workflow ref from its parent automation ref at
389
+ * tool-config time. Both shapes have the same required surface
390
+ * (`id: string`), so structural typing alone can't tell them apart
391
+ * — `kind` is the runtime safety net. Optional on the type so
392
+ * hand-built test fixtures don't have to set it.
393
+ */
394
+ readonly kind?: "workflow";
395
+ readonly id: string;
396
+ /**
397
+ * On-demand trigger parameters of THIS workflow version, keyed by
398
+ * camelCase parameter name. Emitted by the renderer when the
399
+ * workflow has on-demand parameters; absent when there's no
400
+ * on-demand trigger or no parameters at all. Read at deploy time
401
+ * by `runAutomation`'s static-mode serializer to translate
402
+ * source-side input keys to mobius parameter UUIDs.
403
+ *
404
+ * Lives on the workflow (not on the parent `AppAutomation`)
405
+ * because parameters are versioned with the workflow — an
406
+ * automation's draft can have different params than its current.
407
+ * `runAutomation` references the parent automation; the SDK reads
408
+ * `workflowCurrent.parameters` because mobius dispatches
409
+ * runAutomation to the active version.
410
+ */
411
+ readonly parameters?: TParams;
412
+ }
413
+ export interface AppAutomation<TParams extends Record<string, AppAutomationParam> = {}, TStatus extends "DRAFT" | "ACTIVE" = "ACTIVE"> {
414
+ /**
415
+ * Runtime-injected discriminator stamped by `defineApp`. Pairs with
416
+ * `AppAutomationWorkflow.kind` to let the SDK reject a workflow ref
417
+ * passed where an automation ref was expected (e.g.
418
+ * `agentExecuteWorkflowTool({ automation: ... })`). See the comment
419
+ * on `AppAutomationWorkflow.kind` for the full rationale.
420
+ */
421
+ readonly kind?: "automation";
422
+ readonly id: string;
423
+ readonly name?: string;
424
+ /**
425
+ * Workflow status at the time the app definition was pulled. Codegen
426
+ * emits `"ACTIVE"` when the current workflow is published; otherwise
427
+ * omits or emits `"DRAFT"`. Used by `runAutomation` to reject
428
+ * references to non-active targets at compile time.
429
+ */
430
+ readonly status?: TStatus;
431
+ /**
432
+ * Live published version of this automation. Populated by the agent
433
+ * from the `workflowCurrent` field of the antman app definition
434
+ * response when authoring `defineApp({...})`. Read at pull time
435
+ * via `defineAutomation.fromJSON(myApp.automations.foo.workflowCurrent!)`.
436
+ * Carries the active version's parameters for `runAutomation`
437
+ * static-mode resolution.
438
+ */
439
+ readonly workflowCurrent?: AppAutomationWorkflow<TParams>;
440
+ /**
441
+ * In-progress draft version of this automation. Same shape as
442
+ * `workflowCurrent`. Prefer this when the user asks to "edit" the
443
+ * automation — the draft is the editable surface.
444
+ */
445
+ readonly workflowDraft?: AppAutomationWorkflow<TParams>;
446
+ }
447
+ export interface AppPhoneService {
448
+ readonly id: string;
449
+ readonly description?: string;
450
+ }
451
+ /**
452
+ * Authoring shape of one stage. Read-only — not serialized on
453
+ * aspect compose/update; mutations go through dedicated endpoints.
454
+ *
455
+ * Bag key order encodes workflow order; the wire's `displayOrder`
456
+ * is consumed during pull and not re-exposed here.
457
+ */
458
+ export interface AppStage {
459
+ readonly id: string;
460
+ readonly name: string;
461
+ readonly color?: string;
462
+ readonly icon?: string;
463
+ }
464
+ /**
465
+ * Build a map from field property key → field UUID for the given app.
466
+ * Used by the serializer to rewrite `record.<fieldKey>` → `record.<fieldUUID>`
467
+ * in both trigger and task references. Includes the system `id` field.
468
+ */
469
+ export declare function buildFieldMap(app: App): ReadonlyMap<string, string>;
470
+ /**
471
+ * Build a map from field UUID → field type literal for the given app.
472
+ * Used by the serializer to decide whether a `record.<fieldUuid>` trigger
473
+ * ref placed in a USER_ID / GROUP_ID slot (sendEmail.users / groups) needs
474
+ * an `.id` drill-in: USER and GROUP record fields surface as objects on
475
+ * the wire, and the surrounding slot wants the id specifically.
476
+ */
477
+ export declare function buildFieldTypeByIdMap(app: App): ReadonlyMap<string, string>;
478
+ export type AspectType = "APP" | "ELEMENT" | "TABLE" | "TASK" | "TRANSACTION";
479
+ export interface AppCategory {
480
+ readonly name: string;
481
+ readonly icon?: string;
482
+ readonly color?: string;
483
+ /**
484
+ * Optional category description. The compose endpoint upserts
485
+ * categories by name, so this is only applied when the platform
486
+ * creates a new category — existing-by-name categories keep their own.
487
+ */
488
+ readonly description?: string;
489
+ }
490
+ /**
491
+ * Imported-table cloud mapping surfaced on a pulled aspect backed by
492
+ * an external table (Snowflake today). Carried for round-trip parity;
493
+ * native apps leave it unset.
494
+ */
495
+ export interface AppCloudConnection {
496
+ readonly database?: string;
497
+ readonly schema?: string;
498
+ readonly table?: string;
499
+ readonly readOnly?: boolean;
500
+ }
501
+ /**
502
+ * Minimal structural stand-in for the deleted v1 deploy graph's node shape —
503
+ * kept only so the `App<...>` bag generics below still discriminate builder
504
+ * outputs by their `kind` literal.
505
+ */
506
+ interface Deployable {
507
+ readonly kind: string;
508
+ }
509
+ /**
510
+ * Narrow `Deployable` shapes, discriminated on the `kind` literal every
511
+ * builder output sets (`defineAgent` → `"agent"`, `defineAutomation` →
512
+ * `"automation"`, `defineFlow` → `"flow"`). Used to constrain each App
513
+ * bag so `automations: { myFlow }` or `flows: { myAgent }` are compile
514
+ * errors instead of runtime surprises at deploy time.
515
+ *
516
+ * These are structural (not imported from the builder modules) to avoid
517
+ * a circular import between `core/types/app.ts` and `agents/builder.ts`
518
+ * / `automations/builder.ts` / `flows/builder.ts`. Every builder output
519
+ * satisfies the corresponding shape because its own `kind` field is a
520
+ * literal, not the wider `DeployableKind` union.
521
+ */
522
+ export interface DeployableAgent extends Deployable {
523
+ readonly kind: "agent";
524
+ }
525
+ export interface DeployableAutomation extends Deployable {
526
+ readonly kind: "automation";
527
+ }
528
+ export interface DeployableFlow extends Deployable {
529
+ readonly kind: "flow";
530
+ }
531
+ export interface AppFlow {
532
+ readonly id: string;
533
+ readonly name?: string;
534
+ }
535
+ export interface DeployableApprovalChain extends Deployable {
536
+ readonly kind: "approvalChain";
537
+ }
538
+ export interface DeployableSkill extends Deployable {
539
+ readonly kind: "skill";
540
+ }
541
+ export interface DeployableSearchTable extends Deployable {
542
+ readonly kind: "searchTable";
543
+ }
544
+ export interface AppApprovalChain {
545
+ readonly id: string;
546
+ readonly name?: string;
547
+ }
548
+ /**
549
+ * Each bag accepts both the preloaded "App*" reference shape (from a
550
+ * generated app file — carries a real `.id`) and a freshly-built
551
+ * `Deployable` of the matching kind. A `Deployable`'s id is assigned at
552
+ * deploy time via the late-binding registry.
553
+ */
554
+ export interface App<TFields extends Record<string, AppField> = {}, TAgents extends Record<string, AppAgent | DeployableAgent> = {}, TSearchTables extends Record<string, AppSearchTable | DeployableSearchTable> = {}, TAutomations extends Record<string, AppAutomation | DeployableAutomation> = {}, TPhoneServices extends Record<string, AppPhoneService> = {}, TFlows extends Record<string, AppFlow | DeployableFlow> = {}, TApprovalChains extends Record<string, AppApprovalChain | DeployableApprovalChain> = {}, TAgenticSkills extends Record<string, AppAgenticSkill | DeployableSkill> = {}, TStages extends Record<string, AppStage> = {}, TSystemFields extends Record<string, AppField> = {}> {
555
+ readonly id: string;
556
+ readonly name: string;
557
+ readonly fields: TFields;
558
+ /**
559
+ * Platform-provisioned writable system fields (Title / Status /
560
+ * Stage), keyed by author handle. Populated only by the pull /
561
+ * fetch path — never hand-authored, since the ids are server-
562
+ * assigned. Exposed so record-write surfaces (`createRecord`,
563
+ * `updateField`, agent/skill record tools) can set them by typed
564
+ * ref, e.g. `values: { title: ..., status: (o) => o.inProgress }`.
565
+ *
566
+ * Deliberately a SEPARATE bag from `fields`: the aspect serializer
567
+ * iterates `fields` only, so these never enter the app
568
+ * compose/update payload (re-sending them would collide with the
569
+ * platform's auto-provisioned copies). Read-only system fields (ID,
570
+ * created/updated/closed metadata) are excluded from this bag
571
+ * entirely, which makes them structurally non-writable.
572
+ *
573
+ * Non-optional (like `fields`) so `app.systemFields.<key>` is a
574
+ * direct access without an undefined guard; the factory defaults it
575
+ * to `{}` when no system fields are supplied.
576
+ */
577
+ readonly systemFields: TSystemFields;
578
+ readonly agents: TAgents;
579
+ readonly searchTables: TSearchTables;
580
+ readonly automations: TAutomations;
581
+ readonly phoneServices: TPhoneServices;
582
+ readonly flows: TFlows;
583
+ readonly approvalChains: TApprovalChains;
584
+ readonly agenticSkills: TAgenticSkills;
585
+ readonly stages: TStages;
586
+ readonly handle?: string;
587
+ readonly namespace?: string;
588
+ readonly description?: string;
589
+ readonly type?: AspectType;
590
+ readonly category?: AppCategory;
591
+ readonly icon?: string;
592
+ readonly color?: string;
593
+ /** Cloud link this aspect's records are stored on. */
594
+ readonly cloudLink?: CloudLink;
595
+ /** Imported-table mapping (Snowflake-backed elements). */
596
+ readonly cloudConnection?: AppCloudConnection;
597
+ /**
598
+ * Whether the comments display block is present and unhidden.
599
+ * Sugar over the `displayBlocks` comments entry — the serializer
600
+ * reconciles the two on deploy.
601
+ */
602
+ readonly commentsEnabled?: boolean;
603
+ /** Record-view layout blocks, keyed by author handle. */
604
+ readonly displayBlocks?: DisplayBlockBag;
605
+ /** New-record-form layout blocks, keyed by author handle. */
606
+ readonly recordCreateDisplayBlocks?: DisplayBlockBag;
607
+ /**
608
+ * Produce a json-render `SerializedRenderTree` describing the app
609
+ * as a card with sections for flows, automations, and agents. Built
610
+ * children embed their own `FlowGraph` / `ActivityNode`; pre-loaded
611
+ * `App*` refs render as single neutral leaf nodes (since their
612
+ * internal structure isn't available without a deploy round-trip).
613
+ */
614
+ toUI(): SerializedRenderTree;
615
+ }
616
+ /**
617
+ * Narrow a field map so any entry whose `name` collides with
618
+ * {@link ReservedSystemFieldName} becomes a branded `never`.
619
+ *
620
+ * Since `never` is unassignable from `{ id, name, type }`, the offending
621
+ * entry becomes a `tsc` error at the object-literal position, pointing
622
+ * at the reserved name.
623
+ */
624
+ export type ValidateAppFields<TFields extends Record<string, AppField>> = {
625
+ [K in keyof TFields]: TFields[K]["name"] extends ReservedSystemFieldName ? HasKnownSystemSemanticTag<TFields[K]> extends true ? TFields[K] : _ReservedSystemFieldName<TFields[K]["name"] & string> : TFields[K];
626
+ };
627
+ /**
628
+ * Shared options shape consumed by both the data-only `defineApp`
629
+ * (this file) and the deploy-attached wrapper in
630
+ * `src/aspects/index.ts`. Hoisting the options type to one
631
+ * declaration site means a future addition (e.g. a new optional
632
+ * authoring property) lands in both factories automatically — no
633
+ * silent drift between them.
634
+ *
635
+ * `snapshot` is a type-level discriminator (no runtime use):
636
+ * - Default (`snapshot` omitted or `false`) — agent-authored entry
637
+ * point. `fields` is intersected with {@link ValidateAppFields} so a
638
+ * user field whose `name` collides with {@link ReservedSystemFieldName}
639
+ * is rejected at compile time.
640
+ * - `snapshot: true` — fetched-snapshot entry point emitted by
641
+ * `fetch-app-definition.ts` when rendering an app from antman.
642
+ * Skips the reserved-name check because the data already exists on
643
+ * the server (the brand was designed to catch authoring mistakes,
644
+ * not legitimate fetched state). The agent should only see this
645
+ * flag in `generated/apps/*.ts` files; never write it by hand.
646
+ */
647
+ export interface DefineAppOpts<TFields extends Record<string, AppField> = {}, TAgents extends Record<string, AppAgent | DeployableAgent> = {}, TSearchTables extends Record<string, AppSearchTable | DeployableSearchTable> = {}, TAutomations extends Record<string, AppAutomation | DeployableAutomation> = {}, TPhoneServices extends Record<string, AppPhoneService> = {}, TFlows extends Record<string, AppFlow | DeployableFlow> = {}, TApprovalChains extends Record<string, AppApprovalChain | DeployableApprovalChain> = {}, TAgenticSkills extends Record<string, AppAgenticSkill | DeployableSkill> = {}, TStages extends Record<string, AppStage> = {}, TSnapshot extends boolean = false, TSystemFields extends Record<string, AppField> = {}> {
648
+ readonly id: string;
649
+ readonly name: string;
650
+ readonly snapshot?: TSnapshot;
651
+ readonly fields?: TSnapshot extends true ? TFields : TFields & ValidateAppFields<TFields>;
652
+ /**
653
+ * Writable system fields (Title / Status / Stage). Emitted only by
654
+ * the fetch / pull printer into `generated/apps/*.ts`; never hand-
655
+ * authored (ids are server-assigned). Not run through
656
+ * {@link ValidateAppFields} — this is the one legal home for the
657
+ * reserved system-field names. See {@link App.systemFields}.
658
+ */
659
+ readonly systemFields?: TSystemFields;
660
+ readonly agents?: TAgents;
661
+ readonly searchTables?: TSearchTables;
662
+ readonly automations?: TAutomations;
663
+ readonly phoneServices?: TPhoneServices;
664
+ readonly flows?: TFlows;
665
+ readonly approvalChains?: TApprovalChains;
666
+ readonly agenticSkills?: TAgenticSkills;
667
+ readonly stages?: TStages;
668
+ readonly handle?: string;
669
+ readonly namespace?: string;
670
+ readonly description?: string;
671
+ readonly type?: AspectType;
672
+ readonly category?: AppCategory;
673
+ readonly icon?: string;
674
+ readonly color?: string;
675
+ /** Cloud link this aspect's records are stored on. */
676
+ readonly cloudLink?: CloudLink;
677
+ /** Imported-table mapping (Snowflake-backed elements). */
678
+ readonly cloudConnection?: AppCloudConnection;
679
+ /**
680
+ * Toggle the comments display block. Only available on snapshot
681
+ * sources (pulled via `defineApp.fromJSON(...)`) because the EDK
682
+ * needs the full `displayBlocks` list to reconcile the comments
683
+ * block on update — a fresh create has no list and the platform
684
+ * auto-provisions display blocks without a comments block. To
685
+ * enable comments on a freshly-created app: deploy first, then
686
+ * pull and re-deploy with `commentsEnabled: true`.
687
+ */
688
+ readonly commentsEnabled?: TSnapshot extends true ? boolean : never;
689
+ /** Record-view layout blocks, keyed by author handle. */
690
+ readonly displayBlocks?: DisplayBlockBag;
691
+ /** New-record-form layout blocks, keyed by author handle. */
692
+ readonly recordCreateDisplayBlocks?: DisplayBlockBag;
693
+ }
694
+ export declare function defineApp<const TFields extends Record<string, AppField> = {}, const TAgents extends Record<string, AppAgent | DeployableAgent> = {}, const TSearchTables extends Record<string, AppSearchTable | DeployableSearchTable> = {}, const TAutomations extends Record<string, AppAutomation | DeployableAutomation> = {}, const TPhoneServices extends Record<string, AppPhoneService> = {}, const TFlows extends Record<string, AppFlow | DeployableFlow> = {}, const TApprovalChains extends Record<string, AppApprovalChain | DeployableApprovalChain> = {}, const TAgenticSkills extends Record<string, AppAgenticSkill | DeployableSkill> = {}, const TStages extends Record<string, AppStage> = {}, const TSnapshot extends boolean = false, const TSystemFields extends Record<string, AppField> = {}>(opts: DefineAppOpts<TFields, TAgents, TSearchTables, TAutomations, TPhoneServices, TFlows, TApprovalChains, TAgenticSkills, TStages, TSnapshot, TSystemFields>): App<TFields, TAgents, TSearchTables, TAutomations, TPhoneServices, TFlows, TApprovalChains, TAgenticSkills, TStages, TSystemFields>;
695
+ export type FieldValueType<T extends string> = T extends "TEXT" | "HANDLE" | "HTML" | "RICH_TEXT" | "PICKLIST" ? string : T extends "NUMBER" | "DECIMAL" ? number : T extends "BOOLEAN" ? boolean : T extends "DATE" | "DATETIME" ? string : T extends "USER" | "USER_ID" | "GROUP" | "GROUP_ID" ? string : T extends "UUID" | "ASPECT_ID" | "ASPECT_RECORD_ID" | "ASPECT_FIELD_ID" ? string : T extends "JSON" | "OBJECT" ? unknown : string;
696
+ /**
697
+ * Value type for a single app field: static picklists use `PicklistOption` (one of `options` values);
698
+ * dynamic picklists stay `string`; multi-picklists use arrays of options or strings.
699
+ *
700
+ * Constraint is `AppField<FieldScope>` (any scope) — TS invariance otherwise
701
+ * rejects `AppField<"row">` fed into an `AppField<"unscoped">`-defaulted slot.
702
+ */
703
+ export type FieldValueForAppField<F extends AppField<FieldScope>> = F extends {
704
+ type: "PICKLIST";
705
+ readonly options: infer O extends Readonly<Record<string, PicklistOption>>;
706
+ } ? O[keyof O] : F extends {
707
+ type: "PICKLIST";
708
+ } ? string : F extends {
709
+ type: "MULTI_PICKLIST";
710
+ readonly options: infer O extends Readonly<Record<string, PicklistOption>>;
711
+ } ? ReadonlyArray<O[keyof O] | string> : F extends {
712
+ type: "MULTI_PICKLIST";
713
+ } ? ReadonlyArray<string> : FieldValueType<F["type"]>;
714
+ /**
715
+ * Full row shape for app `A` — field names map to each field’s value type.
716
+ * Use with `Ref<AspectRecord<A>>` anywhere a platform record reference is required.
717
+ *
718
+ * `id` is merged directly into the mapped type rather than via intersection
719
+ * (`{ id: string } & { ... }`) so that `DeepRef<AspectRecord<A>>` can resolve
720
+ * `id` as a valid key. TypeScript does not fully flatten intersections inside
721
+ * conditional mapped types, so `ctx.trigger.record.id` would fail to type-check
722
+ * with the intersection form.
723
+ */
724
+ export type AspectRecord<A extends App> = A extends App<infer TFields, any, any, any, any, any, any, any, any, infer TSystemFields> ? {
725
+ [K in keyof TFields | keyof TSystemFields | "id"]: K extends "id" ? string : K extends keyof TFields ? FieldValueForAppField<TFields[K]> : K extends keyof TSystemFields ? FieldValueForAppField<TSystemFields[K] & AppField> : never;
726
+ } : unknown;
727
+ /**
728
+ * A record ref from *any* app. Used by cross-app tasks (`updateField`,
729
+ * `postComment`) where the task owner's app types the writable fields
730
+ * (via `AppFieldValues<A>`), but the record being acted on may have been
731
+ * produced by a `recordSearch` / trigger / `forEach` over a different
732
+ * app. Every record has at least `id`; other keys vary per app.
733
+ */
734
+ export type AnyAspectRecord = {
735
+ id: string;
736
+ } & Record<string, unknown>;
737
+ export type SearchTableRecord<ST> = ST extends AppSearchTable<infer TFields> ? {
738
+ [K in keyof TFields]: FieldValueForAppField<TFields[K]>;
739
+ } : unknown;
740
+ /**
741
+ * A field descriptor that belongs to app `A` (union of `app.fields.*`).
742
+ * Use for APIs that take field references scoped to one app, e.g. `recordFieldLocking`.
743
+ * Intersection with `AppField` keeps this assignable where `AppField` is required (indexed access widens otherwise).
744
+ */
745
+ export type AppFieldOf<A extends App> = (NonNullable<A["fields"][keyof A["fields"]]> | NonNullable<A["systemFields"][keyof A["systemFields"]]>) & AppField;
746
+ /**
747
+ * Re-tags a `fields` bag so each descriptor carries the `"row"` scope marker.
748
+ * Runtime shape is identical to the source bag — only the type changes, so
749
+ * the `& AppField<"row">` intersection is a zero-cost annotation.
750
+ */
751
+ export type RowScopedFields<TFields extends Record<string, AppField>> = {
752
+ readonly [K in keyof TFields]: TFields[K] & AppField<"row">;
753
+ };
754
+ /**
755
+ * Typed view over any object with a `fields` bag where every descriptor is
756
+ * marked row-scoped. Works for both `App` and `AppSearchTable` — the
757
+ * constraint is structural (`{ fields: Record<string, AppField> }`), not
758
+ * nominal. Handed to callers by a row-filter callback; never constructed at
759
+ * module scope, so `row.fields.X` is the only path that yields an
760
+ * `AppField<"row">` — exactly the shape filter helpers require.
761
+ */
762
+ export type RowProxy<T extends {
763
+ fields: Record<string, AppField>;
764
+ }> = {
765
+ readonly fields: RowScopedFields<T["fields"]>;
766
+ /**
767
+ * Row-scoped view of the app's writable system fields (Title /
768
+ * Status / Stage), so a filter can reference one:
769
+ * `eq(row.systemFields.status, …)`. Empty when the source has none.
770
+ */
771
+ readonly systemFields: T extends {
772
+ systemFields: infer S extends Record<string, AppField>;
773
+ } ? RowScopedFields<S> : Record<string, never>;
774
+ };
775
+ /**
776
+ * Build a row proxy. Runtime-only identity cast — the returned object IS
777
+ * the source; only its static type changes to expose row-scoped fields.
778
+ * Tasks that filter rows call this before invoking the user's callback so
779
+ * the callback argument is typed as `RowProxy<T>`.
780
+ */
781
+ export declare function asRowProxy<T extends {
782
+ fields: Record<string, AppField>;
783
+ }>(source: T): RowProxy<T>;
784
+ /**
785
+ * Static picklist value in tasks: `values: { stage: (options) => options.Assigned }`.
786
+ * `options` is that field's `options` map (same object as `app.fields.<field>.options`).
787
+ */
788
+ export type PicklistOptionsResolver<F extends AppField> = F extends {
789
+ type: "PICKLIST";
790
+ readonly options: infer O extends Readonly<Record<string, PicklistOption>>;
791
+ } ? (options: O) => O[keyof O] : F extends {
792
+ type: "MULTI_PICKLIST";
793
+ readonly options: infer O extends Readonly<Record<string, PicklistOption>>;
794
+ } ? (options: O) => FieldValueForAppField<F> : never;
795
+ /**
796
+ * Allowed `values` entry per field. Static picklists: **only** `(options) => options.X` or `Ref` (e.g. dynamic UUID).
797
+ * Other fields: `ValueOrRef` as usual.
798
+ */
799
+ export type AppFieldInputForTask<F extends AppField> = F extends {
800
+ type: "PICKLIST";
801
+ readonly options: Readonly<Record<string, PicklistOption>>;
802
+ } ? PicklistOptionsResolver<F> | Ref<FieldValueForAppField<F>> : F extends {
803
+ type: "MULTI_PICKLIST";
804
+ readonly options: Readonly<Record<string, PicklistOption>>;
805
+ } ? PicklistOptionsResolver<F> | Ref<FieldValueForAppField<F>> : import("../../entities/shared/ref.js").ValueOrRef<FieldValueForAppField<F>>;
806
+ /** The writable system-field bag of an app, with the optional slot narrowed away. */
807
+ export type SystemFieldsOf<A extends App> = NonNullable<A["systemFields"]>;
808
+ /**
809
+ * Typed `values` shape for `createRecord` / `updateField`. Keys are the
810
+ * app's own field handles AND its system-field handles, so an author can
811
+ * set system-tagged fields in the same object as custom fields:
812
+ *
813
+ * values: { title: "...", status: (o) => o.inProgress, customField: 1 }
814
+ *
815
+ * Whether a field is backend-owned/read-only is decided from deploy state
816
+ * (`system: true`) at plan/apply time; tags alone are not enough.
817
+ */
818
+ export type AppFieldValues<A extends App> = WritableFieldValues<A["fields"]> & WritableFieldValues<SystemFieldsOf<A>>;
819
+ export declare function resolveFieldValues(app: App, values: Record<string, unknown>): Array<{
820
+ fieldId: string;
821
+ value: unknown;
822
+ }>;
823
+ /**
824
+ * Typed `inputs:` shape for `runAutomation` in static mode. Keys are the
825
+ * target automation's on-demand trigger parameter names; values are
826
+ * type-checked against each parameter's declared `WorkflowFieldType`.
827
+ *
828
+ * Unknown keys are a compile error. All entries are optional so callers
829
+ * can omit non-required parameters; runtime validation of `required`
830
+ * parameters is deferred to Mobius.
831
+ *
832
+ * Constraint is over `AppAutomation<any>` so the mapped type can infer
833
+ * `TParams` from a concrete automation passed in.
834
+ */
835
+ export type AutomationInputValues<AA extends AppAutomation<any>> = AA extends AppAutomation<infer TParams> ? [keyof TParams] extends [never] ? Record<string, never> : {
836
+ [K in keyof TParams]?: ValueOrRef<FieldValueType<TParams[K]["type"] extends string ? TParams[K]["type"] : never>>;
837
+ } : never;
838
+ export {};