@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +462 -3
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
  3. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
  4. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
  5. package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
  6. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
  7. package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
  8. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
  9. package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
  10. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
  11. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
  12. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
  13. package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
  14. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
  15. package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
  16. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
  17. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
  18. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
  19. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
  20. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
  21. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
  22. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
  23. package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
  24. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
  25. package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
  26. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
  27. package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
  28. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
  29. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
  30. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
  31. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
  32. package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
  33. package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
  34. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
  35. package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
  36. package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
  37. package/dist-sdk/elementum-entity-client/errors.js +111 -0
  38. package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
  39. package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
  40. package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
  41. package/dist-sdk/elementum-entity-client/types.js +1 -0
  42. package/dist-sdk/fs/entity.d.ts +104 -0
  43. package/dist-sdk/fs/entity.js +52 -0
  44. package/dist-sdk/pull/util.d.ts +130 -0
  45. package/dist-sdk/pull/util.js +204 -0
  46. package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
  47. package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
  48. package/dist-sdk/src/catalog/factories.d.ts +242 -0
  49. package/dist-sdk/src/catalog/factories.js +265 -0
  50. package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
  51. package/dist-sdk/src/catalog/from-authoring.js +467 -0
  52. package/dist-sdk/src/catalog/index.d.ts +12 -0
  53. package/dist-sdk/src/catalog/index.js +12 -0
  54. package/dist-sdk/src/catalog/org.d.ts +11 -0
  55. package/dist-sdk/src/catalog/org.js +288 -0
  56. package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
  57. package/dist-sdk/src/catalog/render-helpers.js +82 -0
  58. package/dist-sdk/src/catalog/render.d.ts +48 -0
  59. package/dist-sdk/src/catalog/render.js +193 -0
  60. package/dist-sdk/src/catalog/token.d.ts +10 -0
  61. package/dist-sdk/src/catalog/token.js +76 -0
  62. package/dist-sdk/src/catalog/types.d.ts +215 -0
  63. package/dist-sdk/src/catalog/types.js +86 -0
  64. package/dist-sdk/src/catalog/write.d.ts +43 -0
  65. package/dist-sdk/src/catalog/write.js +109 -0
  66. package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
  67. package/dist-sdk/src/core/app-to-ui.js +75 -0
  68. package/dist-sdk/src/core/index.d.ts +10 -0
  69. package/dist-sdk/src/core/index.js +9 -0
  70. package/dist-sdk/src/core/system-fields.d.ts +95 -0
  71. package/dist-sdk/src/core/system-fields.js +153 -0
  72. package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
  73. package/dist-sdk/src/core/triggers/on-demand.js +112 -0
  74. package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
  75. package/dist-sdk/src/core/types/ai-provider.js +8 -0
  76. package/dist-sdk/src/core/types/app.d.ts +857 -0
  77. package/dist-sdk/src/core/types/app.js +210 -0
  78. package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
  79. package/dist-sdk/src/core/types/aspect-category.js +33 -0
  80. package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
  81. package/dist-sdk/src/core/types/cloud-link.js +32 -0
  82. package/dist-sdk/src/core/types/display-block.d.ts +149 -0
  83. package/dist-sdk/src/core/types/display-block.js +61 -0
  84. package/dist-sdk/src/core/types/group.d.ts +13 -0
  85. package/dist-sdk/src/core/types/group.js +6 -0
  86. package/dist-sdk/src/core/types/platform.d.ts +2 -0
  87. package/dist-sdk/src/core/types/platform.js +1 -0
  88. package/dist-sdk/src/core/types/user.d.ts +20 -0
  89. package/dist-sdk/src/core/types/user.js +8 -0
  90. package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
  91. package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
  92. package/dist-sdk/src/engine/build/context.d.ts +67 -0
  93. package/dist-sdk/src/engine/build/context.js +6 -0
  94. package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
  95. package/dist-sdk/src/engine/build/source-context.js +23 -0
  96. package/dist-sdk/src/engine/entity.d.ts +44 -0
  97. package/dist-sdk/src/engine/entity.js +15 -0
  98. package/dist-sdk/src/engine/pull/context.d.ts +38 -0
  99. package/dist-sdk/src/engine/pull/context.js +44 -0
  100. package/dist-sdk/src/engine/pull/org.d.ts +54 -0
  101. package/dist-sdk/src/engine/pull/org.js +134 -0
  102. package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
  103. package/dist-sdk/src/engine/tf/escape.js +28 -0
  104. package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
  105. package/dist-sdk/src/engine/tf/expr.js +405 -0
  106. package/dist-sdk/src/engine/tf/index.d.ts +12 -0
  107. package/dist-sdk/src/engine/tf/index.js +11 -0
  108. package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
  109. package/dist-sdk/src/engine/tf/labels.js +196 -0
  110. package/dist-sdk/src/engine/tf/model.d.ts +84 -0
  111. package/dist-sdk/src/engine/tf/model.js +49 -0
  112. package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
  113. package/dist-sdk/src/engine/tf/parse.js +189 -0
  114. package/dist-sdk/src/engine/tf/render.d.ts +13 -0
  115. package/dist-sdk/src/engine/tf/render.js +102 -0
  116. package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
  117. package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
  118. package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
  119. package/dist-sdk/src/entities/access-policy/build.js +7 -0
  120. package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
  121. package/dist-sdk/src/entities/access-policy/filter.js +83 -0
  122. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
  123. package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
  124. package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
  125. package/dist-sdk/src/entities/access-policy/module.js +17 -0
  126. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
  127. package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
  128. package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
  129. package/dist-sdk/src/entities/access-policy/types.js +10 -0
  130. package/dist-sdk/src/entities/agent/build.d.ts +108 -0
  131. package/dist-sdk/src/entities/agent/build.js +148 -0
  132. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
  133. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
  134. package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
  135. package/dist-sdk/src/entities/agent/from-tf.js +289 -0
  136. package/dist-sdk/src/entities/agent/index.d.ts +7 -0
  137. package/dist-sdk/src/entities/agent/index.js +7 -0
  138. package/dist-sdk/src/entities/agent/module.d.ts +4 -0
  139. package/dist-sdk/src/entities/agent/module.js +122 -0
  140. package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
  141. package/dist-sdk/src/entities/agent/to-tf.js +188 -0
  142. package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
  143. package/dist-sdk/src/entities/agent/tools.js +238 -0
  144. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
  145. package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
  146. package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
  147. package/dist-sdk/src/entities/agent-tool/module.js +32 -0
  148. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
  149. package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
  150. package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
  151. package/dist-sdk/src/entities/agent-tool/types.js +102 -0
  152. package/dist-sdk/src/entities/app/build.d.ts +368 -0
  153. package/dist-sdk/src/entities/app/build.js +372 -0
  154. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
  155. package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
  156. package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
  157. package/dist-sdk/src/entities/app/display-blocks.js +34 -0
  158. package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
  159. package/dist-sdk/src/entities/app/from-tf.js +197 -0
  160. package/dist-sdk/src/entities/app/index.d.ts +14 -0
  161. package/dist-sdk/src/entities/app/index.js +11 -0
  162. package/dist-sdk/src/entities/app/locals.d.ts +11 -0
  163. package/dist-sdk/src/entities/app/locals.js +31 -0
  164. package/dist-sdk/src/entities/app/module.d.ts +4 -0
  165. package/dist-sdk/src/entities/app/module.js +66 -0
  166. package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
  167. package/dist-sdk/src/entities/app/to-tf.js +212 -0
  168. package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
  169. package/dist-sdk/src/entities/approval-chain/build.js +56 -0
  170. package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
  171. package/dist-sdk/src/entities/approval-chain/index.js +6 -0
  172. package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
  173. package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
  174. package/dist-sdk/src/entities/automation/build.d.ts +259 -0
  175. package/dist-sdk/src/entities/automation/build.js +436 -0
  176. package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
  177. package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
  178. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
  179. package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
  180. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
  181. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
  182. package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
  183. package/dist-sdk/src/entities/automation/filter.js +156 -0
  184. package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
  185. package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
  186. package/dist-sdk/src/entities/automation/index.d.ts +22 -0
  187. package/dist-sdk/src/entities/automation/index.js +25 -0
  188. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  189. package/dist-sdk/src/entities/automation/module.js +150 -0
  190. package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
  191. package/dist-sdk/src/entities/automation/operators.js +69 -0
  192. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
  193. package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
  194. package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
  195. package/dist-sdk/src/entities/automation/script-code.js +633 -0
  196. package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
  197. package/dist-sdk/src/entities/automation/serialize.js +41 -0
  198. package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
  199. package/dist-sdk/src/entities/automation/tasks.js +765 -0
  200. package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
  201. package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
  202. package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
  203. package/dist-sdk/src/entities/automation/triggers.js +202 -0
  204. package/dist-sdk/src/entities/automation/types.d.ts +78 -0
  205. package/dist-sdk/src/entities/automation/types.js +131 -0
  206. package/dist-sdk/src/entities/element/build.d.ts +121 -0
  207. package/dist-sdk/src/entities/element/build.js +110 -0
  208. package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
  209. package/dist-sdk/src/entities/element/from-tf.js +170 -0
  210. package/dist-sdk/src/entities/element/index.d.ts +12 -0
  211. package/dist-sdk/src/entities/element/index.js +10 -0
  212. package/dist-sdk/src/entities/element/locals.d.ts +7 -0
  213. package/dist-sdk/src/entities/element/locals.js +12 -0
  214. package/dist-sdk/src/entities/element/module.d.ts +8 -0
  215. package/dist-sdk/src/entities/element/module.js +65 -0
  216. package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
  217. package/dist-sdk/src/entities/element/to-tf.js +169 -0
  218. package/dist-sdk/src/entities/field/build.d.ts +112 -0
  219. package/dist-sdk/src/entities/field/build.js +84 -0
  220. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
  221. package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
  222. package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
  223. package/dist-sdk/src/entities/field/calc/date.js +109 -0
  224. package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
  225. package/dist-sdk/src/entities/field/calc/index.js +433 -0
  226. package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
  227. package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
  228. package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
  229. package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
  230. package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
  231. package/dist-sdk/src/entities/field/calc/text.js +208 -0
  232. package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
  233. package/dist-sdk/src/entities/field/calc/types.js +23 -0
  234. package/dist-sdk/src/entities/field/calc.d.ts +108 -0
  235. package/dist-sdk/src/entities/field/calc.js +54 -0
  236. package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
  237. package/dist-sdk/src/entities/field/from-tf.js +184 -0
  238. package/dist-sdk/src/entities/field/locals.d.ts +8 -0
  239. package/dist-sdk/src/entities/field/locals.js +24 -0
  240. package/dist-sdk/src/entities/field/module.d.ts +3 -0
  241. package/dist-sdk/src/entities/field/module.js +50 -0
  242. package/dist-sdk/src/entities/field/options.d.ts +27 -0
  243. package/dist-sdk/src/entities/field/options.js +76 -0
  244. package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
  245. package/dist-sdk/src/entities/field/record-shape.js +1 -0
  246. package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
  247. package/dist-sdk/src/entities/field/to-tf.js +142 -0
  248. package/dist-sdk/src/entities/field/types.d.ts +53 -0
  249. package/dist-sdk/src/entities/field/types.js +68 -0
  250. package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
  251. package/dist-sdk/src/entities/file-reader/build.js +105 -0
  252. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
  253. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
  254. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
  255. package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
  256. package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
  257. package/dist-sdk/src/entities/file-reader/index.js +10 -0
  258. package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
  259. package/dist-sdk/src/entities/file-reader/module.js +115 -0
  260. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
  261. package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
  262. package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
  263. package/dist-sdk/src/entities/file-reader/types.js +30 -0
  264. package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
  265. package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
  266. package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
  267. package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
  268. package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
  269. package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
  270. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
  271. package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
  272. package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
  273. package/dist-sdk/src/entities/flow/activities/form.js +36 -0
  274. package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
  275. package/dist-sdk/src/entities/flow/activities/index.js +13 -0
  276. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
  277. package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
  278. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
  279. package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
  280. package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
  281. package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
  282. package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
  283. package/dist-sdk/src/entities/flow/activities/types.js +1 -0
  284. package/dist-sdk/src/entities/flow/build.d.ts +38 -0
  285. package/dist-sdk/src/entities/flow/build.js +115 -0
  286. package/dist-sdk/src/entities/flow/index.d.ts +8 -0
  287. package/dist-sdk/src/entities/flow/index.js +7 -0
  288. package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
  289. package/dist-sdk/src/entities/flow/serialize.js +94 -0
  290. package/dist-sdk/src/entities/flow/util.d.ts +27 -0
  291. package/dist-sdk/src/entities/flow/util.js +38 -0
  292. package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
  293. package/dist-sdk/src/entities/org/ai-provider.js +46 -0
  294. package/dist-sdk/src/entities/org/category.d.ts +5 -0
  295. package/dist-sdk/src/entities/org/category.js +33 -0
  296. package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
  297. package/dist-sdk/src/entities/org/cloud-link.js +33 -0
  298. package/dist-sdk/src/entities/org/connector.d.ts +12 -0
  299. package/dist-sdk/src/entities/org/connector.js +35 -0
  300. package/dist-sdk/src/entities/org/group.d.ts +5 -0
  301. package/dist-sdk/src/entities/org/group.js +40 -0
  302. package/dist-sdk/src/entities/org/index.d.ts +11 -0
  303. package/dist-sdk/src/entities/org/index.js +11 -0
  304. package/dist-sdk/src/entities/org/role.d.ts +7 -0
  305. package/dist-sdk/src/entities/org/role.js +21 -0
  306. package/dist-sdk/src/entities/org/user.d.ts +7 -0
  307. package/dist-sdk/src/entities/org/user.js +30 -0
  308. package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
  309. package/dist-sdk/src/entities/search-table/build.js +79 -0
  310. package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
  311. package/dist-sdk/src/entities/search-table/index.js +5 -0
  312. package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
  313. package/dist-sdk/src/entities/search-table/module.js +64 -0
  314. package/dist-sdk/src/entities/shared/context.d.ts +93 -0
  315. package/dist-sdk/src/entities/shared/context.js +156 -0
  316. package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
  317. package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
  318. package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
  319. package/dist-sdk/src/entities/shared/filters/index.js +372 -0
  320. package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
  321. package/dist-sdk/src/entities/shared/filters/types.js +7 -0
  322. package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
  323. package/dist-sdk/src/entities/shared/ref.js +119 -0
  324. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
  325. package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
  326. package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
  327. package/dist-sdk/src/entities/shared/types/common.js +64 -0
  328. package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
  329. package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
  330. package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
  331. package/dist-sdk/src/entities/shared/types/platform.js +10 -0
  332. package/dist-sdk/src/entities/skill/build.d.ts +25 -0
  333. package/dist-sdk/src/entities/skill/build.js +50 -0
  334. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
  335. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
  336. package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
  337. package/dist-sdk/src/entities/skill/from-tf.js +96 -0
  338. package/dist-sdk/src/entities/skill/index.d.ts +7 -0
  339. package/dist-sdk/src/entities/skill/index.js +7 -0
  340. package/dist-sdk/src/entities/skill/module.d.ts +4 -0
  341. package/dist-sdk/src/entities/skill/module.js +111 -0
  342. package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
  343. package/dist-sdk/src/entities/skill/to-tf.js +59 -0
  344. package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
  345. package/dist-sdk/src/entities/skill/tools.js +105 -0
  346. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
  347. package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
  348. package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
  349. package/dist-sdk/src/entities/skill-tool/module.js +21 -0
  350. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
  351. package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
  352. package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
  353. package/dist-sdk/src/entities/skill-tool/types.js +67 -0
  354. package/dist-sdk/src/entities/table/build.d.ts +74 -0
  355. package/dist-sdk/src/entities/table/build.js +339 -0
  356. package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
  357. package/dist-sdk/src/entities/table/catalog-render.js +39 -0
  358. package/dist-sdk/src/entities/table/fields.d.ts +81 -0
  359. package/dist-sdk/src/entities/table/fields.js +70 -0
  360. package/dist-sdk/src/entities/table/filter.d.ts +41 -0
  361. package/dist-sdk/src/entities/table/filter.js +89 -0
  362. package/dist-sdk/src/entities/table/index.d.ts +8 -0
  363. package/dist-sdk/src/entities/table/index.js +12 -0
  364. package/dist-sdk/src/entities/table/joins.d.ts +26 -0
  365. package/dist-sdk/src/entities/table/joins.js +31 -0
  366. package/dist-sdk/src/entities/table/keys.d.ts +11 -0
  367. package/dist-sdk/src/entities/table/keys.js +25 -0
  368. package/dist-sdk/src/entities/table/module.d.ts +5 -0
  369. package/dist-sdk/src/entities/table/module.js +25 -0
  370. package/dist-sdk/src/entities/table/state.d.ts +39 -0
  371. package/dist-sdk/src/entities/table/state.js +43 -0
  372. package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
  373. package/dist-sdk/src/entities/view/from-tf.js +235 -0
  374. package/dist-sdk/src/entities/view/module.d.ts +24 -0
  375. package/dist-sdk/src/entities/view/module.js +61 -0
  376. package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
  377. package/dist-sdk/src/entities/view/to-tf.js +171 -0
  378. package/dist-sdk/src/entities/view/types.d.ts +58 -0
  379. package/dist-sdk/src/entities/view/types.js +89 -0
  380. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
  381. package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
  382. package/dist-sdk/src/graph/index.d.ts +91 -0
  383. package/dist-sdk/src/graph/index.js +211 -0
  384. package/dist-sdk/src/graph/modules.d.ts +7 -0
  385. package/dist-sdk/src/graph/modules.js +42 -0
  386. package/dist-sdk/src/graph/types.d.ts +375 -0
  387. package/dist-sdk/src/graph/types.js +102 -0
  388. package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
  389. package/dist-sdk/src/internal/sdk-package.js +23 -0
  390. package/package.json +201 -8
@@ -0,0 +1,344 @@
1
+ /**
2
+ * printAgentV2 — pulled agent rendering for the terraform path (M3).
3
+ * Consumes the `NormalizedAgent` that `agentFromTf` produces and emits an
4
+ * `apps/<app>/agents/<refName>.ts` authoring file: `defineAgent` with the
5
+ * connector as a `catalog.aiProviders.<provider>.models.<model>` token (the
6
+ * generated org-root barrel re-exports `org.aiProviders`, so this file needs
7
+ * no separate relative `org.js` import), tool targets as `catalog` tokens
8
+ * (self-app) or a TODO literal (foreign apps — their catalog may not exist
9
+ * in this workspace), and tool fields as `catalog.<app>.fields.<key>`.
10
+ *
11
+ * Platform ids never reach printed source (plan §4.2).
12
+ */
13
+ import { quote } from "../../../../pull/util.js";
14
+ import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
15
+ const TOOL_FACTORY_BY_TYPE_KEY = {
16
+ createRecord: "agentCreateRecord",
17
+ searchAspect: "agentSearchAspect",
18
+ updateRecord: "agentUpdateRecord",
19
+ executeWorkflow: "agentRunAutomation",
20
+ searchTable: "agentSearchTable",
21
+ };
22
+ /**
23
+ * A safe placeholder `ConnectorRef` literal (board issue — a property-access
24
+ * chain like `catalog.aiProviders.TODO_PROVIDER.models.TODO_CONNECTOR` looks
25
+ * like a TODO but ISN'T one: `TODO_PROVIDER` is never a real catalog key, so
26
+ * evaluating that expression throws the moment ANYTHING loads the file (a
27
+ * build, `edk pull org --data-only`'s catalog-regen bootstrap, …) instead of
28
+ * failing with the intended "needs manual review" diagnostic. A plain
29
+ * `ConnectorRef`-shaped object literal — the same pattern `foreignApp`/
30
+ * `foreignSkill` stubs already use — loads safely; `agentToTf`'s org-catalog
31
+ * lookup then degrades it to a clear build-time diagnostic instead
32
+ * ("connector token ... is not in the org catalog"), exactly like an
33
+ * unresolved foreignApp/foreignSkill token does.
34
+ */
35
+ const TODO_CONNECTOR_TOKEN = '{ __kind: "connector", refName: "TODO_CONNECTOR", name: "TODO_CONNECTOR", parent: "TODO_PROVIDER" }';
36
+ /** A connector's compound "<provider>.<model>" key → its catalog token path. */
37
+ function printConnectorToken(connectorKey) {
38
+ const [providerKey, modelKey] = connectorKey.split(".");
39
+ if (providerKey === undefined || modelKey === undefined) {
40
+ return `${TODO_CONNECTOR_TOKEN} /* TODO: unrecognized connector key "${connectorKey}" */`;
41
+ }
42
+ return `catalog.aiProviders.${providerKey}.models.${modelKey}`;
43
+ }
44
+ export function printAgentV2(agent, opts) {
45
+ const { appRefName } = opts;
46
+ const crossOrg = opts.crossOrg === true;
47
+ const factories = [...new Set(agent.tools.map((t) => TOOL_FACTORY_BY_TYPE_KEY[t.typeKey]).filter(Boolean))].sort();
48
+ const lines = [];
49
+ lines.push("/**");
50
+ lines.push(` * ${agent.name}`);
51
+ lines.push(" *");
52
+ lines.push(" * Auto-generated by EDK (v2 pull). Hand-edit freely; the generator is a");
53
+ lines.push(" * one-shot starting point, not a live-binding view.");
54
+ lines.push(" */");
55
+ lines.push("");
56
+ lines.push(`import { ${[...factories, "defineAgent"].sort().join(", ")} } from "${sdkPackageSpecifier("agents")}";`);
57
+ // Always needed: `connector:` is required and always a catalog.aiProviders
58
+ // token (or the TODO placeholder), and the barrel already re-exports
59
+ // org.aiProviders — no separate relative org.js import is needed here.
60
+ lines.push(`import catalog from "@catalog";`);
61
+ lines.push("");
62
+ lines.push(`const ${agent.refName} = defineAgent({`);
63
+ lines.push(` name: ${quote(agent.name)},`);
64
+ lines.push(` parent: ${quote(appRefName)},`);
65
+ const connectorMatchesDestination = agent.connectorKey !== undefined && (opts.destinationConnectorKeys?.has(agent.connectorKey) ?? false);
66
+ if (opts.connectorKeyOverride !== undefined) {
67
+ // Interactively confirmed by the caller — print directly, uncommented,
68
+ // regardless of which TODO path this would otherwise have taken.
69
+ lines.push(` connector: ${printConnectorToken(opts.connectorKeyOverride)},`);
70
+ }
71
+ else if (agent.connectorKey !== undefined && crossOrg && !connectorMatchesDestination) {
72
+ // Resolved, but against the SOURCE org's catalog, and no same-named
73
+ // connector was found in the destination — flag for manual review
74
+ // rather than carry over a token that doesn't exist there.
75
+ lines.push(` connector: ${TODO_CONNECTOR_TOKEN}, // TODO: cross-org clone — connector "${agent.connectorKey}" was resolved in the SOURCE org; verify/replace with the destination org's catalog.aiProviders.<provider>.models.<model>`);
76
+ }
77
+ else if (agent.connectorKey !== undefined) {
78
+ // Either same-org, or cross-org with a same-named connector confirmed
79
+ // present in the destination org.
80
+ lines.push(` connector: ${printConnectorToken(agent.connectorKey)},`);
81
+ }
82
+ else {
83
+ // No connector in the stream — the platform defaulted the model. There
84
+ // is no token to print; the author picks one (connector is required).
85
+ lines.push(` connector: ${TODO_CONNECTOR_TOKEN}, // TODO: no connector in the export — pick one`);
86
+ }
87
+ lines.push(` description: ${quote(agent.description)},`);
88
+ lines.push(` instructions: ${quote(agent.instructions)},`);
89
+ if (agent.firstMessage !== undefined)
90
+ lines.push(` firstMessage: ${quote(agent.firstMessage)},`);
91
+ if (agent.maxLength !== undefined)
92
+ lines.push(` maxLength: ${String(agent.maxLength)},`);
93
+ if (agent.skillAccess !== undefined) {
94
+ lines.push(...printSkillAccess(agent.skillAccess, appRefName, crossOrg).map((l) => ` ${l}`));
95
+ }
96
+ if (agent.runAs !== undefined)
97
+ lines.push(` runAs: ${printRunAs(agent.runAs)},`);
98
+ if (agent.agentAuthentication !== undefined) {
99
+ lines.push(...printAgentAuthentication(agent.agentAuthentication).map((l) => ` ${l}`));
100
+ }
101
+ if (agent.conversationIdleTimeout !== undefined) {
102
+ lines.push(` conversationIdleTimeout: ${quote(agent.conversationIdleTimeout)},`);
103
+ }
104
+ if (agent.a2aStreaming !== undefined)
105
+ lines.push(` a2aStreaming: ${String(agent.a2aStreaming)},`);
106
+ if (agent.tools.length > 0) {
107
+ lines.push(" tools: [");
108
+ for (const tool of agent.tools) {
109
+ lines.push(...printTool(tool, appRefName, crossOrg, opts.foreignAppRefNames, opts.foreignElementRefNames).map((l) => ` ${l}`));
110
+ }
111
+ lines.push(" ],");
112
+ }
113
+ lines.push("});");
114
+ lines.push("");
115
+ lines.push(`export default ${agent.refName};`);
116
+ lines.push("");
117
+ return lines.join("\n");
118
+ }
119
+ /** Dot access for identifier-safe names, bracket access otherwise. */
120
+ function safeMember(name) {
121
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) ? `.${name}` : `[${quote(name)}]`;
122
+ }
123
+ /** Bare object key for identifier-safe names, quoted otherwise. */
124
+ function safeKey(name) {
125
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) ? name : quote(name);
126
+ }
127
+ /**
128
+ * A skill reference line, INCLUDING its trailing comma (and, cross-org, a
129
+ * trailing TODO comment) — the comma must precede the comment or it gets
130
+ * swallowed into commented-out text and silently drops the array separator,
131
+ * same failure mode as a manually-mistyped `,/ TODO` comment marker.
132
+ */
133
+ function printSkillRefToken(ref, appRefName, crossOrg) {
134
+ if (ref.kind === "self")
135
+ return `catalog.${appRefName}.skills.${ref.key},`;
136
+ if (ref.kind === "unresolved") {
137
+ // No name, no data block - nothing to build a real token from. Round-trips
138
+ // the exact raw id via `unresolvedId`, the same escape ApprovalChainRef
139
+ // already uses for its own no-data-lookup case. `name` is required by
140
+ // SkillRef's shape even though there's no real display name to put there;
141
+ // the raw id fills both slots, same as `refName`.
142
+ return `{ __kind: "skill", refName: ${quote(ref.id)}, name: ${quote(ref.id)}, unresolvedId: ${quote(ref.id)} }, // TODO: this skill isn't resolvable from the export (no name, no data block) - identify it manually and replace with a real catalog.<app>.skills.<key> token`;
143
+ }
144
+ // The foreign app's catalog may not exist in this workspace — a literal
145
+ // token compiles and deploys; swap for a catalog token when available.
146
+ const todo = crossOrg
147
+ ? ` // TODO: cross-org clone — "${ref.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
148
+ : "";
149
+ return `{ __kind: "skill", refName: ${quote(ref.name)}, name: ${quote(ref.name)} },${todo}`;
150
+ }
151
+ function printSkillAccess(access, appRefName, crossOrg) {
152
+ const hasPreloaded = access.preloadedSkills !== undefined && access.preloadedSkills.length > 0;
153
+ if (access.mode !== "CUSTOM" && !hasPreloaded) {
154
+ return [`skillAccess: { mode: ${quote(access.mode)} },`];
155
+ }
156
+ const lines = [`skillAccess: {`, ` mode: ${quote(access.mode)},`];
157
+ if (access.mode === "CUSTOM") {
158
+ lines.push(` skills: [`);
159
+ for (const ref of access.skills)
160
+ lines.push(` ${printSkillRefToken(ref, appRefName, crossOrg)}`);
161
+ lines.push(` ],`);
162
+ }
163
+ if (hasPreloaded) {
164
+ lines.push(` preloadedSkills: [`);
165
+ for (const ref of access.preloadedSkills)
166
+ lines.push(` ${printSkillRefToken(ref, appRefName, crossOrg)}`);
167
+ lines.push(` ],`);
168
+ }
169
+ lines.push(`},`);
170
+ return lines;
171
+ }
172
+ /** `AgentToolRunAs` is opaque — `agentFromTf` only ever produces `{ currentUser: true }` today. */
173
+ function printRunAs(runAs) {
174
+ if (runAs["currentUser"] !== undefined)
175
+ return `{ currentUser: ${String(runAs["currentUser"])} }`;
176
+ if (runAs["publisher"] !== undefined)
177
+ return `{ publisher: ${String(runAs["publisher"])} }`;
178
+ const serviceAccount = runAs["serviceAccount"];
179
+ if (serviceAccount?.serviceAccount !== undefined) {
180
+ return `{ serviceAccount: { serviceAccount: ${quote(String(serviceAccount.serviceAccount))} } }`;
181
+ }
182
+ return JSON.stringify(runAs);
183
+ }
184
+ function printAgentAuthentication(auth) {
185
+ const { jwt } = auth;
186
+ const lines = [
187
+ `agentAuthentication: {`,
188
+ ` jwt: {`,
189
+ ` enabled: ${String(jwt.enabled)},`,
190
+ ` headerName: ${quote(jwt.headerName)},`,
191
+ ` emailAddressClaimName: ${quote(jwt.emailAddressClaimName)},`,
192
+ ];
193
+ const keySource = "jwks" in jwt.keySource
194
+ ? `{ jwks: { jwksUrl: ${quote(jwt.keySource.jwks.jwksUrl)} } }`
195
+ : `{ plainText: { plainTextKeyValuePem: ${quote(jwt.keySource.plainText.plainTextKeyValuePem)} } }`;
196
+ lines.push(` keySource: ${keySource},`);
197
+ if (jwt.requiredClaims !== undefined && jwt.requiredClaims.length > 0) {
198
+ lines.push(` requiredClaims: [`);
199
+ for (const claim of jwt.requiredClaims) {
200
+ lines.push(` { claimName: ${quote(claim.claimName)}, acceptableValues: [${claim.acceptableValues.map(quote).join(", ")}] },`);
201
+ }
202
+ lines.push(` ],`);
203
+ }
204
+ lines.push(` },`);
205
+ lines.push(`},`);
206
+ return lines;
207
+ }
208
+ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElementRefNames) {
209
+ const factory = TOOL_FACTORY_BY_TYPE_KEY[tool.typeKey] ?? "agentSearchAspect";
210
+ const lines = [`${factory}({`];
211
+ lines.push(` name: ${quote(tool.name)},`);
212
+ lines.push(` description: ${quote(tool.description)},`);
213
+ if (tool.startMessage !== undefined)
214
+ lines.push(` startMessage: ${quote(tool.startMessage)},`);
215
+ if (tool.typeKey === "executeWorkflow") {
216
+ // Record form (agentRunAutomation v3): keys are the automation's declared
217
+ // parameter/property names; the agent-facing `name:` prints only when it
218
+ // differs from the key — the fixed point for tools authored without a
219
+ // rename. Spec key order: name?, description, required?.
220
+ const auto = `catalog.${appRefName}.automations${safeMember(tool.automationKey ?? "")}`;
221
+ lines.push(` automation: ${auto},`);
222
+ if (tool.inputs !== undefined && tool.inputs.length > 0) {
223
+ lines.push(" inputs: {");
224
+ for (const i of tool.inputs) {
225
+ const parts = [];
226
+ if (i.name !== undefined && i.name !== i.parameterName)
227
+ parts.push(`name: ${quote(i.name)}`);
228
+ parts.push(`description: ${quote(i.description ?? "")}`);
229
+ if (i.required !== undefined)
230
+ parts.push(`required: ${i.required}`);
231
+ lines.push(` ${safeKey(i.parameterName)}: { ${parts.join(", ")} },`);
232
+ }
233
+ lines.push(" },");
234
+ }
235
+ if (tool.outputs !== undefined && tool.outputs.length > 0) {
236
+ lines.push(" outputs: {");
237
+ for (const o of tool.outputs) {
238
+ const spec = o.name !== undefined && o.name !== o.workflowPropertyName ? `{ name: ${quote(o.name)} }` : "{}";
239
+ lines.push(` ${safeKey(o.workflowPropertyName)}: ${spec},`);
240
+ }
241
+ lines.push(" },");
242
+ }
243
+ lines.push("}),");
244
+ return lines;
245
+ }
246
+ if (tool.target?.kind === "self") {
247
+ lines.push(` aspect: catalog.${appRefName},`);
248
+ }
249
+ else if (tool.target !== undefined && tool.target.kind === "foreignApp") {
250
+ const foreignRefName = foreignAppRefNames?.get(tool.target.name);
251
+ if (foreignRefName !== undefined) {
252
+ // The dependency is already pulled into this workspace (board issue
253
+ // #40) — a typed token, not a stub, so tsc catches drift if the
254
+ // foreign app's fields change out from under this tool.
255
+ lines.push(` aspect: catalog.${foreignRefName},`);
256
+ }
257
+ else {
258
+ // The foreign app's catalog may not exist in this workspace — a literal
259
+ // token compiles and deploys; swap for a catalog token when available
260
+ // (\`edk pull app\` reports missing dependencies like this one).
261
+ const todo = crossOrg
262
+ ? ` // TODO: cross-org clone — "${tool.target.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
263
+ : "";
264
+ lines.push(` aspect: { __kind: "app", refName: ${quote(tool.target.name)}, name: ${quote(tool.target.name)} },${todo}`);
265
+ }
266
+ }
267
+ else if (tool.target !== undefined && tool.target.kind === "foreignElement") {
268
+ // Board issue #42: an aspect target can be an element, not just an app —
269
+ // same treatment as foreignApp, distinct stub `__kind`.
270
+ const foreignRefName = foreignElementRefNames?.get(tool.target.name);
271
+ if (foreignRefName !== undefined) {
272
+ lines.push(` aspect: catalog.${foreignRefName},`);
273
+ }
274
+ else {
275
+ const todo = crossOrg
276
+ ? ` // TODO: cross-org clone — "${tool.target.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
277
+ : "";
278
+ lines.push(` aspect: { __kind: "element", refName: ${quote(tool.target.name)}, name: ${quote(tool.target.name)} },${todo}`);
279
+ }
280
+ }
281
+ if (tool.typeKey === "searchAspect" || tool.typeKey === "searchTable") {
282
+ lines.push(` queryDescription: ${quote(tool.queryDescription ?? "")},`);
283
+ if (tool.limit !== undefined)
284
+ lines.push(` limit: ${tool.limit},`);
285
+ }
286
+ if (tool.typeKey === "updateRecord" && tool.handleDescription !== undefined) {
287
+ lines.push(` handleDescription: ${quote(tool.handleDescription)},`);
288
+ }
289
+ if (tool.typeKey === "searchTable" && tool.searchTableId !== undefined) {
290
+ // Always a raw platform id — see NormalizedAgentTool.searchTableId's
291
+ // comment; ei never exports a resolvable reference for this attribute.
292
+ lines.push(` table: ${quote(tool.searchTableId)}, // TODO: raw search table id - ei's export never resolves this to a reference`);
293
+ }
294
+ if (tool.fields !== undefined && tool.fields.length > 0) {
295
+ lines.push(" fields: [");
296
+ for (const f of tool.fields) {
297
+ // A foreign/out-of-scope aspect's field has no field resource ei can
298
+ // reference — it falls back to a bare platform id (board issue #169);
299
+ // print the raw-id shape (AgentSearchRawIdField/AgentRecordRawIdField)
300
+ // instead of a catalog token.
301
+ const isRaw = f.key === undefined;
302
+ const parts = isRaw ? [`fieldId: ${quote(f.rawFieldId ?? "")}`] : [`field: catalog.${appRefName}.fields.${f.key}`];
303
+ if (f.name !== undefined)
304
+ parts.push(`name: ${quote(f.name)}`);
305
+ // Always emit description (backfill "") so pulled source satisfies
306
+ // AgentSearchField / AgentRecordField's required description.
307
+ parts.push(`description: ${quote(f.description ?? "")}`);
308
+ if (f.required !== undefined)
309
+ parts.push(`required: ${f.required}`);
310
+ const todo = isRaw ? " // TODO: raw platform field id - the field belongs to a foreign/out-of-scope aspect ei can't resolve to a reference" : "";
311
+ lines.push(` { ${parts.join(", ")} },${todo}`);
312
+ }
313
+ lines.push(" ],");
314
+ }
315
+ // searchTable's own field shapes: field_id is always a raw platform id
316
+ // (see NormalizedSearchTableField's comment), so these print as `fieldId:`
317
+ // literals rather than `field: catalog....` tokens.
318
+ if (tool.searchTableFields !== undefined && tool.searchTableFields.length > 0) {
319
+ lines.push(" fields: [");
320
+ for (const f of tool.searchTableFields) {
321
+ const parts = [`fieldId: ${quote(f.fieldId)}`];
322
+ if (f.name !== undefined)
323
+ parts.push(`name: ${quote(f.name)}`);
324
+ if (f.description !== undefined)
325
+ parts.push(`description: ${quote(f.description)}`);
326
+ lines.push(` { ${parts.join(", ")} }, // TODO: raw search table field id - ei's export never resolves this to a reference`);
327
+ }
328
+ lines.push(" ],");
329
+ }
330
+ if (tool.returnFields !== undefined && tool.returnFields.length > 0) {
331
+ lines.push(" returnFields: [");
332
+ for (const f of tool.returnFields) {
333
+ const parts = [`fieldId: ${quote(f.fieldId)}`];
334
+ if (f.name !== undefined)
335
+ parts.push(`name: ${quote(f.name)}`);
336
+ if (f.displayName !== undefined)
337
+ parts.push(`displayName: ${quote(f.displayName)}`);
338
+ lines.push(` { ${parts.join(", ")} }, // TODO: raw search table field id - ei's export never resolves this to a reference`);
339
+ }
340
+ lines.push(" ],");
341
+ }
342
+ lines.push("}),");
343
+ return lines;
344
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Agent extraction (M3, plan §4.3): `agentFromTf` turns an
3
+ * `elementum_agent` block + its tool blocks (delegated to
4
+ * `entities/agent-tool/from-tf.ts`) into the normalized shape
5
+ * `printAgentV2` consumes. Platform ids come only from the stream's import
6
+ * blocks and stay data-side — they never reach printed source.
7
+ */
8
+ import { type FromTfContext } from "../../engine/pull/context.js";
9
+ import { type TfBlock } from "../../engine/tf/index.js";
10
+ import { type NormalizedAgentTool } from "../agent-tool/from-tf.js";
11
+ import type { AgentAuthentication } from "./build.js";
12
+ import type { AgentToolRunAs } from "./tools.js";
13
+ /**
14
+ * A resolved skill reference: this app's own skill (by catalog key), a
15
+ * foreign app's (by name only), or a raw platform id the export carries with
16
+ * no way to resolve it further at all — confirmed live: a `skill_ids` entry
17
+ * can be a bare UUID literal with neither a resource ref into this stream
18
+ * nor a `data.elementum_agentic_skill` block backing it anywhere in the export.
19
+ */
20
+ export type NormalizedSkillRef = {
21
+ readonly kind: "self";
22
+ readonly key: string;
23
+ } | {
24
+ readonly kind: "foreign";
25
+ readonly name: string;
26
+ } | {
27
+ readonly kind: "unresolved";
28
+ readonly id: string;
29
+ };
30
+ export type NormalizedSkillAccess = {
31
+ readonly mode: "NONE" | "ALL" | "ALL_APP";
32
+ readonly preloadedSkills?: readonly NormalizedSkillRef[];
33
+ } | {
34
+ readonly mode: "CUSTOM";
35
+ readonly skills: readonly NormalizedSkillRef[];
36
+ readonly preloadedSkills?: readonly NormalizedSkillRef[];
37
+ };
38
+ export interface NormalizedAgent {
39
+ /** Authoring key = the bijective image of the exported label. */
40
+ readonly refName: string;
41
+ readonly name: string;
42
+ readonly description: string;
43
+ readonly instructions: string;
44
+ readonly firstMessage?: string;
45
+ readonly maxLength?: number;
46
+ /** org.ts `aiProviders.<provider>.models.<model>` compound key ("<provider>.<model>"), when pinned. */
47
+ readonly connectorKey?: string;
48
+ readonly skillAccess?: NormalizedSkillAccess;
49
+ readonly runAs?: AgentToolRunAs;
50
+ readonly agentAuthentication?: AgentAuthentication;
51
+ readonly conversationIdleTimeout?: string;
52
+ readonly a2aStreaming?: boolean;
53
+ readonly tools: readonly NormalizedAgentTool[];
54
+ }
55
+ export interface AgentFromTfResult {
56
+ readonly agent?: NormalizedAgent;
57
+ /** Set when the agent can't be authored on the terraform path (variant types) — reported, not fatal. */
58
+ readonly skippedReason?: string;
59
+ }
60
+ /**
61
+ * The `elementum_agent` block + its tool blocks → the normalized agent.
62
+ * Tool blocks belonging to OTHER agents are skipped with a diagnostic (the
63
+ * caller partitions per-agent by agent_id, but stays defensive).
64
+ */
65
+ export declare function agentFromTf(agentBlock: TfBlock, toolBlocks: readonly TfBlock[], appLabel: string, _appRefName: string, ctx: FromTfContext): AgentFromTfResult;