@voxgig/sdkgen 4.10.0 → 4.11.0

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 (304) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/package.json +1 -1
  3. package/project/.sdk/model/feature/secrets.aon +330 -0
  4. package/project/.sdk/model/target/c.aon +15 -2
  5. package/project/.sdk/model/target/cpp.aon +18 -0
  6. package/project/.sdk/model/target/lua.aon +17 -0
  7. package/project/.sdk/model/target/ocaml.aon +48 -5
  8. package/project/.sdk/model/target/zig.aon +30 -4
  9. package/project/.sdk/src/cmp/c/Config_c.ts +338 -1
  10. package/project/.sdk/src/cmp/c/Main_c.ts +57 -2
  11. package/project/.sdk/src/cmp/c/Package_c.ts +12 -2
  12. package/project/.sdk/src/cmp/cpp/Config_cpp.ts +324 -2
  13. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +2 -0
  14. package/project/.sdk/src/cmp/cpp/Main_cpp.ts +62 -4
  15. package/project/.sdk/src/cmp/cpp/Package_cpp.ts +10 -0
  16. package/project/.sdk/src/cmp/lua/Config_lua.ts +88 -0
  17. package/project/.sdk/src/cmp/lua/Gitignore_lua.ts +4 -0
  18. package/project/.sdk/src/cmp/lua/Main_lua.ts +93 -3
  19. package/project/.sdk/src/cmp/lua/Package_lua.ts +60 -0
  20. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +10 -0
  21. package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +183 -5
  22. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +160 -3
  23. package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +25 -1
  24. package/project/.sdk/src/cmp/zig/Config_zig.ts +130 -9
  25. package/project/.sdk/src/cmp/zig/Main_zig.ts +208 -4
  26. package/project/.sdk/{tm/zig/build.zig → src/cmp/zig/fragment/Build.fragment.zig} +7 -0
  27. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +25 -0
  28. package/project/.sdk/{tm/zig/root.zig → src/cmp/zig/fragment/Root.fragment.zig} +9 -0
  29. package/project/.sdk/tm/c/Makefile +58 -9
  30. package/project/.sdk/tm/c/core/sdk.h +10 -0
  31. package/project/.sdk/tm/c/feature/secrets/plugin/capability.c +133 -0
  32. package/project/.sdk/tm/c/feature/secrets/plugin/capability.h +39 -0
  33. package/project/.sdk/tm/c/feature/secrets/plugin/catalog.c +83 -0
  34. package/project/.sdk/tm/c/feature/secrets/plugin/catalog.h +48 -0
  35. package/project/.sdk/tm/c/feature/secrets/plugin/config.c +413 -0
  36. package/project/.sdk/tm/c/feature/secrets/plugin/config.h +24 -0
  37. package/project/.sdk/tm/c/feature/secrets/plugin/depend.c +264 -0
  38. package/project/.sdk/tm/c/feature/secrets/plugin/depend.h +29 -0
  39. package/project/.sdk/tm/c/feature/secrets/plugin/env.c +220 -0
  40. package/project/.sdk/tm/c/feature/secrets/plugin/env.h +19 -0
  41. package/project/.sdk/tm/c/feature/secrets/plugin/export.c +97 -0
  42. package/project/.sdk/tm/c/feature/secrets/plugin/export.h +19 -0
  43. package/project/.sdk/tm/c/feature/secrets/plugin/graph.c +237 -0
  44. package/project/.sdk/tm/c/feature/secrets/plugin/graph.h +17 -0
  45. package/project/.sdk/tm/c/feature/secrets/plugin/host.c +1494 -0
  46. package/project/.sdk/tm/c/feature/secrets/plugin/host.h +135 -0
  47. package/project/.sdk/tm/c/feature/secrets/plugin/order.c +288 -0
  48. package/project/.sdk/tm/c/feature/secrets/plugin/order.h +18 -0
  49. package/project/.sdk/tm/c/feature/secrets/plugin/point.c +141 -0
  50. package/project/.sdk/tm/c/feature/secrets/plugin/point.h +80 -0
  51. package/project/.sdk/tm/c/feature/secrets/plugin/ref.c +170 -0
  52. package/project/.sdk/tm/c/feature/secrets/plugin/ref.h +52 -0
  53. package/project/.sdk/tm/c/feature/secrets/plugin/resolve.c +98 -0
  54. package/project/.sdk/tm/c/feature/secrets/plugin/resolve.h +18 -0
  55. package/project/.sdk/tm/c/feature/secrets/plugin/types.c +150 -0
  56. package/project/.sdk/tm/c/feature/secrets/plugin/types.h +104 -0
  57. package/project/.sdk/tm/c/feature/secrets/plugin/value.c +649 -0
  58. package/project/.sdk/tm/c/feature/secrets/plugin/value.h +135 -0
  59. package/project/.sdk/tm/c/feature/secrets/plugin/version.c +151 -0
  60. package/project/.sdk/tm/c/feature/secrets/plugin/version.h +34 -0
  61. package/project/.sdk/tm/c/feature/secrets/plugins/aws.c +281 -0
  62. package/project/.sdk/tm/c/feature/secrets/plugins/azuresecrets.c +207 -0
  63. package/project/.sdk/tm/c/feature/secrets/plugins/boru.c +164 -0
  64. package/project/.sdk/tm/c/feature/secrets/plugins/clock.c +75 -0
  65. package/project/.sdk/tm/c/feature/secrets/plugins/doppler.c +141 -0
  66. package/project/.sdk/tm/c/feature/secrets/plugins/encode.c +144 -0
  67. package/project/.sdk/tm/c/feature/secrets/plugins/gcpsecrets.c +177 -0
  68. package/project/.sdk/tm/c/feature/secrets/plugins/hashicorp.c +239 -0
  69. package/project/.sdk/tm/c/feature/secrets/plugins/httpjson.c +599 -0
  70. package/project/.sdk/tm/c/feature/secrets/plugins/infisical.c +165 -0
  71. package/project/.sdk/tm/c/feature/secrets/plugins/onepassword.c +194 -0
  72. package/project/.sdk/tm/c/feature/secrets/plugins/proc.c +233 -0
  73. package/project/.sdk/tm/c/feature/secrets/plugins/secretspec.c +125 -0
  74. package/project/.sdk/tm/c/feature/secrets/plugins/sekretoplugins.h +125 -0
  75. package/project/.sdk/tm/c/feature/secrets/plugins/sha256.c +270 -0
  76. package/project/.sdk/tm/c/feature/secrets/plugins/sigv4.c +382 -0
  77. package/project/.sdk/tm/c/feature/secrets/plugins/support.h +153 -0
  78. package/project/.sdk/tm/c/feature/secrets/plugins/tls.c +420 -0
  79. package/project/.sdk/tm/c/feature/secrets/sekreto/internal.h +86 -0
  80. package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +721 -0
  81. package/project/.sdk/tm/c/feature/secrets/sekreto/providers.c +813 -0
  82. package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.c +944 -0
  83. package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.h +490 -0
  84. package/project/.sdk/tm/c/feature/secrets/sekreto/util.c +442 -0
  85. package/project/.sdk/tm/c/feature/secrets.c +797 -0
  86. package/project/.sdk/tm/c/feature/secrets.h +46 -0
  87. package/project/.sdk/tm/c/src/feature/secrets/.gitkeep +0 -0
  88. package/project/.sdk/tm/c/tests/feature/secrets/secrets_test.c +802 -0
  89. package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +38 -11
  90. package/project/.sdk/tm/clojure/test/sdk/test/feature/secrets.clj +40 -6
  91. package/project/.sdk/tm/cpp/Makefile +48 -4
  92. package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.cpp +121 -0
  93. package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.hpp +41 -0
  94. package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.cpp +60 -0
  95. package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.hpp +66 -0
  96. package/project/.sdk/tm/cpp/feature/secrets/plugin/config.cpp +376 -0
  97. package/project/.sdk/tm/cpp/feature/secrets/plugin/config.hpp +29 -0
  98. package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.cpp +230 -0
  99. package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.hpp +31 -0
  100. package/project/.sdk/tm/cpp/feature/secrets/plugin/env.cpp +205 -0
  101. package/project/.sdk/tm/cpp/feature/secrets/plugin/env.hpp +25 -0
  102. package/project/.sdk/tm/cpp/feature/secrets/plugin/export.cpp +84 -0
  103. package/project/.sdk/tm/cpp/feature/secrets/plugin/export.hpp +24 -0
  104. package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.cpp +222 -0
  105. package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.hpp +21 -0
  106. package/project/.sdk/tm/cpp/feature/secrets/plugin/host.cpp +1200 -0
  107. package/project/.sdk/tm/cpp/feature/secrets/plugin/host.hpp +250 -0
  108. package/project/.sdk/tm/cpp/feature/secrets/plugin/order.cpp +250 -0
  109. package/project/.sdk/tm/cpp/feature/secrets/plugin/order.hpp +22 -0
  110. package/project/.sdk/tm/cpp/feature/secrets/plugin/point.cpp +110 -0
  111. package/project/.sdk/tm/cpp/feature/secrets/plugin/point.hpp +79 -0
  112. package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.cpp +136 -0
  113. package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.hpp +60 -0
  114. package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.cpp +82 -0
  115. package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.hpp +25 -0
  116. package/project/.sdk/tm/cpp/feature/secrets/plugin/types.cpp +90 -0
  117. package/project/.sdk/tm/cpp/feature/secrets/plugin/types.hpp +65 -0
  118. package/project/.sdk/tm/cpp/feature/secrets/plugin/value.cpp +491 -0
  119. package/project/.sdk/tm/cpp/feature/secrets/plugin/value.hpp +120 -0
  120. package/project/.sdk/tm/cpp/feature/secrets/plugin/version.cpp +143 -0
  121. package/project/.sdk/tm/cpp/feature/secrets/plugin/version.hpp +36 -0
  122. package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.cpp +248 -0
  123. package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.hpp +30 -0
  124. package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.cpp +149 -0
  125. package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.hpp +23 -0
  126. package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.cpp +117 -0
  127. package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.hpp +27 -0
  128. package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.cpp +180 -0
  129. package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.hpp +52 -0
  130. package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.cpp +87 -0
  131. package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.hpp +23 -0
  132. package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.cpp +121 -0
  133. package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.hpp +23 -0
  134. package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.cpp +153 -0
  135. package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.hpp +23 -0
  136. package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.cpp +666 -0
  137. package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.hpp +160 -0
  138. package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.cpp +123 -0
  139. package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.hpp +23 -0
  140. package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.cpp +125 -0
  141. package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.hpp +23 -0
  142. package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.cpp +223 -0
  143. package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.hpp +47 -0
  144. package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.cpp +104 -0
  145. package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.hpp +27 -0
  146. package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.cpp +242 -0
  147. package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.hpp +58 -0
  148. package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.cpp +260 -0
  149. package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.hpp +47 -0
  150. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.cpp +476 -0
  151. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.hpp +89 -0
  152. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.cpp +312 -0
  153. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.hpp +263 -0
  154. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.cpp +354 -0
  155. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.hpp +111 -0
  156. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.cpp +613 -0
  157. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.hpp +227 -0
  158. package/project/.sdk/tm/cpp/feature/secrets.hpp +745 -0
  159. package/project/.sdk/tm/cpp/src/feature/secrets/.gitkeep +0 -0
  160. package/project/.sdk/tm/cpp/test/feature/secrets/secrets_test.cpp +808 -0
  161. package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +34 -8
  162. package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +85 -0
  163. package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +17 -2
  164. package/project/.sdk/tm/elixir/test/feature/secrets/secrets_test.exs +41 -0
  165. package/project/.sdk/tm/go/feature/secrets_feature.go +32 -10
  166. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +116 -0
  167. package/project/.sdk/tm/java/feature/SecretsFeature.java +33 -8
  168. package/project/.sdk/tm/java/test/feature/secrets/SecretsFeatureTest.java +64 -0
  169. package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +34 -11
  170. package/project/.sdk/tm/js/test/feature/secrets/Secrets.test.js +73 -0
  171. package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +32 -7
  172. package/project/.sdk/tm/kotlin/test/feature/secrets/SecretsTest.kt +69 -0
  173. package/project/.sdk/tm/lua/Makefile +15 -4
  174. package/project/.sdk/tm/lua/feature/secrets/native/sekretonet.c +806 -0
  175. package/project/.sdk/tm/lua/feature/secrets/plugin/capability.lua +135 -0
  176. package/project/.sdk/tm/lua/feature/secrets/plugin/catalog.lua +63 -0
  177. package/project/.sdk/tm/lua/feature/secrets/plugin/config.lua +361 -0
  178. package/project/.sdk/tm/lua/feature/secrets/plugin/depend.lua +232 -0
  179. package/project/.sdk/tm/lua/feature/secrets/plugin/env.lua +168 -0
  180. package/project/.sdk/tm/lua/feature/secrets/plugin/export.lua +66 -0
  181. package/project/.sdk/tm/lua/feature/secrets/plugin/graph.lua +194 -0
  182. package/project/.sdk/tm/lua/feature/secrets/plugin/host.lua +1190 -0
  183. package/project/.sdk/tm/lua/feature/secrets/plugin/json.lua +169 -0
  184. package/project/.sdk/tm/lua/feature/secrets/plugin/order.lua +207 -0
  185. package/project/.sdk/tm/lua/feature/secrets/plugin/point.lua +106 -0
  186. package/project/.sdk/tm/lua/feature/secrets/plugin/ref.lua +115 -0
  187. package/project/.sdk/tm/lua/feature/secrets/plugin/resolve.lua +78 -0
  188. package/project/.sdk/tm/lua/feature/secrets/plugin/types.lua +275 -0
  189. package/project/.sdk/tm/lua/feature/secrets/plugin/version.lua +131 -0
  190. package/project/.sdk/tm/lua/feature/secrets/plugin.lua +76 -0
  191. package/project/.sdk/tm/lua/feature/secrets/sekreto/addr.lua +124 -0
  192. package/project/.sdk/tm/lua/feature/secrets/sekreto/err.lua +47 -0
  193. package/project/.sdk/tm/lua/feature/secrets/sekreto/name.lua +315 -0
  194. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/aws.lua +228 -0
  195. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/azuresecrets.lua +137 -0
  196. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/boru.lua +124 -0
  197. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/crypto.lua +212 -0
  198. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/doppler.lua +89 -0
  199. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/gcpsecrets.lua +129 -0
  200. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/hashicorp.lua +154 -0
  201. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/httpjson.lua +248 -0
  202. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/infisical.lua +113 -0
  203. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/json.lua +449 -0
  204. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/net.lua +198 -0
  205. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/onepassword.lua +126 -0
  206. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/secretspec.lua +93 -0
  207. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/sigv4.lua +269 -0
  208. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/support.lua +146 -0
  209. package/project/.sdk/tm/lua/feature/secrets/sekreto/providers.lua +346 -0
  210. package/project/.sdk/tm/lua/feature/secrets/sekreto.lua +479 -0
  211. package/project/.sdk/tm/lua/feature/secrets_feature.lua +690 -0
  212. package/project/.sdk/tm/lua/src/feature/secrets/.gitkeep +0 -0
  213. package/project/.sdk/tm/lua/test/extend_test.lua +105 -0
  214. package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +862 -0
  215. package/project/.sdk/tm/ocaml/Makefile +52 -8
  216. package/project/.sdk/tm/ocaml/feature/secrets/plugin/capability.ml +106 -0
  217. package/project/.sdk/tm/ocaml/feature/secrets/plugin/catalog.ml +43 -0
  218. package/project/.sdk/tm/ocaml/feature/secrets/plugin/config.ml +349 -0
  219. package/project/.sdk/tm/ocaml/feature/secrets/plugin/defs.ml +143 -0
  220. package/project/.sdk/tm/ocaml/feature/secrets/plugin/depend.ml +217 -0
  221. package/project/.sdk/tm/ocaml/feature/secrets/plugin/env.ml +197 -0
  222. package/project/.sdk/tm/ocaml/feature/secrets/plugin/export.ml +89 -0
  223. package/project/.sdk/tm/ocaml/feature/secrets/plugin/graph.ml +227 -0
  224. package/project/.sdk/tm/ocaml/feature/secrets/plugin/host.ml +1112 -0
  225. package/project/.sdk/tm/ocaml/feature/secrets/plugin/order.ml +202 -0
  226. package/project/.sdk/tm/ocaml/feature/secrets/plugin/point.ml +138 -0
  227. package/project/.sdk/tm/ocaml/feature/secrets/plugin/ref.ml +126 -0
  228. package/project/.sdk/tm/ocaml/feature/secrets/plugin/resolve.ml +62 -0
  229. package/project/.sdk/tm/ocaml/feature/secrets/plugin/types.ml +97 -0
  230. package/project/.sdk/tm/ocaml/feature/secrets/plugin/value.ml +387 -0
  231. package/project/.sdk/tm/ocaml/feature/secrets/plugin/version.ml +139 -0
  232. package/project/.sdk/tm/ocaml/feature/secrets/plugins/aws.ml +171 -0
  233. package/project/.sdk/tm/ocaml/feature/secrets/plugins/azuresecrets.ml +116 -0
  234. package/project/.sdk/tm/ocaml/feature/secrets/plugins/boru.ml +95 -0
  235. package/project/.sdk/tm/ocaml/feature/secrets/plugins/crypto.ml +149 -0
  236. package/project/.sdk/tm/ocaml/feature/secrets/plugins/doppler.ml +61 -0
  237. package/project/.sdk/tm/ocaml/feature/secrets/plugins/gcpsecrets.ml +93 -0
  238. package/project/.sdk/tm/ocaml/feature/secrets/plugins/hashicorp.ml +120 -0
  239. package/project/.sdk/tm/ocaml/feature/secrets/plugins/http.ml +421 -0
  240. package/project/.sdk/tm/ocaml/feature/secrets/plugins/httpjson.ml +66 -0
  241. package/project/.sdk/tm/ocaml/feature/secrets/plugins/infisical.ml +85 -0
  242. package/project/.sdk/tm/ocaml/feature/secrets/plugins/onepassword.ml +112 -0
  243. package/project/.sdk/tm/ocaml/feature/secrets/plugins/runcmd.ml +97 -0
  244. package/project/.sdk/tm/ocaml/feature/secrets/plugins/secretspec.ml +68 -0
  245. package/project/.sdk/tm/ocaml/feature/secrets/plugins/sigv4.ml +259 -0
  246. package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls.ml +44 -0
  247. package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls_stubs.c +358 -0
  248. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/json.ml +376 -0
  249. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/provider.ml +647 -0
  250. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/secret.ml +299 -0
  251. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/sekreto.ml +347 -0
  252. package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +453 -0
  253. package/project/.sdk/tm/ocaml/src/feature/secrets/.gitkeep +0 -0
  254. package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +670 -0
  255. package/project/.sdk/tm/perl/feature/secrets_feature.pm +33 -12
  256. package/project/.sdk/tm/perl/t/feature/secrets/secrets.t +47 -0
  257. package/project/.sdk/tm/php/feature/SecretsFeature.php +30 -6
  258. package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +98 -0
  259. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +28 -6
  260. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +114 -0
  261. package/project/.sdk/tm/rb/feature/secrets_feature.rb +28 -6
  262. package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +93 -0
  263. package/project/.sdk/tm/rust/feature/secrets.rs +33 -10
  264. package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +96 -0
  265. package/project/.sdk/tm/scala/feature/SecretsFeature.scala +29 -7
  266. package/project/.sdk/tm/scala/sdktest/feature/secrets/SecretsTestMain.scala +71 -0
  267. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +35 -12
  268. package/project/.sdk/tm/ts/test/feature/secrets/Secrets.test.ts +73 -0
  269. package/project/.sdk/tm/zig/feature/secrets/plugin/capability.zig +137 -0
  270. package/project/.sdk/tm/zig/feature/secrets/plugin/catalog.zig +90 -0
  271. package/project/.sdk/tm/zig/feature/secrets/plugin/config.zig +346 -0
  272. package/project/.sdk/tm/zig/feature/secrets/plugin/depend.zig +244 -0
  273. package/project/.sdk/tm/zig/feature/secrets/plugin/env.zig +201 -0
  274. package/project/.sdk/tm/zig/feature/secrets/plugin/export.zig +83 -0
  275. package/project/.sdk/tm/zig/feature/secrets/plugin/graph.zig +212 -0
  276. package/project/.sdk/tm/zig/feature/secrets/plugin/host.zig +1224 -0
  277. package/project/.sdk/tm/zig/feature/secrets/plugin/inst.zig +126 -0
  278. package/project/.sdk/tm/zig/feature/secrets/plugin/order.zig +228 -0
  279. package/project/.sdk/tm/zig/feature/secrets/plugin/plugin.zig +34 -0
  280. package/project/.sdk/tm/zig/feature/secrets/plugin/point.zig +166 -0
  281. package/project/.sdk/tm/zig/feature/secrets/plugin/ref.zig +147 -0
  282. package/project/.sdk/tm/zig/feature/secrets/plugin/resolve.zig +74 -0
  283. package/project/.sdk/tm/zig/feature/secrets/plugin/types.zig +140 -0
  284. package/project/.sdk/tm/zig/feature/secrets/plugin/value.zig +662 -0
  285. package/project/.sdk/tm/zig/feature/secrets/plugin/version.zig +139 -0
  286. package/project/.sdk/tm/zig/feature/secrets/plugins/aws.zig +294 -0
  287. package/project/.sdk/tm/zig/feature/secrets/plugins/azuresecrets.zig +222 -0
  288. package/project/.sdk/tm/zig/feature/secrets/plugins/boru.zig +188 -0
  289. package/project/.sdk/tm/zig/feature/secrets/plugins/doppler.zig +135 -0
  290. package/project/.sdk/tm/zig/feature/secrets/plugins/gcpsecrets.zig +170 -0
  291. package/project/.sdk/tm/zig/feature/secrets/plugins/hashicorp.zig +242 -0
  292. package/project/.sdk/tm/zig/feature/secrets/plugins/httpjson.zig +535 -0
  293. package/project/.sdk/tm/zig/feature/secrets/plugins/infisical.zig +167 -0
  294. package/project/.sdk/tm/zig/feature/secrets/plugins/onepassword.zig +202 -0
  295. package/project/.sdk/tm/zig/feature/secrets/plugins/secretspec.zig +160 -0
  296. package/project/.sdk/tm/zig/feature/secrets/plugins/sigv4.zig +336 -0
  297. package/project/.sdk/tm/zig/feature/secrets/sekreto/addr.zig +148 -0
  298. package/project/.sdk/tm/zig/feature/secrets/sekreto/builtins.zig +259 -0
  299. package/project/.sdk/tm/zig/feature/secrets/sekreto/provider.zig +440 -0
  300. package/project/.sdk/tm/zig/feature/secrets/sekreto/sekreto.zig +944 -0
  301. package/project/.sdk/tm/zig/feature/secrets.zig +854 -0
  302. package/project/.sdk/tm/zig/src/feature/secrets/.gitkeep +0 -0
  303. package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +891 -0
  304. package/project/sdkgen-package.json +1 -1
@@ -0,0 +1,137 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (zig/src/capability.zig)
2
+ // Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ //! Capabilities (§11.1).
5
+ //!
6
+ //! A DEPENDENCY IS ON A CAPABILITY, NOT ON A REF — because it is a
7
+ //! dependency on something that can do the job, and which instance is
8
+ //! doing it is exactly the configuration detail a plugin must not care
9
+ //! about. (§11.1 makes one narrow exception for a ref, and `host.zig`
10
+ //! implements it; the ranking here is capabilities only.)
11
+ //!
12
+ //! But A BINDING IS TO AN INSTANCE, not to a capability, which is what
13
+ //! decides behaviour when the bound provider leaves while another match
14
+ //! remains.
15
+
16
+ const std = @import("std");
17
+ const v = @import("value.zig");
18
+ const t = @import("types.zig");
19
+ const version = @import("version.zig");
20
+
21
+ /// PARTIAL MATCH, RECURSING INTO MAPS (§11.1). THIS FUNCTION IS WHAT
22
+ /// "EVERY LEAF" MEANS, and an earlier draft of the canonical did not
23
+ /// have it: the check was a scalar compare, which for any compound value
24
+ /// is reference identity in JavaScript. A requirement and a capability
25
+ /// are declared in different places and are never the same object, so
26
+ /// `match: {limits: {max: 5}}` could not be satisfied by ANY provider —
27
+ /// including one declaring exactly that. Invisible while every corpus
28
+ /// entry is scalar, which is why the go port found it and P2 did not.
29
+ ///
30
+ /// A LIST IS COMPARED LEAF-WISE AT THE SAME LENGTH, not as a subset —
31
+ /// "the first two of your three regions" is not something `match` can
32
+ /// say.
33
+ pub fn capmatchvalue(want: ?*v.Value, got: ?*v.Value) bool {
34
+ if (v.isMap(want)) {
35
+ if (!v.isMap(got)) return false;
36
+ for (v.keys(want)) |k| {
37
+ if (!v.has(got, k)) return false;
38
+ if (!capmatchvalue(v.get(want, k), v.get(got, k))) return false;
39
+ }
40
+ return true;
41
+ }
42
+ if (v.isList(want)) {
43
+ if (!v.isList(got) or v.len(want) != v.len(got)) return false;
44
+ for (v.items(want), 0..) |x, i| {
45
+ if (!capmatchvalue(x, v.at(got, i))) return false;
46
+ }
47
+ return true;
48
+ }
49
+ return v.same(want, got);
50
+ }
51
+
52
+ pub fn capmatches(req: ?*v.Value, prov: ?*v.Value) bool {
53
+ if (!v.same(v.get(req, "name"), v.get(prov, "name"))) return false;
54
+
55
+ const range = v.get(req, "range");
56
+ if (!v.isNull(range)) {
57
+ const ver = v.get(prov, "version");
58
+ if (v.isNull(ver)) return false;
59
+ if (!version.satisfiesq(ver, range)) return false;
60
+ }
61
+
62
+ // `match` is checked against the provider's `attrs`, key by key. A
63
+ // key the provider does not carry is a MISS, not a pass: a
64
+ // requirement asking for `transactional: true` must not be satisfied
65
+ // by a provider that never said.
66
+ const m = v.get(req, "match");
67
+ if (!v.isNull(m)) {
68
+ var attrs = v.get(prov, "attrs");
69
+ if (v.isNull(attrs)) attrs = v.vmap();
70
+ for (v.keys(m)) |k| {
71
+ if (!v.has(attrs, k)) return false;
72
+ if (!capmatchvalue(v.get(m, k), v.get(attrs, k))) return false;
73
+ }
74
+ }
75
+
76
+ return true;
77
+ }
78
+
79
+ /// The rank key for one candidate. THE KEYS ARE PRECOMPUTED because the
80
+ /// version comparison is fallible and a zig sort comparator cannot be:
81
+ /// `parseversion` can fail, and a comparator that swallowed that would
82
+ /// have to guess. Precomputing also makes the rank a TOTAL order on
83
+ /// purpose — without one, "any provider satisfies" is true of the GRAPH
84
+ /// and useless to the PLUGIN, and two ports could bind different `store`
85
+ /// instances, both resolve green, and behave differently.
86
+ const RankKey = struct {
87
+ noversion: u8, // a version beats none
88
+ ver: [3]f64, // negated, so HIGHEST version sorts first
89
+ priority: f64, // LOWEST priority first
90
+ pos: f64,
91
+ cand: *v.Value,
92
+ };
93
+
94
+ fn rankKey(c: *v.Value) RankKey {
95
+ const p = v.get(c, "provides");
96
+ const ver = v.get(p, "version");
97
+ var key = RankKey{
98
+ .noversion = if (v.isNull(ver)) 1 else 0,
99
+ .ver = .{ 0, 0, 0 },
100
+ .priority = if (v.isNum(v.get(p, "priority"))) v.asNum(v.get(p, "priority")) else 0,
101
+ .pos = v.asNum(v.get(c, "pos")),
102
+ .cand = c,
103
+ };
104
+ if (!v.isNull(ver)) {
105
+ if (version.parseversion(ver)) |parsed| {
106
+ var i: usize = 0;
107
+ while (i < 3) : (i += 1) key.ver[i] = -v.asNum(v.at(parsed, i));
108
+ } else |_| {
109
+ _ = t.take();
110
+ }
111
+ }
112
+ return key;
113
+ }
114
+
115
+ fn lessRank(_: void, a: RankKey, b: RankKey) bool {
116
+ if (a.noversion != b.noversion) return a.noversion < b.noversion;
117
+ var i: usize = 0;
118
+ while (i < 3) : (i += 1) {
119
+ if (a.ver[i] != b.ver[i]) return a.ver[i] < b.ver[i];
120
+ }
121
+ if (a.priority != b.priority) return a.priority < b.priority;
122
+ return a.pos < b.pos;
123
+ }
124
+
125
+ /// Rank the matching providers best-first: highest `version`, then
126
+ /// LOWEST `priority` (default 0), then declaration position `pos`
127
+ /// ascending. `candidates` is a list of {ref, pos, provides}.
128
+ pub fn resolvecapability(req: ?*v.Value, candidates: ?*v.Value) *v.Value {
129
+ var hits = v.List(RankKey).init(v.arena());
130
+ for (v.items(candidates)) |c| {
131
+ if (capmatches(req, v.get(c, "provides"))) hits.append(rankKey(c)) catch @panic("oom");
132
+ }
133
+ std.mem.sort(RankKey, hits.items, {}, lessRank);
134
+ const out = v.vlist();
135
+ for (hits.items) |h| v.push(out, h.cand);
136
+ return out;
137
+ }
@@ -0,0 +1,90 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (zig/src/catalog.zig)
2
+ // Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ //! The definition catalog (§10.1).
5
+ //!
6
+ //! A definition is registered once and may back many instances. Option
7
+ //! shapes are validated AT REGISTRATION, not when a document happens to
8
+ //! exercise a key — so a malformed shape fails once, and in the same
9
+ //! place everywhere (§9.4). `declare/shape` pins that timing.
10
+
11
+ const std = @import("std");
12
+ const v = @import("value.zig");
13
+ const t = @import("types.zig");
14
+ const cfg = @import("config.zig");
15
+ const ref = @import("ref.zig");
16
+
17
+ pub const Inst = @import("inst.zig").Inst;
18
+
19
+ /// A DEFINITION IS DATA WITH FUNCTIONS IN IT, not a class to extend. A
20
+ /// document could produce one, which is the property that makes a
21
+ /// catalog a data structure rather than a compile-time registry.
22
+ pub const LifecycleFn = *const fn (*Inst) t.Err!void;
23
+ pub const ReconfigureFn = *const fn (*Inst, ?*v.Value, ?*v.Value) t.Err!void;
24
+
25
+ pub const Definition = struct {
26
+ name: []const u8,
27
+ shape: ?*v.Value = null,
28
+ define: ?LifecycleFn = null,
29
+ activate: ?LifecycleFn = null,
30
+ deactivate: ?LifecycleFn = null,
31
+ close: ?LifecycleFn = null,
32
+ reconfigure: ?ReconfigureFn = null,
33
+ };
34
+
35
+ pub const Catalog = struct {
36
+ defs: v.List(*Definition),
37
+
38
+ pub fn add(c: *Catalog, def: *Definition) t.Err!void {
39
+ if (!ref.checkname(v.vstr(def.name))) {
40
+ return t.fail("plugin_definition_name", v.print("invalid definition name: {s}", .{def.name}), null);
41
+ }
42
+ // Validate the shape HERE. Deferring it to resolution time means
43
+ // a malformed shape surfaces at a different moment in every host
44
+ // that loads it, which is the divergence the stated domain
45
+ // exists to prevent.
46
+ if (!v.isNull(def.shape)) try cfg.checkshape(def.shape);
47
+
48
+ for (c.defs.items) |*e| {
49
+ if (std.mem.eql(u8, e.*.name, def.name)) {
50
+ e.* = def;
51
+ return;
52
+ }
53
+ }
54
+ c.defs.append(def) catch @panic("oom");
55
+ }
56
+
57
+ pub fn get(c: *Catalog, name: []const u8) ?*Definition {
58
+ for (c.defs.items) |d| {
59
+ if (std.mem.eql(u8, d.name, name)) return d;
60
+ }
61
+ return null;
62
+ }
63
+
64
+ pub fn has(c: *Catalog, name: []const u8) bool {
65
+ return c.get(name) != null;
66
+ }
67
+
68
+ pub fn names(c: *Catalog) *v.Value {
69
+ const m = v.vmap();
70
+ for (c.defs.items) |d| v.set(m, d.name, v.vbool(true));
71
+ const out = v.vlist();
72
+ for (v.sortedKeys(m)) |k| v.push(out, v.vstr(k));
73
+ return out;
74
+ }
75
+ };
76
+
77
+ pub fn makecatalog() *Catalog {
78
+ const c = v.arena().create(Catalog) catch @panic("oom");
79
+ c.* = .{ .defs = v.List(*Definition).init(v.arena()) };
80
+ return c;
81
+ }
82
+
83
+ /// The callback for a phase, by the name the log and the corpus use.
84
+ pub fn callbackFor(d: *Definition, at: []const u8) ?LifecycleFn {
85
+ if (std.mem.eql(u8, at, "define")) return d.define;
86
+ if (std.mem.eql(u8, at, "activate")) return d.activate;
87
+ if (std.mem.eql(u8, at, "deactivate")) return d.deactivate;
88
+ if (std.mem.eql(u8, at, "close")) return d.close;
89
+ return null;
90
+ }
@@ -0,0 +1,346 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (zig/src/config.zig)
2
+ // Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ //! The declarative document (§9): normalization, and the ten-level
5
+ //! precedence ladder.
6
+ //!
7
+ //! TWO FUNCTIONS, AND THE SPLIT BETWEEN THEM IS FORCED.
8
+ //!
9
+ //! `normalizeconfig` normalizes STRUCTURE and ENTRY KEYS. It does not
10
+ //! merge options, and cannot: §9.4 makes merge behaviour a property of
11
+ //! the definition's option SHAPE, which normalization has never seen. A
12
+ //! normalizer that flattened the option layers would make
13
+ //! `$MERGE: append` unimplementable at load time, because the layers it
14
+ //! must concatenate would already be collapsed.
15
+ //!
16
+ //! `resolveoptions` applies the ladder, and it is the only place that
17
+ //! knows the shape.
18
+
19
+ const std = @import("std");
20
+ const v = @import("value.zig");
21
+ const t = @import("types.zig");
22
+ const ref = @import("ref.zig");
23
+
24
+ /// §9.1: reservation is all-or-nothing per NAME, so the tagged forms go
25
+ /// too. A configuration surface that can disable the thing reading it is
26
+ /// not a surface, it is a trap.
27
+ fn checkreserved(r: []const u8, reserved: ?*v.Value) t.Err!void {
28
+ if (!v.isList(reserved) or v.len(reserved) == 0) return;
29
+ const name = ref.refname(r);
30
+ for (v.items(reserved)) |x| {
31
+ if (v.isStr(x) and std.mem.eql(u8, v.asStr(x), name)) {
32
+ return t.fail("plugin_ref_reserved", v.print("ref is reserved by the host: {s}", .{r}), t.details1("ref", v.vstr(r)));
33
+ }
34
+ }
35
+ }
36
+
37
+ const Entries = struct { map: *v.Value, order: *v.Value };
38
+
39
+ /// Both document forms reduce to {ref -> entry} plus the order the form
40
+ /// implies: array POSITION for the array form, sorted refs for the map
41
+ /// form.
42
+ fn entriesof(src: ?*v.Value) t.Err!Entries {
43
+ const out = Entries{ .map = v.vmap(), .order = v.vlist() };
44
+ if (v.isNull(src)) return out;
45
+
46
+ if (v.isList(src)) {
47
+ for (v.items(src)) |item| {
48
+ const r = try ref.canonref(v.get(item, "ref"));
49
+ v.set(out.map, r, item);
50
+ v.push(out.order, v.vstr(r));
51
+ }
52
+ return out;
53
+ }
54
+
55
+ // Map-form refs arrive as KEYS, through a different path than an
56
+ // array element's `ref` field — and must canonicalize the same way.
57
+ for (v.keys(src)) |k| {
58
+ v.set(out.map, try ref.canonrefs(k), v.get(src, k));
59
+ }
60
+ // Byte-wise, NOT locale-aware and NOT case-folded. All-lowercase
61
+ // refs sort identically under all three, so only mixed input
62
+ // discriminates: '@' is 0x40, uppercase 0x41-0x5A, lowercase
63
+ // 0x61-0x7A.
64
+ for (v.sortedKeys(out.map)) |k| v.push(out.order, v.vstr(k));
65
+ return out;
66
+ }
67
+
68
+ /// PRESENT WINS, EVEN WHEN THE VALUE IS NULL. The canonical is
69
+ /// `src && undefined !== src[key]`, and in JavaScript a key holding
70
+ /// `null` passes that test — so a profile's `order: null` clears a base
71
+ /// ordering block and `active: null` over a base `active: true` is
72
+ /// falsy, and barred. Testing for non-null instead treated an authored
73
+ /// null as an absent key, which is §9.1's distinction inverted.
74
+ fn pick(src: ?*v.Value, key: []const u8, dflt: ?*v.Value) ?*v.Value {
75
+ if (v.isMap(src) and v.has(src, key)) return v.get(src, key);
76
+ return dflt;
77
+ }
78
+
79
+ fn listhas(list: ?*v.Value, s: []const u8) bool {
80
+ for (v.items(list)) |x| {
81
+ if (v.isStr(x) and std.mem.eql(u8, v.asStr(x), s)) return true;
82
+ }
83
+ return false;
84
+ }
85
+
86
+ pub fn normalizeconfig(input: ?*v.Value) t.Err!*v.Value {
87
+ var doc = v.get(input, "doc");
88
+ if (!v.isMap(doc)) doc = v.vmap();
89
+ const keyspec = v.get(input, "keys");
90
+ const ikey = if (v.isStr(v.get(keyspec, "instance"))) v.asStr(v.get(keyspec, "instance")) else "instance";
91
+ const dkey = if (v.isStr(v.get(keyspec, "default"))) v.asStr(v.get(keyspec, "default")) else "default";
92
+ const reserved = v.get(input, "reserved");
93
+ const profile = v.get(input, "profile");
94
+
95
+ // The rename is applied at TWO PLACES AND NO OTHERS: the document
96
+ // root, and every profile.<name> overlay root (§9.1). A rename
97
+ // applied only at the root would leave `profile.prod.sdk`
98
+ // untranslated and silently drop every environment override the host
99
+ // depends on. Recursing further would be worse: option data is the
100
+ // definition's.
101
+ const baseinst = v.get(doc, ikey);
102
+ var basedef = v.get(doc, dkey);
103
+ if (!v.isMap(basedef)) basedef = v.vmap();
104
+
105
+ const overlay = if (v.isStr(profile)) v.get(v.get(doc, "profile"), v.asStr(profile)) else v.vnull();
106
+ const overinst = if (v.isMap(overlay)) v.get(overlay, ikey) else v.vnull();
107
+ var overdef = if (v.isMap(overlay)) v.get(overlay, dkey) else v.vnull();
108
+ if (!v.isMap(overdef)) overdef = v.vmap();
109
+
110
+ const base = try entriesof(baseinst);
111
+ const over = try entriesof(overinst);
112
+
113
+ for ([_]*v.Value{ base.map, over.map, basedef, overdef }) |m| {
114
+ for (v.keys(m)) |k| try checkreserved(k, reserved);
115
+ }
116
+
117
+ // A PARTIAL ARRAY IS NOT A FILTER (§9.1). sdkgen learned this the
118
+ // hard way: deriving order from a partial array silently dropped
119
+ // config-activated features. Refs in the base but absent from the
120
+ // overlay still load, in sorted position AFTER the listed ones. A
121
+ // profile may also INTRODUCE a ref the base never declared.
122
+ const order = v.vlist();
123
+ for (v.items(over.order)) |x| {
124
+ if (!listhas(order, v.asStr(x))) v.push(order, v.vstr(v.asStr(x)));
125
+ }
126
+ // The remainder keeps the BASE's own order — array position for the
127
+ // array form, sorted refs for the map form. Re-sorting here would
128
+ // discard an array document's positional order entirely, which is
129
+ // the one thing the array form exists to express.
130
+ for (v.items(base.order)) |x| {
131
+ if (!listhas(order, v.asStr(x))) v.push(order, v.vstr(v.asStr(x)));
132
+ }
133
+
134
+ const instance = v.vmap();
135
+ for (v.items(order), 0..) |rv, i| {
136
+ const r = v.asStr(rv);
137
+ const b = v.get(base.map, r);
138
+ const o = v.get(over.map, r);
139
+
140
+ // MERGE THE ENTRIES AS AUTHORED, THEN APPLY DEFAULTS TO THE
141
+ // RESULT (§9.3). A safety rule, not a tidiness one: if the
142
+ // overlay had its defaults filled in before merging it would
143
+ // carry a synthesized active:true and overwrite a base's false —
144
+ // silently re-enabling a deliberately disabled integration in
145
+ // production.
146
+ const active = pick(o, "active", pick(b, "active", v.vbool(true)));
147
+ const start = pick(o, "start", pick(b, "start", v.vstr("eager")));
148
+ const ord = pick(o, "order", pick(b, "order", null));
149
+
150
+ // Option layers, levels 3-6, IN LADDER ORDER. Never merged here.
151
+ const layers = v.vlist();
152
+ const nm = ref.refname(r);
153
+ for ([_]?*v.Value{ v.get(basedef, nm), b, v.get(overdef, nm), o }) |src| {
154
+ if (v.isMap(src) and v.has(src, "options")) v.push(layers, v.get(src, "options"));
155
+ }
156
+
157
+ const ent = v.vmap();
158
+ v.set(ent, "pos", v.vnum(@floatFromInt(i)));
159
+ v.set(ent, "active", active);
160
+ v.set(ent, "start", start);
161
+ v.set(ent, "optionlayers", layers);
162
+ if (ord != null) v.set(ent, "order", ord);
163
+ v.set(instance, r, ent);
164
+ }
165
+
166
+ // `default` DECLARES NOTHING (§9.3). It is a base for every instance
167
+ // of that definition; it does not create one, and an entry for a
168
+ // name with no instances is inert rather than an error — which is
169
+ // what makes a shared library of defaults shippable.
170
+ const defout = v.vmap();
171
+ for (v.keys(basedef)) |k| v.set(defout, k, v.get(basedef, k));
172
+ for (v.keys(overdef)) |k| v.set(defout, k, v.get(overdef, k));
173
+
174
+ const out = v.vmap();
175
+ v.set(out, "instance", instance);
176
+ v.set(out, "order", order);
177
+ v.set(out, "default", defout);
178
+ return out;
179
+ }
180
+
181
+ // ---------------------------------------------------------------------
182
+ // resolveoptions — §9.3's ten levels, and §9.4's merge directives
183
+ // ---------------------------------------------------------------------
184
+
185
+ /// §9.4: N is an integer of at least 1, and everything else is an error.
186
+ ///
187
+ /// `{"deep": 0}` is rejected DESPITE having an obvious reading, because
188
+ /// "replace at this key" already has a spelling and two spellings for
189
+ /// one behaviour is the defect class this repo exists to avoid. Without
190
+ /// the stated domain each port picks its own reading — reject, replace,
191
+ /// unlimited merge, or clamp to 1 — and the same document resolves
192
+ /// differently per language.
193
+ pub fn checkshape(shape: ?*v.Value) t.Err!void {
194
+ if (!v.isMap(shape)) return;
195
+ for (v.keys(shape)) |k| {
196
+ const x = v.get(shape, k);
197
+ if (!v.isMap(x) or !v.has(x, "$MERGE")) continue;
198
+ const d = v.get(x, "$MERGE");
199
+
200
+ if (v.isStr(d)) {
201
+ const w = v.asStr(d);
202
+ if (std.mem.eql(u8, w, "replace") or std.mem.eql(u8, w, "append")) continue;
203
+ return t.fail("plugin_shape_invalid", v.print("invalid $MERGE directive at {s}: {s}", .{ k, w }), t.details2("key", v.vstr(k), "directive", d));
204
+ }
205
+
206
+ if (v.isMap(d) and v.has(d, "deep")) {
207
+ const nv = v.get(d, "deep");
208
+ const x2 = v.asNum(nv);
209
+ if (!v.isNum(nv) or x2 != @trunc(x2) or x2 < 1) {
210
+ return t.fail("plugin_shape_invalid", v.print("invalid $MERGE deep at {s}: {s}", .{ k, v.json(nv) }), t.details2("key", v.vstr(k), "directive", d));
211
+ }
212
+ continue;
213
+ }
214
+
215
+ return t.fail("plugin_shape_invalid", v.print("invalid $MERGE directive at {s}: {s}", .{ k, v.json(d) }), t.details2("key", v.vstr(k), "directive", d));
216
+ }
217
+ }
218
+
219
+ /// The shape's non-directive values are the level-1 defaults.
220
+ fn defaultsof(shape: ?*v.Value) *v.Value {
221
+ const out = v.vmap();
222
+ if (!v.isMap(shape)) return out;
223
+ for (v.keys(shape)) |k| {
224
+ const x = v.get(shape, k);
225
+ if (v.isMap(x) and v.has(x, "$MERGE")) continue;
226
+ v.set(out, k, x);
227
+ }
228
+ return out;
229
+ }
230
+
231
+ fn optsof(src: ?*v.Value, key: []const u8) t.Err!?*v.Value {
232
+ if (v.isNull(src)) return null;
233
+ // The array form is equivalent to the map form (§9.1).
234
+ if (v.isList(src)) {
235
+ for (v.items(src)) |item| {
236
+ if (std.mem.eql(u8, try ref.canonref(v.get(item, "ref")), key)) {
237
+ return if (v.has(item, "options")) v.get(item, "options") else null;
238
+ }
239
+ }
240
+ return null;
241
+ }
242
+ for (v.keys(src)) |k| {
243
+ if (std.mem.eql(u8, try ref.canonrefs(k), key)) {
244
+ const e = v.get(src, k);
245
+ return if (v.has(e, "options")) v.get(e, "options") else null;
246
+ }
247
+ }
248
+ return null;
249
+ }
250
+
251
+ /// Merge N levels below this key, replace below that.
252
+ fn deepto(base: ?*v.Value, over: ?*v.Value, n: i64) ?*v.Value {
253
+ if (n <= 0) return v.clone(over);
254
+ if (!v.isMap(base) or !v.isMap(over)) return v.clone(over);
255
+ const out = v.vmap();
256
+ for (v.keys(base)) |k| v.set(out, k, v.get(base, k));
257
+ for (v.keys(over)) |k| v.set(out, k, deepto(v.get(out, k), v.get(over, k), n - 1));
258
+ return out;
259
+ }
260
+
261
+ /// Merge ONE layer onto the accumulator, honouring the shape's
262
+ /// directives. The directive holds at EVERY precedence level, not only
263
+ /// between document levels — §9.4 makes it a property of the shape,
264
+ /// which does not know which layer a value arrived from.
265
+ fn mergeone(base: ?*v.Value, over: ?*v.Value, shape: ?*v.Value) ?*v.Value {
266
+ if (v.isNull(over)) return base;
267
+ if (!v.isMap(base) or !v.isMap(over)) return v.clone(over);
268
+
269
+ const out = v.vmap();
270
+ for (v.keys(base)) |k| v.set(out, k, v.get(base, k));
271
+
272
+ for (v.keys(over)) |k| {
273
+ const entry = if (v.isMap(shape)) v.get(shape, k) else v.vnull();
274
+ const directive = if (v.isMap(entry)) v.get(entry, "$MERGE") else v.vnull();
275
+ const b = v.get(out, k);
276
+ const o = v.get(over, k);
277
+
278
+ if (v.isStr(directive) and std.mem.eql(u8, v.asStr(directive), "replace")) {
279
+ v.set(out, k, v.clone(o));
280
+ } else if (v.isStr(directive) and std.mem.eql(u8, v.asStr(directive), "append")) {
281
+ const merged = v.vlist();
282
+ if (v.isList(b)) {
283
+ for (v.items(b)) |x| v.push(merged, x);
284
+ }
285
+ if (v.isList(o)) {
286
+ for (v.items(o)) |x| v.push(merged, x);
287
+ } else {
288
+ v.push(merged, o);
289
+ }
290
+ v.set(out, k, merged);
291
+ } else if (v.isMap(directive) and v.has(directive, "deep")) {
292
+ v.set(out, k, deepto(b, o, @intFromFloat(v.asNum(v.get(directive, "deep")))));
293
+ } else if (v.isMap(b) and v.isMap(o)) {
294
+ // Library default: deep for maps, REPLACE for lists.
295
+ // struct.merge is element-wise by index, which for option
296
+ // maps is nearly always wrong — ["a"] over ["x","y","z"]
297
+ // yielding ["a","y","z"] is the defect station hit on
298
+ // secrets.providers.
299
+ v.set(out, k, mergeone(b, o, null));
300
+ } else {
301
+ v.set(out, k, v.clone(o));
302
+ }
303
+ }
304
+ return out;
305
+ }
306
+
307
+ pub fn resolveoptions(input: ?*v.Value) t.Err!*v.Value {
308
+ var shape = v.get(input, "shape");
309
+ if (!v.isMap(shape)) shape = v.vmap();
310
+ try checkshape(shape);
311
+
312
+ const r = try ref.canonref(v.get(input, "ref"));
313
+ const name = ref.refname(r);
314
+ var doc = v.get(input, "doc");
315
+ if (!v.isMap(doc)) doc = v.vmap();
316
+
317
+ const profile = v.get(input, "profile");
318
+ const overlay = if (v.isStr(profile)) v.get(v.get(doc, "profile"), v.asStr(profile)) else v.vnull();
319
+ const overdefault = if (v.isMap(overlay)) v.get(overlay, "default") else v.vnull();
320
+ const overinstance = if (v.isMap(overlay)) v.get(overlay, "instance") else v.vnull();
321
+
322
+ // ONE ordered merge, lowest to highest. Levels 3-6 are not two
323
+ // namespaces collapsed separately and composed afterwards: that
324
+ // inverts the rule that PROFILE SPECIFICITY OUTRANKS DEFINITION
325
+ // SPECIFICITY, so a prod per-definition default would lose to a base
326
+ // instance value.
327
+ const layers = [_]?*v.Value{
328
+ defaultsof(shape), // 1
329
+ v.get(input, "hostdefaults"), // 2
330
+ try optsof(v.get(doc, "default"), name), // 3
331
+ try optsof(v.get(doc, "instance"), r), // 4
332
+ try optsof(overdefault, name), // 5
333
+ try optsof(overinstance, r), // 6
334
+ v.get(input, "env"), // 7
335
+ v.get(input, "hostoptions"), // 8
336
+ v.get(input, "loadoptions"), // 9
337
+ v.get(input, "patch"), // 10
338
+ };
339
+
340
+ var out: ?*v.Value = v.vmap();
341
+ for (layers) |layer| {
342
+ if (v.isNull(layer)) continue;
343
+ out = mergeone(out, layer, shape);
344
+ }
345
+ return out.?;
346
+ }