@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,25 @@
1
+ import type { SkillRef } from "../../catalog/index.js";
2
+ import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
3
+ import type { SkillTool } from "./tools.js";
4
+ export interface SkillV2Options extends EntityDeployOptions {
5
+ readonly name: string;
6
+ readonly parent: string;
7
+ readonly description: string;
8
+ readonly instructions: string;
9
+ /** Skill status. Defaults to `DRAFT`. */
10
+ readonly status?: "DRAFT" | "ACTIVE" | "INACTIVE";
11
+ /** Opaque passthrough for the skill's `properties` JSON field. */
12
+ readonly properties?: Record<string, unknown>;
13
+ readonly tools?: readonly SkillTool[];
14
+ }
15
+ /**
16
+ * The configured result of `defineSkill` — its catalog reference (`ref()`) and
17
+ * deployable entity (`def()`). Both take the file refName as a call-time
18
+ * argument, matching agents and automations.
19
+ */
20
+ export interface SkillConfigured {
21
+ ref(refName: string): SkillRef;
22
+ def(refName: string): DeployableEntity;
23
+ }
24
+ /** Build a v2 skill entity config, exposing `.ref(refName)` and `.def(refName)`. */
25
+ export declare function defineSkill(opts: SkillV2Options): SkillConfigured;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * v2 skill authoring (parallel to v1 `src/agents/skills`, fully standalone so v1
3
+ * can be deleted wholesale once v2 is validated).
4
+ *
5
+ * `defineSkill` emits the platform's skill create envelope **minus the owner**
6
+ * (`ownerId`/`ownerType` injected by the wire client at deploy; the update DTO
7
+ * omits them) with `CatalogRef` tokens at each tool's reference positions.
8
+ *
9
+ * Identity comes from the authoring file's `refName`, exactly like
10
+ * `defineAutomation` / `defineAgent`; the owning app still comes from `parent`.
11
+ */
12
+ import { slimTokens } from "../../catalog/index.js";
13
+ /**
14
+ * The provider validates `name` client-side against this pattern (confirmed
15
+ * live) — it is NOT a free-text display name like an agent's; the platform
16
+ * uses it as the skill's identifier.
17
+ */
18
+ const SKILL_NAME_PATTERN = /^[a-z0-9-]{1,64}$/;
19
+ /** Build a v2 skill entity config, exposing `.ref(refName)` and `.def(refName)`. */
20
+ export function defineSkill(opts) {
21
+ if (!SKILL_NAME_PATTERN.test(opts.name)) {
22
+ throw new Error(`skill name "${opts.name}" must be 1-64 characters of lowercase letters, digits, and hyphens ` +
23
+ `(a-z, 0-9, -) — the platform uses it as the skill's identifier, not a free-text label.`);
24
+ }
25
+ return {
26
+ ref(refName) {
27
+ return { __kind: "skill", refName, name: opts.name, parent: opts.parent };
28
+ },
29
+ def(refName) {
30
+ return {
31
+ kind: "skill",
32
+ parent: opts.parent,
33
+ refName,
34
+ // Slim every embedded catalog token to its canonical form (drop barrel bags).
35
+ payload: slimTokens({
36
+ skill: {
37
+ name: opts.name,
38
+ description: opts.description,
39
+ instructions: opts.instructions,
40
+ status: opts.status ?? "DRAFT",
41
+ type: "CUSTOM",
42
+ ...(opts.properties !== undefined ? { properties: opts.properties } : {}),
43
+ },
44
+ tools: opts.tools ?? [],
45
+ }),
46
+ ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
47
+ };
48
+ },
49
+ };
50
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * printSkillV2 — pulled skill rendering for the terraform path. Consumes
3
+ * the `NormalizedSkill` that `skillFromTf` produces and emits an
4
+ * `apps/<app>/skills/<refName>.ts` authoring file: `defineSkill` with tools
5
+ * as `catalog` tokens (self-app) or a TODO literal (foreign apps — their
6
+ * catalog may not exist in this workspace) and tool fields as
7
+ * `catalog.<app>.fields.<key>`.
8
+ *
9
+ * Named identically to (but distinct from, different file/path) the legacy
10
+ * AST-based `printSkillV2` in `print-skill.ts` — same precedent as
11
+ * `entities/agent/deserializer/print-agent.ts` vs. `print-agent-v2.ts`.
12
+ *
13
+ * Platform ids never reach printed source.
14
+ */
15
+ import type { NormalizedSkill } from "../from-tf.js";
16
+ export interface PrintSkillV2Options {
17
+ /** The owning app's refName — `parent:` and the catalog token root. */
18
+ readonly appRefName: string;
19
+ /**
20
+ * Set for a cross-org clone: a foreign-app tool target was resolved
21
+ * against the SOURCE org, so it's flagged as a TODO for manual review
22
+ * instead of silently carried over — same treatment as agent tools
23
+ * (`src/entities/agent/deserializer/print-agent-v2.ts`).
24
+ */
25
+ readonly crossOrg?: boolean;
26
+ /**
27
+ * Name → refName for every app already on disk in this workspace (board
28
+ * issue #40). A foreign-app tool target whose name is a key here prints
29
+ * `catalog.<refName>` instead of the always-safe literal stub.
30
+ */
31
+ readonly foreignAppRefNames?: ReadonlyMap<string, string>;
32
+ /**
33
+ * Same as {@link foreignAppRefNames}, keyed for elements (board issue
34
+ * #42) — a `foreignElement` tool target whose name is a key here prints
35
+ * `catalog.<refName>` instead of the literal stub.
36
+ */
37
+ readonly foreignElementRefNames?: ReadonlyMap<string, string>;
38
+ }
39
+ export declare function printSkillV2(skill: NormalizedSkill, opts: PrintSkillV2Options): string;
@@ -0,0 +1,124 @@
1
+ /**
2
+ * printSkillV2 — pulled skill rendering for the terraform path. Consumes
3
+ * the `NormalizedSkill` that `skillFromTf` produces and emits an
4
+ * `apps/<app>/skills/<refName>.ts` authoring file: `defineSkill` with tools
5
+ * as `catalog` tokens (self-app) or a TODO literal (foreign apps — their
6
+ * catalog may not exist in this workspace) and tool fields as
7
+ * `catalog.<app>.fields.<key>`.
8
+ *
9
+ * Named identically to (but distinct from, different file/path) the legacy
10
+ * AST-based `printSkillV2` in `print-skill.ts` — same precedent as
11
+ * `entities/agent/deserializer/print-agent.ts` vs. `print-agent-v2.ts`.
12
+ *
13
+ * Platform ids never reach printed source.
14
+ */
15
+ import { quote } from "../../../../pull/util.js";
16
+ import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
17
+ const TOOL_FACTORY_BY_TYPE_KEY = {
18
+ createRecord: "skillCreateRecord",
19
+ searchAspect: "skillSearchAspect",
20
+ };
21
+ export function printSkillV2(skill, opts) {
22
+ const { appRefName } = opts;
23
+ const crossOrg = opts.crossOrg === true;
24
+ const factories = [...new Set(skill.tools.map((t) => TOOL_FACTORY_BY_TYPE_KEY[t.typeKey]).filter(Boolean))].sort();
25
+ const usesCatalog = skill.tools.some((t) => t.target.kind === "self" ||
26
+ (t.fields !== undefined && t.fields.length > 0) ||
27
+ (t.target.kind === "foreignApp" && opts.foreignAppRefNames?.has(t.target.name)) ||
28
+ (t.target.kind === "foreignElement" && opts.foreignElementRefNames?.has(t.target.name)));
29
+ const lines = [];
30
+ lines.push("/**");
31
+ lines.push(` * ${skill.name}`);
32
+ lines.push(" *");
33
+ lines.push(" * Auto-generated by EDK (v2 pull). Hand-edit freely; the generator is a");
34
+ lines.push(" * one-shot starting point, not a live-binding view.");
35
+ lines.push(" */");
36
+ lines.push("");
37
+ lines.push(`import { ${[...factories, "defineSkill"].sort().join(", ")} } from ${JSON.stringify(sdkPackageSpecifier("agents/skills"))};`);
38
+ if (usesCatalog)
39
+ lines.push(`import catalog from "@catalog";`);
40
+ lines.push("");
41
+ lines.push(`const ${skill.refName} = defineSkill({`);
42
+ lines.push(` name: ${quote(skill.name)},`);
43
+ lines.push(` parent: ${quote(appRefName)},`);
44
+ lines.push(` description: ${quote(skill.description)},`);
45
+ lines.push(` instructions: ${quote(skill.instructions)},`);
46
+ if (skill.status !== undefined)
47
+ lines.push(` status: ${quote(skill.status)},`);
48
+ if (skill.properties !== undefined) {
49
+ lines.push(` properties: ${JSON.stringify(skill.properties)},`);
50
+ }
51
+ if (skill.tools.length > 0) {
52
+ lines.push(" tools: [");
53
+ for (const tool of skill.tools) {
54
+ lines.push(...printTool(tool, appRefName, crossOrg, opts.foreignAppRefNames, opts.foreignElementRefNames).map((l) => ` ${l}`));
55
+ }
56
+ lines.push(" ],");
57
+ }
58
+ lines.push("});");
59
+ lines.push("");
60
+ lines.push(`export default ${skill.refName};`);
61
+ lines.push("");
62
+ return lines.join("\n");
63
+ }
64
+ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElementRefNames) {
65
+ const factory = TOOL_FACTORY_BY_TYPE_KEY[tool.typeKey] ?? "skillSearchAspect";
66
+ const lines = [`${factory}({`];
67
+ lines.push(` name: ${quote(tool.name)},`);
68
+ lines.push(` description: ${quote(tool.description)},`);
69
+ if (tool.status !== undefined)
70
+ lines.push(` status: ${quote(tool.status)},`);
71
+ if (tool.startMessage !== undefined)
72
+ lines.push(` startMessage: ${quote(tool.startMessage)},`);
73
+ if (tool.target.kind === "self") {
74
+ lines.push(` aspect: catalog.${appRefName},`);
75
+ }
76
+ else {
77
+ // Board issue #42: the target can be a foreign APP or a foreign
78
+ // ELEMENT — each stub carries the right `__kind` and is looked up
79
+ // against its own map, never conflated.
80
+ const entityKind = tool.target.kind === "foreignElement" ? "element" : "app";
81
+ const refNames = tool.target.kind === "foreignElement" ? foreignElementRefNames : foreignAppRefNames;
82
+ const foreignRefName = refNames?.get(tool.target.name);
83
+ if (foreignRefName !== undefined) {
84
+ // The dependency is already pulled into this workspace (board issue
85
+ // #40) — a typed token, not a stub.
86
+ lines.push(` aspect: catalog.${foreignRefName},`);
87
+ }
88
+ else {
89
+ // The foreign app/element's catalog may not exist in this workspace —
90
+ // a literal token compiles and deploys; swap for a catalog token when
91
+ // available (`edk pull app`/`edk pull element` reports missing
92
+ // dependencies like this one).
93
+ const todo = crossOrg
94
+ ? ` // TODO: cross-org clone — "${tool.target.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
95
+ : "";
96
+ lines.push(` aspect: { __kind: ${quote(entityKind)}, refName: ${quote(tool.target.name)}, name: ${quote(tool.target.name)} },${todo}`);
97
+ }
98
+ }
99
+ if (tool.typeKey === "searchAspect") {
100
+ lines.push(` queryDescription: ${quote(tool.queryDescription ?? "")},`);
101
+ if (tool.limit !== undefined)
102
+ lines.push(` limit: ${tool.limit},`);
103
+ }
104
+ if (tool.fields !== undefined && tool.fields.length > 0) {
105
+ lines.push(" fields: [");
106
+ for (const f of tool.fields) {
107
+ // A foreign/out-of-scope aspect's field has no field resource ei can
108
+ // reference — it falls back to a bare platform id (board issue #169);
109
+ // print the raw-id shape (SkillSearchRawIdField/SkillRecordRawIdField)
110
+ // instead of a catalog token.
111
+ const isRaw = f.key === undefined;
112
+ const parts = isRaw ? [`fieldId: ${quote(f.rawFieldId ?? "")}`] : [`field: catalog.${appRefName}.fields.${f.key}`];
113
+ parts.push(`name: ${quote(f.name ?? "")}`);
114
+ parts.push(`description: ${quote(f.description ?? "")}`);
115
+ if (tool.typeKey === "createRecord" && f.required !== undefined)
116
+ parts.push(`required: ${f.required}`);
117
+ 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" : "";
118
+ lines.push(` { ${parts.join(", ")} },${todo}`);
119
+ }
120
+ lines.push(" ],");
121
+ }
122
+ lines.push("}),");
123
+ return lines;
124
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Skill extraction: `skillFromTf` turns an `elementum_agentic_skill` block +
3
+ * its tool blocks (delegated to `entities/skill-tool/from-tf.ts`) into the
4
+ * normalized shape `printSkillV2` consumes. Platform ids come only from the
5
+ * stream's import blocks and stay data-side — they never reach printed
6
+ * source. Mirrors `entities/agent/from-tf.ts`.
7
+ */
8
+ import { type FromTfContext } from "../../engine/pull/context.js";
9
+ import { type TfBlock } from "../../engine/tf/index.js";
10
+ import { type NormalizedSkillTool } from "../skill-tool/from-tf.js";
11
+ export interface NormalizedSkill {
12
+ /** Authoring key = the bijective image of the exported label. */
13
+ readonly refName: string;
14
+ readonly name: string;
15
+ readonly description: string;
16
+ readonly instructions: string;
17
+ /** Present only when it differs from the default ("DRAFT"). */
18
+ readonly status?: "ACTIVE" | "INACTIVE";
19
+ readonly properties?: Record<string, unknown>;
20
+ readonly tools: readonly NormalizedSkillTool[];
21
+ }
22
+ export interface SkillFromTfResult {
23
+ readonly skill?: NormalizedSkill;
24
+ /** Set when the skill can't be authored on the terraform path — reported, not fatal. */
25
+ readonly skippedReason?: string;
26
+ }
27
+ /**
28
+ * The `elementum_agentic_skill` block + its tool blocks → the normalized
29
+ * skill. Tool blocks belonging to OTHER skills are skipped with a
30
+ * diagnostic (the caller partitions per-skill by skill_id, but stays
31
+ * defensive).
32
+ */
33
+ export declare function skillFromTf(skillBlock: TfBlock, toolBlocks: readonly TfBlock[], appLabel: string, ctx: FromTfContext): SkillFromTfResult;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Skill extraction: `skillFromTf` turns an `elementum_agentic_skill` block +
3
+ * its tool blocks (delegated to `entities/skill-tool/from-tf.ts`) into the
4
+ * normalized shape `printSkillV2` consumes. Platform ids come only from the
5
+ * stream's import blocks and stay data-side — they never reach printed
6
+ * source. Mirrors `entities/agent/from-tf.ts`.
7
+ */
8
+ import { EntityTfError } from "../../engine/entity.js";
9
+ import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
10
+ import { scopedLabelToBagKey } from "../../engine/tf/index.js";
11
+ import { skillToolFromTf } from "../skill-tool/from-tf.js";
12
+ import { APP_RESOURCE_TYPE } from "../app/module.js";
13
+ import { SKILL_RESOURCE_TYPE } from "./module.js";
14
+ /** Attributes `skillFromTf` understands — anything else is dialect growth, reported loudly. */
15
+ const KNOWN_SKILL_ATTRS = new Set([
16
+ "owner_id",
17
+ "owner_type",
18
+ "name",
19
+ "description",
20
+ "instructions",
21
+ "status",
22
+ "type",
23
+ "properties",
24
+ "depends_on",
25
+ ]);
26
+ /** Dialect attrs with no authoring slot yet — reported by name, skill still pulled. */
27
+ const UNAUTHORABLE_SKILL_ATTRS = new Set([
28
+ "routing_priority",
29
+ "aliases",
30
+ "example_utterances",
31
+ "positive_keywords",
32
+ "negative_keywords",
33
+ "user_ids",
34
+ "group_ids",
35
+ ]);
36
+ /**
37
+ * The `elementum_agentic_skill` block + its tool blocks → the normalized
38
+ * skill. Tool blocks belonging to OTHER skills are skipped with a
39
+ * diagnostic (the caller partitions per-skill by skill_id, but stays
40
+ * defensive).
41
+ */
42
+ export function skillFromTf(skillBlock, toolBlocks, appLabel, ctx) {
43
+ const label = skillBlock.label;
44
+ if (label === undefined || label === "") {
45
+ throw new EntityTfError(`${SKILL_RESOURCE_TYPE} block is missing its label`);
46
+ }
47
+ const attrs = skillBlock.attrs;
48
+ const name = optionalString(attrs, "name", `skill "${label}"`, ctx) ?? "";
49
+ const where = `skill "${name}" (${SKILL_RESOURCE_TYPE}.${label})`;
50
+ for (const key of Object.keys(attrs)) {
51
+ if (KNOWN_SKILL_ATTRS.has(key))
52
+ continue;
53
+ if (UNAUTHORABLE_SKILL_ATTRS.has(key)) {
54
+ ctx.diagnostics.push(`${where}: ${key} has no authoring slot on the terraform path yet; a rebuilt stream will omit it`);
55
+ }
56
+ else {
57
+ ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend skillFromTf deliberately`);
58
+ }
59
+ }
60
+ const ownerType = attrs["owner_type"];
61
+ if (ownerType !== "APP_ASPECT") {
62
+ return { skippedReason: `${where}: owner_type ${JSON.stringify(ownerType)} has no terraform-path authoring yet; skipped` };
63
+ }
64
+ if (resourceRefLabel(attrs["owner_id"], APP_RESOURCE_TYPE) !== appLabel) {
65
+ return { skippedReason: `${where}: owner_id does not reference ${APP_RESOURCE_TYPE}.${appLabel}; skipped` };
66
+ }
67
+ let properties;
68
+ const rawProperties = attrs["properties"];
69
+ if (typeof rawProperties === "string" && rawProperties !== "") {
70
+ try {
71
+ properties = JSON.parse(rawProperties);
72
+ }
73
+ catch {
74
+ ctx.diagnostics.push(`${where}: properties is not valid JSON; dropped`);
75
+ }
76
+ }
77
+ const status = optionalString(attrs, "status", where, ctx);
78
+ const owner = { appType: APP_RESOURCE_TYPE, appLabel, ownerTfLabel: appLabel, skillType: SKILL_RESOURCE_TYPE, skillLabel: label };
79
+ const tools = [];
80
+ for (const block of toolBlocks) {
81
+ const tool = skillToolFromTf(block, owner, ctx);
82
+ if (tool !== undefined)
83
+ tools.push(tool);
84
+ }
85
+ return {
86
+ skill: {
87
+ refName: scopedLabelToBagKey(appLabel, label),
88
+ name,
89
+ description: optionalString(attrs, "description", where, ctx) ?? "",
90
+ instructions: optionalString(attrs, "instructions", where, ctx) ?? "",
91
+ ...((status === "ACTIVE" || status === "INACTIVE") && { status }),
92
+ ...(properties !== undefined && { properties }),
93
+ tools,
94
+ },
95
+ };
96
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * v2 skill authoring — emits the platform's skill wire shape (minus the owner,
3
+ * which the deploy wire client injects) with `CatalogRef` tokens at every
4
+ * reference position. Standalone from v1.
5
+ */
6
+ export { defineSkill, type SkillConfigured, type SkillV2Options } from "./build.js";
7
+ export { skillAutomation, skillCreateRecord, skillRunAgent, skillSearchAspect, skillSearchTable, skillUpdateRecord, type SkillRecordField, type SkillRecordFieldInput, type SkillRecordRawIdField, type SkillSearchField, type SkillSearchFieldInput, type SkillSearchRawIdField, type SkillToolStatus, type SkillTool, } from "./tools.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * v2 skill authoring — emits the platform's skill wire shape (minus the owner,
3
+ * which the deploy wire client injects) with `CatalogRef` tokens at every
4
+ * reference position. Standalone from v1.
5
+ */
6
+ export { defineSkill } from "./build.js";
7
+ export { skillAutomation, skillCreateRecord, skillRunAgent, skillSearchAspect, skillSearchTable, skillUpdateRecord, } from "./tools.js";
@@ -0,0 +1,4 @@
1
+ /** The skill entity's registry entry + resource-type constant (see src/graph/). */
2
+ import { type EntityKindModule } from "../../graph/types.js";
3
+ export declare const SKILL_RESOURCE_TYPE = "elementum_agentic_skill";
4
+ export declare const skillModule: EntityKindModule;
@@ -0,0 +1,111 @@
1
+ /** The skill entity's registry entry + resource-type constant (see src/graph/). */
2
+ import { bareFactoryEntry } from "../../catalog/render-helpers.js";
3
+ import { isTfExpr } from "../../engine/tf/index.js";
4
+ import { printSkillV2 } from "./deserializer/print-skill-v2.js";
5
+ import { skillFromTf } from "./from-tf.js";
6
+ import { skillToTf } from "./to-tf.js";
7
+ export const SKILL_RESOURCE_TYPE = "elementum_agentic_skill";
8
+ function isConfigured(value) {
9
+ return (typeof value === "object" &&
10
+ value !== null &&
11
+ typeof value.ref === "function" &&
12
+ typeof value.def === "function");
13
+ }
14
+ function skillStubRef(refName, parent) {
15
+ return { __kind: "skill", refName, name: refName, parent };
16
+ }
17
+ function skillRefFromAuthoring(args) {
18
+ const { refName, parent, defaultExport } = args;
19
+ if (isConfigured(defaultExport)) {
20
+ const catalogRef = defaultExport.ref(refName);
21
+ if (catalogRef.__kind !== "skill")
22
+ return undefined;
23
+ return catalogRef;
24
+ }
25
+ if (typeof defaultExport !== "object" ||
26
+ defaultExport === null ||
27
+ defaultExport.kind !== "skill") {
28
+ return undefined;
29
+ }
30
+ const entity = defaultExport;
31
+ const entityRefName = entity.refName === "" ? refName : entity.refName;
32
+ const entityParent = entity.parent === "" ? parent : entity.parent;
33
+ const maybeRefName = entity.ref?.name;
34
+ const payload = entity.payload;
35
+ const name = typeof maybeRefName === "string"
36
+ ? maybeRefName
37
+ : typeof payload.name === "string"
38
+ ? payload.name
39
+ : typeof payload.skill?.name === "string"
40
+ ? payload.skill.name
41
+ : entityRefName;
42
+ return { __kind: "skill", refName: entityRefName, name, parent: entityParent };
43
+ }
44
+ function extractSkills(ownBlocks, stream, ctx) {
45
+ const toolBlocks = stream.byKind.get("skill-tool") ?? [];
46
+ const items = [];
47
+ const skipped = [];
48
+ const diagnostics = [];
49
+ for (const skillBlock of ownBlocks) {
50
+ const skillLabel = skillBlock.label ?? "";
51
+ const ownTools = toolBlocks.filter((b) => {
52
+ const ref = b.attrs["skill_id"];
53
+ return isTfExpr(ref) && ref.$expr === "resource-attr" && ref.type === SKILL_RESOURCE_TYPE && ref.label === skillLabel;
54
+ });
55
+ const { skill, skippedReason } = skillFromTf(skillBlock, ownTools, ctx.appTfLabel, ctx);
56
+ if (skill !== undefined)
57
+ items.push(skill);
58
+ else if (skippedReason !== undefined) {
59
+ skipped.push(`${SKILL_RESOURCE_TYPE}.${skillLabel}`);
60
+ diagnostics.push(skippedReason);
61
+ }
62
+ }
63
+ return { items, skipped, diagnostics };
64
+ }
65
+ export const skillModule = {
66
+ kind: "skill",
67
+ stream: { role: "streamMember" },
68
+ authoring: { unit: "ownFile", bag: "skills" },
69
+ parents: [
70
+ { parent: "org", child: "skill" },
71
+ { parent: "app", child: "skill" },
72
+ { parent: "agent", child: "skill" },
73
+ ],
74
+ resource: { shape: "single", resourceType: SKILL_RESOURCE_TYPE, adoptable: true },
75
+ // Foreign skills (an agent's skillAccess pointing at a skill owned by a
76
+ // different app) emit `data.elementum_agentic_skill` — mirrors appModule.
77
+ data: { participates: true, lookupAttr: "name", referencedByBuild: true },
78
+ canvas: { participates: true, label: "Skills", glyph: "◇", component: "skillCard" },
79
+ lifecycle: {
80
+ participates: true,
81
+ extractOwnFile: extractSkills,
82
+ printOwnFile: (item, opts) => {
83
+ const skill = item;
84
+ return {
85
+ refName: skill.refName,
86
+ source: printSkillV2(skill, {
87
+ appRefName: opts.appRefName,
88
+ ...(opts.crossOrg !== undefined && { crossOrg: opts.crossOrg }),
89
+ ...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
90
+ ...(opts.foreignElementRefNames !== undefined && { foreignElementRefNames: opts.foreignElementRefNames }),
91
+ }),
92
+ };
93
+ },
94
+ toTf: (entity, ctx) => skillToTf(entity, {
95
+ appRefName: ctx.appRefName,
96
+ appTfLabel: ctx.appTfLabel,
97
+ orgRefs: ctx.orgRefs,
98
+ diagnostics: ctx.diagnostics,
99
+ }),
100
+ },
101
+ catalog: {
102
+ participates: true,
103
+ refKind: "skill",
104
+ catalogBag: "skills",
105
+ renderOrder: 30,
106
+ catalogRoot: "app",
107
+ renderEntry: ({ keyName, baseIndent }) => bareFactoryEntry("skillRef", keyName, baseIndent),
108
+ stubRef: skillStubRef,
109
+ refFromAuthoring: skillRefFromAuthoring,
110
+ },
111
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Skill emission: `skillToTf` consumes the discovered `DeployableEntity`
3
+ * (the `defineSkill` def() payload) and emits `elementum_agentic_skill` +
4
+ * one tool resource per implemented tool (the tool pass delegates to
5
+ * `entities/skill-tool/to-tf.ts`). Mirrors `entities/agent/to-tf.ts`.
6
+ *
7
+ * The dialect is the live provider's ACTUAL schema (confirmed against the
8
+ * deployed `elementum` provider, `main` branch of the ei terraform provider
9
+ * repo — not `pristine-refactor`'s older, generic single-tool-resource
10
+ * shape): `owner_id`/`owner_type` as the owning app's resource ref +
11
+ * `"APP_ASPECT"`, `name`/`description`/`instructions`/`status`/`type`/
12
+ * `properties`. Discovery/routing fields (aliases, example_utterances,
13
+ * *_keywords, routing_priority) and access policy (user_ids/group_ids)
14
+ * aren't authored yet, so there's nothing to emit for them.
15
+ */
16
+ import type { OrgRefLookup } from "../../engine/build/context.js";
17
+ import { type DeployableEntity } from "../../engine/entity.js";
18
+ import { type TfBlock } from "../../engine/tf/index.js";
19
+ export interface SkillToTfContext {
20
+ /** The owning app's refName (self-target detection) and tfLabel (namespace). */
21
+ readonly appRefName: string;
22
+ readonly appTfLabel: string;
23
+ readonly orgRefs: OrgRefLookup;
24
+ /** Degradations land here — reported by the caller, never silent. */
25
+ readonly diagnostics: string[];
26
+ }
27
+ export interface SkillToTfResult {
28
+ readonly blocks: readonly TfBlock[];
29
+ /** The skill's terraform address. */
30
+ readonly address: string;
31
+ }
32
+ /** `elementum_agentic_skill` + one tool resource per implemented tool, in the platform's dialect. */
33
+ export declare function skillToTf(entity: DeployableEntity, ctx: SkillToTfContext): SkillToTfResult;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Skill emission: `skillToTf` consumes the discovered `DeployableEntity`
3
+ * (the `defineSkill` def() payload) and emits `elementum_agentic_skill` +
4
+ * one tool resource per implemented tool (the tool pass delegates to
5
+ * `entities/skill-tool/to-tf.ts`). Mirrors `entities/agent/to-tf.ts`.
6
+ *
7
+ * The dialect is the live provider's ACTUAL schema (confirmed against the
8
+ * deployed `elementum` provider, `main` branch of the ei terraform provider
9
+ * repo — not `pristine-refactor`'s older, generic single-tool-resource
10
+ * shape): `owner_id`/`owner_type` as the owning app's resource ref +
11
+ * `"APP_ASPECT"`, `name`/`description`/`instructions`/`status`/`type`/
12
+ * `properties`. Discovery/routing fields (aliases, example_utterances,
13
+ * *_keywords, routing_priority) and access policy (user_ids/group_ids)
14
+ * aren't authored yet, so there's nothing to emit for them.
15
+ */
16
+ import { EntityTfError } from "../../engine/entity.js";
17
+ import { appScopedResourceLabel, expr, tsLabelToTfLabel } from "../../engine/tf/index.js";
18
+ import { skillToolToTf } from "../skill-tool/to-tf.js";
19
+ import { APP_RESOURCE_TYPE } from "../app/module.js";
20
+ import { SKILL_RESOURCE_TYPE } from "./module.js";
21
+ /** `elementum_agentic_skill` + one tool resource per implemented tool, in the platform's dialect. */
22
+ export function skillToTf(entity, ctx) {
23
+ if (entity.kind !== "skill") {
24
+ throw new EntityTfError(`skillToTf expects kind "skill"; got "${entity.kind}" (refName "${entity.refName}")`);
25
+ }
26
+ const payload = entity.payload;
27
+ const elementum = payload?.skill;
28
+ if (payload === null || typeof payload !== "object" || elementum === undefined) {
29
+ throw new EntityTfError(`skill "${entity.refName}" has no skill payload — was it built with defineSkill?`);
30
+ }
31
+ const tfLabel = appScopedResourceLabel(ctx.appTfLabel, tsLabelToTfLabel(entity.refName));
32
+ const name = elementum.name ?? "";
33
+ const attrs = {
34
+ owner_id: expr.resourceAttr(APP_RESOURCE_TYPE, ctx.appTfLabel, ["id"]),
35
+ owner_type: "APP_ASPECT",
36
+ name,
37
+ description: elementum.description ?? "",
38
+ instructions: elementum.instructions ?? "",
39
+ status: elementum.status ?? "DRAFT",
40
+ type: elementum.type ?? "CUSTOM",
41
+ };
42
+ if (elementum.properties !== undefined) {
43
+ attrs["properties"] = JSON.stringify(elementum.properties);
44
+ }
45
+ const blocks = [{ kind: "resource", type: SKILL_RESOURCE_TYPE, label: tfLabel, attrs }];
46
+ for (const entry of payload.tools ?? []) {
47
+ const tool = skillToolToTf(entry, {
48
+ appRefName: ctx.appRefName,
49
+ appTfLabel: ctx.appTfLabel,
50
+ skillTfLabel: tfLabel,
51
+ foreignAppRef: (l, n) => ctx.orgRefs.foreignApp(l, n),
52
+ foreignElementRef: (l, n) => ctx.orgRefs.foreignElement(l, n),
53
+ diagnostics: ctx.diagnostics,
54
+ });
55
+ if (tool !== undefined)
56
+ blocks.push(tool.block);
57
+ }
58
+ return { blocks, address: `${SKILL_RESOURCE_TYPE}.${tfLabel}` };
59
+ }