@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,71 @@
1
+ /**
2
+ * v2 skill tool factories — emit the platform's `AgenticSkillToolCreateInput`
3
+ * wire shape with `CatalogRef` tokens at every id position (automation, aspect,
4
+ * field, search table, target agent). Tokens resolve to ids at deploy via
5
+ * `resolvePayload`; nothing here reads an `.id`.
6
+ *
7
+ * Parallel to v1 `src/agents/skills/tools/*` + `serializer`, fully standalone.
8
+ * Each tool carries a `status` (`"ACTIVE"`/`"INACTIVE"`, default `"ACTIVE"`).
9
+ * Search/record fields require `name` + `description` (matching the v1 skill
10
+ * serializer, which always emits them).
11
+ */
12
+ import type { AgentRef, AspectRef, AutomationRef, FieldRef, SearchTableRef } from "../../catalog/index.js";
13
+ /** A handle-form skill tool: an `AgenticSkillToolCreateInput` with ref tokens. */
14
+ export type SkillTool = Record<string, unknown>;
15
+ export type SkillToolStatus = "ACTIVE" | "INACTIVE";
16
+ export interface SkillSearchField {
17
+ readonly field: FieldRef;
18
+ readonly name: string;
19
+ readonly description: string;
20
+ }
21
+ export interface SkillRecordField {
22
+ readonly field: FieldRef;
23
+ readonly name: string;
24
+ readonly description: string;
25
+ readonly required: boolean;
26
+ readonly defaultValue?: string;
27
+ }
28
+ interface CommonToolOptions {
29
+ readonly name: string;
30
+ readonly description: string;
31
+ readonly status?: SkillToolStatus;
32
+ readonly startMessage?: string;
33
+ }
34
+ export interface AutomationToolV2 extends CommonToolOptions {
35
+ readonly automation: AutomationRef;
36
+ }
37
+ export declare function skillAutomation(opts: AutomationToolV2): SkillTool;
38
+ export interface SkillSearchAspectToolV2 extends CommonToolOptions {
39
+ readonly aspect: AspectRef;
40
+ readonly queryDescription: string;
41
+ readonly fields: readonly SkillSearchField[];
42
+ /** Maximum number of records the search returns. */
43
+ readonly limit?: number;
44
+ }
45
+ export declare function skillSearchAspect(opts: SkillSearchAspectToolV2): SkillTool;
46
+ export interface SkillSearchTableToolV2 extends CommonToolOptions {
47
+ readonly aspect: AspectRef;
48
+ readonly table: SearchTableRef;
49
+ readonly queryDescription: string;
50
+ readonly fields: readonly SkillSearchField[];
51
+ /** Maximum number of records the search returns. */
52
+ readonly limit?: number;
53
+ }
54
+ export declare function skillSearchTable(opts: SkillSearchTableToolV2): SkillTool;
55
+ export interface SkillCreateRecordToolV2 extends CommonToolOptions {
56
+ readonly aspect: AspectRef;
57
+ readonly fields: readonly SkillRecordField[];
58
+ }
59
+ export declare function skillCreateRecord(opts: SkillCreateRecordToolV2): SkillTool;
60
+ export interface SkillUpdateRecordToolV2 extends CommonToolOptions {
61
+ readonly aspect: AspectRef;
62
+ readonly fields: readonly SkillRecordField[];
63
+ readonly handleDescription: string;
64
+ }
65
+ export declare function skillUpdateRecord(opts: SkillUpdateRecordToolV2): SkillTool;
66
+ export interface SkillRunAgentToolV2 extends CommonToolOptions {
67
+ readonly agent: AgentRef;
68
+ readonly workerTaskPrompt: string;
69
+ }
70
+ export declare function skillRunAgent(opts: SkillRunAgentToolV2): SkillTool;
71
+ export {};
@@ -0,0 +1,88 @@
1
+ import { isValidToolName } from "../agent-tool/types.js";
2
+ function common(opts) {
3
+ // Authoring-layer name check (mirrors entities/agent/tools.ts's common()) —
4
+ // every tool factory routes through here, so this is the single
5
+ // enforcement point; the tf passes never re-check.
6
+ if (!isValidToolName(opts.name)) {
7
+ throw new Error(`skill tool name "${opts.name}" must be 1–64 characters of letters, digits, and ` +
8
+ `underscores (A–Z, a–z, 0–9, _) with no consecutive underscores — no hyphens or spaces.`);
9
+ }
10
+ return {
11
+ name: opts.name,
12
+ description: opts.description,
13
+ status: opts.status ?? "ACTIVE",
14
+ ...(opts.startMessage !== undefined ? { startMessage: opts.startMessage } : {}),
15
+ };
16
+ }
17
+ function searchFieldToken(f) {
18
+ return {
19
+ fieldId: f.field,
20
+ clientHandle: f.field,
21
+ name: f.name,
22
+ description: f.description,
23
+ };
24
+ }
25
+ function recordFieldToken(f) {
26
+ return {
27
+ fieldId: f.field,
28
+ clientHandle: f.field,
29
+ name: f.name,
30
+ description: f.description,
31
+ required: f.required,
32
+ ...(f.defaultValue !== undefined ? { defaultValue: f.defaultValue } : {}),
33
+ };
34
+ }
35
+ export function skillAutomation(opts) {
36
+ return { automation: { ...common(opts), automationId: opts.automation } };
37
+ }
38
+ export function skillSearchAspect(opts) {
39
+ return {
40
+ searchAspect: {
41
+ ...common(opts),
42
+ aspectId: opts.aspect,
43
+ queryDescription: opts.queryDescription,
44
+ fields: opts.fields.map(searchFieldToken),
45
+ ...(opts.limit !== undefined ? { limit: opts.limit } : {}),
46
+ },
47
+ };
48
+ }
49
+ export function skillSearchTable(opts) {
50
+ return {
51
+ searchTable: {
52
+ ...common(opts),
53
+ aspectId: opts.aspect,
54
+ searchTableId: opts.table,
55
+ queryDescription: opts.queryDescription,
56
+ fields: opts.fields.map(searchFieldToken),
57
+ ...(opts.limit !== undefined ? { limit: opts.limit } : {}),
58
+ },
59
+ };
60
+ }
61
+ export function skillCreateRecord(opts) {
62
+ return {
63
+ createRecord: {
64
+ ...common(opts),
65
+ aspectId: opts.aspect,
66
+ fields: opts.fields.map(recordFieldToken),
67
+ },
68
+ };
69
+ }
70
+ export function skillUpdateRecord(opts) {
71
+ return {
72
+ updateRecord: {
73
+ ...common(opts),
74
+ aspectId: opts.aspect,
75
+ fields: opts.fields.map(recordFieldToken),
76
+ handleDescription: opts.handleDescription,
77
+ },
78
+ };
79
+ }
80
+ export function skillRunAgent(opts) {
81
+ return {
82
+ runAgent: {
83
+ ...common(opts),
84
+ targetAgentId: opts.agent,
85
+ workerTaskPrompt: opts.workerTaskPrompt,
86
+ },
87
+ };
88
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Skill-tool extraction: one `elementum_agentic_skill_*_tool` block → the
3
+ * normalized shape the skill printer consumes. The owning skill's from-tf
4
+ * drives the pass and says who the owner is — this module never names the
5
+ * skill or app resource types. Mirrors `entities/agent-tool/from-tf.ts`.
6
+ */
7
+ import { type FromTfContext } from "../../engine/pull/context.js";
8
+ import { type TfBlock } from "../../engine/tf/index.js";
9
+ export interface NormalizedSkillToolField {
10
+ /** The field's bag key in the owning app's `fields: {}` (bijective image of its label). */
11
+ readonly key: string;
12
+ readonly name?: string;
13
+ readonly description?: string;
14
+ readonly required?: boolean;
15
+ }
16
+ export type NormalizedSkillToolTarget = {
17
+ readonly kind: "self";
18
+ } | {
19
+ /** A foreign app via `data.elementum_app.<label>` — `name` from the stream's data block. */
20
+ readonly kind: "foreignApp";
21
+ readonly name: string;
22
+ };
23
+ export interface NormalizedSkillTool {
24
+ readonly typeKey: "createRecord" | "searchAspect";
25
+ readonly name: string;
26
+ readonly description: string;
27
+ /** Present only when it differs from the default ("ACTIVE"). */
28
+ readonly status?: "INACTIVE";
29
+ readonly startMessage?: string;
30
+ readonly target: NormalizedSkillToolTarget;
31
+ readonly fields?: readonly NormalizedSkillToolField[];
32
+ readonly queryDescription?: string;
33
+ readonly limit?: number;
34
+ }
35
+ export interface SkillToolOwner {
36
+ /** The owning app's resource type + tfLabel. */
37
+ readonly appType: string;
38
+ readonly appLabel: string;
39
+ /** The owning skill's resource type + tfLabel. */
40
+ readonly skillType: string;
41
+ readonly skillLabel: string;
42
+ }
43
+ /**
44
+ * One tool block → its normalized shape; undefined = skipped with a
45
+ * diagnostic (unimplemented sub-type, wrong owner, unresolvable target).
46
+ */
47
+ export declare function skillToolFromTf(block: TfBlock, owner: SkillToolOwner, ctx: FromTfContext): NormalizedSkillTool | undefined;
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Skill-tool extraction: one `elementum_agentic_skill_*_tool` block → the
3
+ * normalized shape the skill printer consumes. The owning skill's from-tf
4
+ * drives the pass and says who the owner is — this module never names the
5
+ * skill or app resource types. Mirrors `entities/agent-tool/from-tf.ts`.
6
+ */
7
+ import { EntityTfError } from "../../engine/entity.js";
8
+ import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
9
+ import { isTfExpr, tfLabelToTsLabel } from "../../engine/tf/index.js";
10
+ import { SUB_TYPE_BY_RESOURCE as FIELD_SUB_TYPE_BY_RESOURCE } from "../field/types.js";
11
+ import { KNOWN_SKILL_TOOL_ATTRS, SKILL_TOOL_SUB_TYPE_BY_RESOURCE, UNAUTHORABLE_SKILL_TOOL_ATTRS, } from "./types.js";
12
+ /**
13
+ * One tool block → its normalized shape; undefined = skipped with a
14
+ * diagnostic (unimplemented sub-type, wrong owner, unresolvable target).
15
+ */
16
+ export function skillToolFromTf(block, owner, ctx) {
17
+ const subType = SKILL_TOOL_SUB_TYPE_BY_RESOURCE.get(block.type ?? "");
18
+ if (subType === undefined) {
19
+ ctx.diagnostics.push(`resource "${block.type}" is not a known skill tool resource; skipped`);
20
+ return undefined;
21
+ }
22
+ const label = block.label;
23
+ if (label === undefined || label === "") {
24
+ throw new EntityTfError(`${block.type} block is missing its label`);
25
+ }
26
+ const attrs = block.attrs;
27
+ const name = optionalString(attrs, "name", `tool "${label}"`, ctx) ?? "";
28
+ const where = `skill tool "${name}" (${block.type}.${label})`;
29
+ if (subType.implemented !== true) {
30
+ ctx.diagnostics.push(`${where}: tool kind is not supported on the terraform path yet; skipped`);
31
+ return undefined;
32
+ }
33
+ const known = KNOWN_SKILL_TOOL_ATTRS[subType.typeKey];
34
+ for (const key of Object.keys(attrs)) {
35
+ if (UNAUTHORABLE_SKILL_TOOL_ATTRS.has(key)) {
36
+ ctx.diagnostics.push(`${where}: ${key} has no authoring slot on the terraform path yet; a rebuilt stream will omit it`);
37
+ }
38
+ else if (!known.has(key)) {
39
+ ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend skillToolFromTf deliberately`);
40
+ }
41
+ }
42
+ if (resourceRefLabel(attrs["skill_id"], owner.skillType) !== owner.skillLabel) {
43
+ ctx.diagnostics.push(`${where}: skill_id does not reference ${owner.skillType}.${owner.skillLabel}; skipped`);
44
+ return undefined;
45
+ }
46
+ // Target: the owning app's resource ref = self; a data.elementum_app ref =
47
+ // a foreign app, resolved to its display name via the stream's data block.
48
+ const targetAttr = attrs["target_id"];
49
+ let target;
50
+ const selfLabel = resourceRefLabel(targetAttr, owner.appType);
51
+ if (selfLabel === owner.appLabel) {
52
+ target = { kind: "self" };
53
+ }
54
+ else if (isTfExpr(targetAttr) && targetAttr.$expr === "data-attr" && targetAttr.type === "elementum_app") {
55
+ const appName = ctx.dataName("elementum_app", targetAttr.label);
56
+ if (appName === undefined) {
57
+ ctx.diagnostics.push(`${where}: target_id references data.elementum_app.${targetAttr.label} but the stream has no such data block; skipped`);
58
+ return undefined;
59
+ }
60
+ target = { kind: "foreignApp", name: appName };
61
+ }
62
+ else {
63
+ ctx.diagnostics.push(`${where}: target_id has an unrecognized shape (${JSON.stringify(targetAttr)}); skipped`);
64
+ return undefined;
65
+ }
66
+ let fields;
67
+ const rawFields = attrs["fields"];
68
+ if (Array.isArray(rawFields)) {
69
+ fields = [];
70
+ for (const item of rawFields) {
71
+ if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item)) {
72
+ ctx.diagnostics.push(`${where}: fields item has an unrecognized shape; dropped`);
73
+ continue;
74
+ }
75
+ const rec = item;
76
+ const fieldRef = rec["field_id"];
77
+ const fieldLabel = isTfExpr(fieldRef) && fieldRef.$expr === "resource-attr" && FIELD_SUB_TYPE_BY_RESOURCE.has(fieldRef.type)
78
+ ? fieldRef.label
79
+ : undefined;
80
+ if (fieldLabel === undefined) {
81
+ ctx.diagnostics.push(`${where}: fields item's field_id is not a field resource reference; dropped`);
82
+ continue;
83
+ }
84
+ fields.push({
85
+ key: tfLabelToTsLabel(fieldLabel),
86
+ ...(typeof rec["name"] === "string" && { name: rec["name"] }),
87
+ ...(typeof rec["description"] === "string" && { description: rec["description"] }),
88
+ // The provider's own schema docs "required" on search-tool fields as
89
+ // "not used by search tools" — always echoed back (usually `false`)
90
+ // but never meaningful, so it's excluded from that shape entirely.
91
+ ...(subType.typeKey === "createRecord" && typeof rec["required"] === "boolean" && { required: rec["required"] }),
92
+ });
93
+ }
94
+ if (fields.length === 0)
95
+ fields = undefined;
96
+ }
97
+ else if (rawFields !== undefined) {
98
+ ctx.diagnostics.push(`${where}: fields is not a list; dropped`);
99
+ }
100
+ if (subType.typeKey === "searchAspect" && attrs["filter"] !== undefined) {
101
+ ctx.diagnostics.push(`${where}: filter is not supported on the terraform path yet; a rebuilt stream will omit it`);
102
+ }
103
+ if (subType.typeKey === "searchAspect" && attrs["filter_variables"] !== undefined) {
104
+ ctx.diagnostics.push(`${where}: filter_variables are not supported on the terraform path yet; a rebuilt stream will omit them`);
105
+ }
106
+ const startMessage = optionalString(attrs, "start_message", where, ctx);
107
+ const status = optionalString(attrs, "status", where, ctx);
108
+ return {
109
+ typeKey: subType.typeKey,
110
+ name,
111
+ description: optionalString(attrs, "description", where, ctx) ?? "",
112
+ ...(status === "INACTIVE" && { status }),
113
+ ...(startMessage !== undefined && { startMessage }),
114
+ target,
115
+ ...(fields !== undefined && { fields }),
116
+ ...(subType.typeKey === "searchAspect" && {
117
+ queryDescription: optionalString(attrs, "query_description", where, ctx) ?? "",
118
+ }),
119
+ ...(typeof attrs["result_limit"] === "number" && { limit: attrs["result_limit"] }),
120
+ };
121
+ }
@@ -0,0 +1,3 @@
1
+ /** The skill-tool entity's registry entry (see src/graph/). */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ export declare const skillToolModule: EntityKindModule;
@@ -0,0 +1,21 @@
1
+ /** The skill-tool entity's registry entry (see src/graph/). */
2
+ import { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE } from "../../graph/types.js";
3
+ import { SKILL_TOOL_SUB_TYPES } from "./types.js";
4
+ export const skillToolModule = {
5
+ kind: "skill-tool",
6
+ stream: { role: "streamMember" },
7
+ authoring: { unit: "inline", bag: "tools" },
8
+ parents: [{ parent: "skill", child: "skill-tool" }],
9
+ resource: {
10
+ shape: "subTypes",
11
+ rows: SKILL_TOOL_SUB_TYPES.map((t) => ({
12
+ key: t.typeKey,
13
+ resourceType: t.resourceType,
14
+ implemented: t.implemented === true,
15
+ })),
16
+ },
17
+ data: NO_DATA,
18
+ lifecycle: NO_LIFECYCLE,
19
+ canvas: NO_CANVAS,
20
+ catalog: NO_CATALOG,
21
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Skill-tool emission: one authored tool → one
3
+ * `elementum_agentic_skill_*_tool` resource block, in the platform's
4
+ * dialect (confirmed live against the deployed provider schema). The owning
5
+ * SKILL's to-tf drives the pass and supplies the back-reference
6
+ * (`skill_id`) — this module never names the skill or app resource types.
7
+ * Mirrors `entities/agent-tool/to-tf.ts`.
8
+ */
9
+ import { type TfBlock } from "../../engine/tf/index.js";
10
+ export interface SkillToolToTfContext {
11
+ /** The owning app's refName + tfLabel (namespace) — self-target detection + app_id. */
12
+ readonly appRefName: string;
13
+ readonly appTfLabel: string;
14
+ /** The owning skill's tfLabel. */
15
+ readonly skillTfLabel: string;
16
+ /** Records a foreign-app data lookup for data.tf; returns its tfLabel. */
17
+ foreignAppRef(tfLabel: string, name: string): void;
18
+ /** Degradations land here — reported by the caller, never silent. */
19
+ readonly diagnostics: string[];
20
+ }
21
+ export interface SkillToolToTfResult {
22
+ readonly block: TfBlock;
23
+ /** `<resourceType>.<tfLabel>` — bookkeeping for the skill catalog. */
24
+ readonly address: string;
25
+ }
26
+ /**
27
+ * One authored tool entry (`{ createRecord: {...} }`) → its resource block;
28
+ * undefined = degraded with a diagnostic (unimplemented sub-type, missing
29
+ * target). Tool-name validity is enforced in the authoring builders
30
+ * (entities/skill/tools.ts), not here.
31
+ */
32
+ export declare function skillToolToTf(entry: Record<string, unknown>, ctx: SkillToolToTfContext): SkillToolToTfResult | undefined;
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Skill-tool emission: one authored tool → one
3
+ * `elementum_agentic_skill_*_tool` resource block, in the platform's
4
+ * dialect (confirmed live against the deployed provider schema). The owning
5
+ * SKILL's to-tf drives the pass and supplies the back-reference
6
+ * (`skill_id`) — this module never names the skill or app resource types.
7
+ * Mirrors `entities/agent-tool/to-tf.ts`.
8
+ */
9
+ import { expr, sanitizeName } from "../../engine/tf/index.js";
10
+ import { fieldRefToTfValue } from "../field/to-tf.js";
11
+ import { SKILL_TOOL_SUB_TYPE_BY_TYPE_KEY } from "./types.js";
12
+ /** authoring FieldRef token → the field resource address, via the shared field-ref helper. */
13
+ function fieldRefValue(token, where, ctx) {
14
+ const refName = token.refName ?? "";
15
+ const authoringType = token.fieldType ?? "";
16
+ const ref = refName === "" ? undefined : fieldRefToTfValue(authoringType, refName);
17
+ if (ref === undefined) {
18
+ ctx.diagnostics.push(`${where}: field token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(authoringType)}); dropped`);
19
+ return undefined;
20
+ }
21
+ if (token.parent !== undefined && token.parent !== ctx.appRefName) {
22
+ ctx.diagnostics.push(`${where}: field token "${refName}" belongs to app "${token.parent}", not this workspace's config — cross-app field refs are not supported on the terraform path yet; dropped`);
23
+ return undefined;
24
+ }
25
+ return ref;
26
+ }
27
+ /** authoring AspectRef token → target_id value (self resource ref or foreign data ref). */
28
+ function targetIdValue(token, ctx) {
29
+ if ((token.refName ?? "") === ctx.appRefName) {
30
+ return expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]);
31
+ }
32
+ // ei derives foreign-app data labels from the display NAME.
33
+ const name = token.name ?? token.refName ?? "";
34
+ const tfLabel = sanitizeName(name);
35
+ ctx.foreignAppRef(tfLabel, name);
36
+ return expr.dataAttr("elementum_app", tfLabel, ["id"]);
37
+ }
38
+ /**
39
+ * One authored tool entry (`{ createRecord: {...} }`) → its resource block;
40
+ * undefined = degraded with a diagnostic (unimplemented sub-type, missing
41
+ * target). Tool-name validity is enforced in the authoring builders
42
+ * (entities/skill/tools.ts), not here.
43
+ */
44
+ export function skillToolToTf(entry, ctx) {
45
+ const typeKey = Object.keys(entry)[0];
46
+ if (typeKey === undefined)
47
+ return undefined;
48
+ const subType = SKILL_TOOL_SUB_TYPE_BY_TYPE_KEY.get(typeKey);
49
+ const inner = entry[typeKey];
50
+ const name = inner?.name ?? "";
51
+ if (subType === undefined) {
52
+ ctx.diagnostics.push(`skill tool "${name}": unknown tool kind "${typeKey}"; dropped`);
53
+ return undefined;
54
+ }
55
+ if (subType.implemented !== true) {
56
+ ctx.diagnostics.push(`skill tool "${name}": tool kind "${typeKey}" is not supported on the terraform path yet; dropped`);
57
+ return undefined;
58
+ }
59
+ if (inner === undefined || typeof inner !== "object") {
60
+ ctx.diagnostics.push(`skill tool entry "${typeKey}" has a non-object body; dropped`);
61
+ return undefined;
62
+ }
63
+ const where = `skill tool "${name}"`;
64
+ // Unlike agent tools (labeled `<agent>_<tool>`), the platform labels skill
65
+ // tools by name alone, unprefixed — confirmed live against `ei apps export`.
66
+ const tfLabel = sanitizeName(name);
67
+ const attrs = {
68
+ skill_id: expr.resourceAttr("elementum_agentic_skill", ctx.skillTfLabel, ["id"]),
69
+ app_id: expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]),
70
+ name,
71
+ description: inner.description ?? "",
72
+ status: inner.status ?? "ACTIVE",
73
+ };
74
+ if (inner.startMessage !== undefined)
75
+ attrs["start_message"] = inner.startMessage;
76
+ if (inner.aspectId === undefined) {
77
+ ctx.diagnostics.push(`${where}: no target aspect token; dropped`);
78
+ return undefined;
79
+ }
80
+ attrs["target_id"] = targetIdValue(inner.aspectId, ctx);
81
+ if (typeKey === "searchAspect") {
82
+ attrs["query_description"] = inner.queryDescription ?? "";
83
+ if (inner.limit !== undefined)
84
+ attrs["result_limit"] = inner.limit;
85
+ }
86
+ if (inner.fields !== undefined && inner.fields.length > 0) {
87
+ const fieldValues = [];
88
+ for (const f of inner.fields) {
89
+ const ref = f.fieldId === undefined ? undefined : fieldRefValue(f.fieldId, where, ctx);
90
+ if (ref === undefined)
91
+ continue;
92
+ fieldValues.push({
93
+ field_id: ref,
94
+ name: f.name ?? "",
95
+ description: f.description ?? "",
96
+ ...(f.required !== undefined && { required: f.required }),
97
+ });
98
+ if (f.defaultValue !== undefined) {
99
+ ctx.diagnostics.push(`${where}: field default values are not supported on the terraform path yet; dropped`);
100
+ }
101
+ }
102
+ if (fieldValues.length > 0)
103
+ attrs["fields"] = fieldValues;
104
+ }
105
+ const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
106
+ return { block, address: `${subType.resourceType}.${tfLabel}` };
107
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The skill-tool entity's sub-type table. Skill tools are a real sub-entity —
3
+ * six terraform resource types sharing one ownership shape (skill_id +
4
+ * name/description/status) — so per-sub-type knowledge is one ROW here,
5
+ * exactly like `entities/agent-tool/types.ts` (which this mirrors).
6
+ *
7
+ * This tranche implements createRecord + searchAspect end to end; the other
8
+ * rows are declared so streams REPORT them by name instead of "unknown
9
+ * resource", and adoption scopes ONLY the implemented ones — an adopted type
10
+ * the printer can't reconstruct would plan as a destroy on rebuild.
11
+ *
12
+ * Note the wire key for the automation tool is `automation`, not agent-tool's
13
+ * `executeWorkflow` — confirmed against the live provider schema
14
+ * (`entities/skill/tools.ts`'s `skillAutomation` factory).
15
+ */
16
+ /** One skill-tool sub-type: authoring variant key ↔ resource type. */
17
+ export interface SkillToolSubType {
18
+ /** The `AgenticSkillToolCreateInput` variant key — the tool factory's discriminant ("createRecord"). */
19
+ readonly typeKey: string;
20
+ /** Terraform resource type ("elementum_agentic_skill_create_record_tool"). */
21
+ readonly resourceType: string;
22
+ /** Implemented on the terraform path (to-tf + from-tf + printer). */
23
+ readonly implemented?: true;
24
+ }
25
+ export declare const SKILL_TOOL_SUB_TYPES: readonly SkillToolSubType[];
26
+ export declare const SKILL_TOOL_SUB_TYPE_BY_TYPE_KEY: ReadonlyMap<string, SkillToolSubType>;
27
+ export declare const SKILL_TOOL_SUB_TYPE_BY_RESOURCE: ReadonlyMap<string, SkillToolSubType>;
28
+ /** The resource types the terraform path round-trips today (adoption scope). */
29
+ export declare const IMPLEMENTED_SKILL_TOOL_RESOURCE_TYPES: readonly string[];
30
+ /** Every declared skill-tool resource type — stream partition recognizes these by name. */
31
+ export declare const ALL_SKILL_TOOL_RESOURCE_TYPES: readonly string[];
32
+ /**
33
+ * Attributes `skillToolFromTf` understands per implemented sub-type — growth
34
+ * is reported loudly. `run_as`/`service_account_id`/`status` are real
35
+ * provider attributes (confirmed live) but out of authoring scope this
36
+ * tranche — treated as known-but-unauthored (see `KNOWN_BUT_UNAUTHORED_SKILL_TOOL_ATTRS`).
37
+ */
38
+ export declare const KNOWN_SKILL_TOOL_ATTRS: Readonly<Record<string, ReadonlySet<string>>>;
39
+ /** Known provider attrs with no authoring slot yet — reported by name, tool still pulled. */
40
+ export declare const UNAUTHORABLE_SKILL_TOOL_ATTRS: ReadonlySet<string>;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * The skill-tool entity's sub-type table. Skill tools are a real sub-entity —
3
+ * six terraform resource types sharing one ownership shape (skill_id +
4
+ * name/description/status) — so per-sub-type knowledge is one ROW here,
5
+ * exactly like `entities/agent-tool/types.ts` (which this mirrors).
6
+ *
7
+ * This tranche implements createRecord + searchAspect end to end; the other
8
+ * rows are declared so streams REPORT them by name instead of "unknown
9
+ * resource", and adoption scopes ONLY the implemented ones — an adopted type
10
+ * the printer can't reconstruct would plan as a destroy on rebuild.
11
+ *
12
+ * Note the wire key for the automation tool is `automation`, not agent-tool's
13
+ * `executeWorkflow` — confirmed against the live provider schema
14
+ * (`entities/skill/tools.ts`'s `skillAutomation` factory).
15
+ */
16
+ export const SKILL_TOOL_SUB_TYPES = [
17
+ { typeKey: "createRecord", resourceType: "elementum_agentic_skill_create_record_tool", implemented: true },
18
+ { typeKey: "searchAspect", resourceType: "elementum_agentic_skill_search_records_tool", implemented: true },
19
+ { typeKey: "updateRecord", resourceType: "elementum_agentic_skill_update_record_tool" },
20
+ { typeKey: "searchTable", resourceType: "elementum_agentic_skill_ai_search_tool" },
21
+ { typeKey: "runAgent", resourceType: "elementum_agentic_skill_run_agent_tool" },
22
+ { typeKey: "automation", resourceType: "elementum_agentic_skill_run_automation_tool" },
23
+ ];
24
+ export const SKILL_TOOL_SUB_TYPE_BY_TYPE_KEY = new Map(SKILL_TOOL_SUB_TYPES.map((t) => [t.typeKey, t]));
25
+ export const SKILL_TOOL_SUB_TYPE_BY_RESOURCE = new Map(SKILL_TOOL_SUB_TYPES.map((t) => [t.resourceType, t]));
26
+ /** The resource types the terraform path round-trips today (adoption scope). */
27
+ export const IMPLEMENTED_SKILL_TOOL_RESOURCE_TYPES = SKILL_TOOL_SUB_TYPES.filter((t) => t.implemented === true).map((t) => t.resourceType);
28
+ /** Every declared skill-tool resource type — stream partition recognizes these by name. */
29
+ export const ALL_SKILL_TOOL_RESOURCE_TYPES = SKILL_TOOL_SUB_TYPES.map((t) => t.resourceType);
30
+ /**
31
+ * Attributes `skillToolFromTf` understands per implemented sub-type — growth
32
+ * is reported loudly. `run_as`/`service_account_id`/`status` are real
33
+ * provider attributes (confirmed live) but out of authoring scope this
34
+ * tranche — treated as known-but-unauthored (see `KNOWN_BUT_UNAUTHORED_SKILL_TOOL_ATTRS`).
35
+ */
36
+ export const KNOWN_SKILL_TOOL_ATTRS = {
37
+ createRecord: new Set([
38
+ "skill_id",
39
+ "app_id",
40
+ "name",
41
+ "description",
42
+ "status",
43
+ "start_message",
44
+ "run_as",
45
+ "service_account_id",
46
+ "target_id",
47
+ "fields",
48
+ ]),
49
+ searchAspect: new Set([
50
+ "skill_id",
51
+ "app_id",
52
+ "name",
53
+ "description",
54
+ "status",
55
+ "start_message",
56
+ "run_as",
57
+ "service_account_id",
58
+ "target_id",
59
+ "query_description",
60
+ "result_limit",
61
+ "fields",
62
+ "filter",
63
+ "filter_variables",
64
+ ]),
65
+ };
66
+ /** Known provider attrs with no authoring slot yet — reported by name, tool still pulled. */
67
+ export const UNAUTHORABLE_SKILL_TOOL_ATTRS = new Set(["run_as", "service_account_id"]);