@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,376 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/config.cpp)
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
+ #include "config.hpp"
20
+
21
+ #include <algorithm>
22
+
23
+ #include "ref.hpp"
24
+
25
+ namespace plugin {
26
+
27
+ /* §9.1: reservation is all-or-nothing per NAME, so the tagged forms go
28
+ * too. A configuration surface that can disable the thing reading it is
29
+ * not a surface, it is a trap. */
30
+ static void checkreserved(const std::string& ref, const V& reserved) {
31
+ if (!islist(reserved) || 0 == len(reserved)) return;
32
+ const std::string name = refname(ref);
33
+ for (size_t i = 0; i < len(reserved); i++) {
34
+ if (isstr(at(reserved, i)) && asstr(at(reserved, i)) == name) {
35
+ fail("plugin_ref_reserved", "ref is reserved by the host: " + ref,
36
+ details1("ref", vstr(ref)));
37
+ }
38
+ }
39
+ }
40
+
41
+ /* Both document forms reduce to {ref -> entry} plus the order the form
42
+ * implies: array POSITION for the array form, sorted refs for the map
43
+ * form. */
44
+ struct Entries {
45
+ V map = vmap();
46
+ V order = vlist();
47
+ };
48
+
49
+ static Entries entriesof(const V& src) {
50
+ Entries out;
51
+ if (isnull(src)) return out;
52
+
53
+ if (islist(src)) {
54
+ for (size_t i = 0; i < len(src); i++) {
55
+ V item = at(src, i);
56
+ const std::string ref = canonref(get(item, "ref"));
57
+ set(out.map, ref, item);
58
+ push(out.order, vstr(ref));
59
+ }
60
+ return out;
61
+ }
62
+
63
+ /* Map-form refs arrive as KEYS, through a different path than an
64
+ * array element's `ref` field — and must canonicalize the same way. */
65
+ for (const auto& k : keys(src)) {
66
+ set(out.map, canonref(vstr(k)), get(src, k));
67
+ }
68
+ /* Byte-wise, NOT locale-aware and NOT case-folded. All-lowercase refs
69
+ * sort identically under all three, so only mixed input
70
+ * discriminates: '@' is 0x40, uppercase 0x41-0x5A, lowercase
71
+ * 0x61-0x7A. */
72
+ for (const auto& k : sortedkeys(out.map)) push(out.order, vstr(k));
73
+ return out;
74
+ }
75
+
76
+ /* PRESENT WINS, EVEN WHEN THE VALUE IS NULL. The canonical is
77
+ * `src && undefined !== src[key]`, and in JavaScript a key holding
78
+ * `null` passes that test — so a profile's `order: null` clears a base
79
+ * ordering block and `active: null` over a base `active: true` is
80
+ * falsy, and barred. Testing for non-null instead treated an authored
81
+ * null as an absent key, which is §9.1's distinction inverted. */
82
+ static V pick(const V& src, const std::string& key, const V& dflt) {
83
+ if (ismap(src) && has(src, key)) return get(src, key);
84
+ return dflt;
85
+ }
86
+
87
+ static bool listhas(const V& list, const std::string& s) {
88
+ for (size_t i = 0; i < len(list); i++) {
89
+ if (isstr(at(list, i)) && asstr(at(list, i)) == s) return true;
90
+ }
91
+ return false;
92
+ }
93
+
94
+ V normalizeconfig(const V& input) {
95
+ V doc = get(input, "doc");
96
+ if (!ismap(doc)) doc = vmap();
97
+ V keyspec = get(input, "keys");
98
+ const std::string ikey =
99
+ isstr(get(keyspec, "instance")) ? asstr(get(keyspec, "instance")) : "instance";
100
+ const std::string dkey =
101
+ isstr(get(keyspec, "default")) ? asstr(get(keyspec, "default")) : "default";
102
+ V reserved = get(input, "reserved");
103
+ V profile = get(input, "profile");
104
+
105
+ /* The rename is applied at TWO PLACES AND NO OTHERS: the document
106
+ * root, and every profile.<name> overlay root (§9.1). A rename applied
107
+ * only at the root would leave `profile.prod.sdk` untranslated and
108
+ * silently drop every environment override the host depends on.
109
+ * Recursing further would be worse: option data is the definition's. */
110
+ V baseinst = get(doc, ikey);
111
+ V basedef = get(doc, dkey);
112
+ if (!ismap(basedef)) basedef = vmap();
113
+
114
+ V overlay = nullptr;
115
+ if (isstr(profile)) {
116
+ overlay = get(get(doc, "profile"), asstr(profile));
117
+ }
118
+ V overinst = ismap(overlay) ? get(overlay, ikey) : nullptr;
119
+ V overdef = ismap(overlay) ? get(overlay, dkey) : nullptr;
120
+ if (!ismap(overdef)) overdef = vmap();
121
+
122
+ Entries base = entriesof(baseinst);
123
+ Entries over = entriesof(overinst);
124
+
125
+ for (const auto& k : keys(base.map)) checkreserved(k, reserved);
126
+ for (const auto& k : keys(over.map)) checkreserved(k, reserved);
127
+ for (const auto& k : keys(basedef)) checkreserved(k, reserved);
128
+ for (const auto& k : keys(overdef)) checkreserved(k, reserved);
129
+
130
+ /* A PARTIAL ARRAY IS NOT A FILTER (§9.1). sdkgen learned this the hard
131
+ * way: deriving order from a partial array silently dropped
132
+ * config-activated features. Refs in the base but absent from the
133
+ * overlay still load, in sorted position AFTER the listed ones. A
134
+ * profile may also INTRODUCE a ref the base never declared. */
135
+ V order = vlist();
136
+ for (size_t i = 0; i < len(over.order); i++) {
137
+ const std::string r = asstr(at(over.order, i));
138
+ if (!listhas(order, r)) push(order, vstr(r));
139
+ }
140
+ /* The remainder keeps the BASE's own order — array position for the
141
+ * array form, sorted refs for the map form. Re-sorting here would
142
+ * discard an array document's positional order entirely, which is the
143
+ * one thing the array form exists to express. */
144
+ for (size_t i = 0; i < len(base.order); i++) {
145
+ const std::string r = asstr(at(base.order, i));
146
+ if (!listhas(order, r)) push(order, vstr(r));
147
+ }
148
+
149
+ V instance = vmap();
150
+ for (size_t i = 0; i < len(order); i++) {
151
+ const std::string ref = asstr(at(order, i));
152
+ V b = get(base.map, ref);
153
+ V o = get(over.map, ref);
154
+
155
+ /* MERGE THE ENTRIES AS AUTHORED, THEN APPLY DEFAULTS TO THE RESULT
156
+ * (§9.3). A safety rule, not a tidiness one: if the overlay had its
157
+ * defaults filled in before merging it would carry a synthesized
158
+ * active:true and overwrite a base's false — silently re-enabling a
159
+ * deliberately disabled integration in production. */
160
+ V active = pick(o, "active", pick(b, "active", vbool(true)));
161
+ V start = pick(o, "start", pick(b, "start", vstr("eager")));
162
+ V ord = pick(o, "order", pick(b, "order", nullptr));
163
+
164
+ /* Option layers, levels 3-6, IN LADDER ORDER. Never merged here. */
165
+ V layers = vlist();
166
+ const std::string nm = refname(ref);
167
+ V bd = get(basedef, nm);
168
+ if (ismap(bd) && has(bd, "options")) push(layers, get(bd, "options"));
169
+ if (ismap(b) && has(b, "options")) push(layers, get(b, "options"));
170
+ V od = get(overdef, nm);
171
+ if (ismap(od) && has(od, "options")) push(layers, get(od, "options"));
172
+ if (ismap(o) && has(o, "options")) push(layers, get(o, "options"));
173
+
174
+ V ent = vmap();
175
+ set(ent, "pos", vnum(static_cast<double>(i)));
176
+ set(ent, "active", active);
177
+ set(ent, "start", start);
178
+ set(ent, "optionlayers", layers);
179
+ if (ord) set(ent, "order", ord);
180
+ set(instance, ref, ent);
181
+ }
182
+
183
+ /* `default` DECLARES NOTHING (§9.3). It is a base for every instance
184
+ * of that definition; it does not create one, and an entry for a name
185
+ * with no instances is inert rather than an error — which is what
186
+ * makes a shared library of defaults shippable. */
187
+ V defout = vmap();
188
+ for (const auto& k : keys(basedef)) set(defout, k, get(basedef, k));
189
+ for (const auto& k : keys(overdef)) set(defout, k, get(overdef, k));
190
+
191
+ V out = vmap();
192
+ set(out, "instance", instance);
193
+ set(out, "order", order);
194
+ set(out, "default", defout);
195
+ return out;
196
+ }
197
+
198
+ /* ------------------------------------------------------------------ */
199
+ /* resolveoptions — §9.3's ten levels, and §9.4's merge directives */
200
+ /* ------------------------------------------------------------------ */
201
+
202
+ /* §9.4: N is an integer of at least 1, and everything else is an error.
203
+ *
204
+ * `{"deep": 0}` is rejected DESPITE having an obvious reading, because
205
+ * "replace at this key" already has a spelling and two spellings for one
206
+ * behaviour is the defect class this repo exists to avoid. Without the
207
+ * stated domain each port picks its own reading — reject, replace,
208
+ * unlimited merge, or clamp to 1 — and the same document resolves
209
+ * differently per language. */
210
+ void checkshape(const V& shape) {
211
+ if (!ismap(shape)) return;
212
+ for (const auto& k : keys(shape)) {
213
+ V v = get(shape, k);
214
+ if (!ismap(v) || !has(v, "$MERGE")) continue;
215
+ V d = get(v, "$MERGE");
216
+
217
+ if (isstr(d)) {
218
+ const std::string w = asstr(d);
219
+ if ("replace" == w || "append" == w) continue;
220
+ fail("plugin_shape_invalid", "invalid $MERGE directive at " + k + ": " + w,
221
+ details2("key", vstr(k), "directive", d));
222
+ }
223
+
224
+ if (ismap(d) && has(d, "deep")) {
225
+ V nv = get(d, "deep");
226
+ double x = asnum(nv);
227
+ if (!isnum(nv) || x != static_cast<double>(static_cast<long long>(x)) ||
228
+ 1 > x) {
229
+ fail("plugin_shape_invalid",
230
+ "invalid $MERGE deep at " + k + ": " + json(nv),
231
+ details2("key", vstr(k), "directive", d));
232
+ }
233
+ continue;
234
+ }
235
+
236
+ fail("plugin_shape_invalid",
237
+ "invalid $MERGE directive at " + k + ": " + json(d),
238
+ details2("key", vstr(k), "directive", d));
239
+ }
240
+ }
241
+
242
+ /* The shape's non-directive values are the level-1 defaults. */
243
+ static V defaultsof(const V& shape) {
244
+ V out = vmap();
245
+ if (!ismap(shape)) return out;
246
+ for (const auto& k : keys(shape)) {
247
+ V v = get(shape, k);
248
+ if (ismap(v) && has(v, "$MERGE")) continue;
249
+ set(out, k, v);
250
+ }
251
+ return out;
252
+ }
253
+
254
+ static V optsof(const V& src, const std::string& key) {
255
+ if (isnull(src)) return nullptr;
256
+ /* The array form is equivalent to the map form (§9.1). */
257
+ if (islist(src)) {
258
+ for (size_t i = 0; i < len(src); i++) {
259
+ V item = at(src, i);
260
+ if (canonref(get(item, "ref")) == key) {
261
+ return has(item, "options") ? get(item, "options") : nullptr;
262
+ }
263
+ }
264
+ return nullptr;
265
+ }
266
+ for (const auto& k : keys(src)) {
267
+ if (canonref(vstr(k)) == key) {
268
+ V e = get(src, k);
269
+ return has(e, "options") ? get(e, "options") : nullptr;
270
+ }
271
+ }
272
+ return nullptr;
273
+ }
274
+
275
+ /* Merge N levels below this key, replace below that. */
276
+ static V deepto(const V& base, const V& over, long n) {
277
+ if (0 >= n) return clone(over);
278
+ if (!ismap(base) || !ismap(over)) return clone(over);
279
+ V out = vmap();
280
+ for (const auto& k : keys(base)) set(out, k, get(base, k));
281
+ for (const auto& k : keys(over)) {
282
+ set(out, k, deepto(get(out, k), get(over, k), n - 1));
283
+ }
284
+ return out;
285
+ }
286
+
287
+ /* Merge ONE layer onto the accumulator, honouring the shape's
288
+ * directives. The directive holds at EVERY precedence level, not only
289
+ * between document levels — §9.4 makes it a property of the shape,
290
+ * which does not know which layer a value arrived from. */
291
+ static V mergeone(const V& base, const V& over, const V& shape) {
292
+ if (isnull(over)) return base;
293
+ if (!ismap(base) || !ismap(over)) return clone(over);
294
+
295
+ V out = vmap();
296
+ for (const auto& k : keys(base)) set(out, k, get(base, k));
297
+
298
+ for (const auto& k : keys(over)) {
299
+ V entry = ismap(shape) ? get(shape, k) : nullptr;
300
+ V directive = ismap(entry) ? get(entry, "$MERGE") : nullptr;
301
+ V b = get(out, k);
302
+ V o = get(over, k);
303
+
304
+ if (isstr(directive) && "replace" == asstr(directive)) {
305
+ set(out, k, clone(o));
306
+ }
307
+ else if (isstr(directive) && "append" == asstr(directive)) {
308
+ V merged = vlist();
309
+ if (islist(b)) {
310
+ for (size_t j = 0; j < len(b); j++) push(merged, at(b, j));
311
+ }
312
+ if (islist(o)) {
313
+ for (size_t j = 0; j < len(o); j++) push(merged, at(o, j));
314
+ }
315
+ else {
316
+ push(merged, o);
317
+ }
318
+ set(out, k, merged);
319
+ }
320
+ else if (ismap(directive) && has(directive, "deep")) {
321
+ set(out, k,
322
+ deepto(b, o, static_cast<long>(asnum(get(directive, "deep")))));
323
+ }
324
+ else {
325
+ /* Library default: deep for maps, REPLACE for lists. struct.merge
326
+ * is element-wise by index, which for option maps is nearly always
327
+ * wrong — ["a"] over ["x","y","z"] yielding ["a","y","z"] is the
328
+ * defect station hit on secrets.providers. */
329
+ if (ismap(b) && ismap(o)) set(out, k, mergeone(b, o, nullptr));
330
+ else set(out, k, clone(o));
331
+ }
332
+ }
333
+ return out;
334
+ }
335
+
336
+ V resolveoptions(const V& input) {
337
+ V shape = get(input, "shape");
338
+ if (!ismap(shape)) shape = vmap();
339
+ checkshape(shape);
340
+
341
+ const std::string ref = canonref(get(input, "ref"));
342
+ const std::string name = refname(ref);
343
+ V doc = get(input, "doc");
344
+ if (!ismap(doc)) doc = vmap();
345
+
346
+ V profile = get(input, "profile");
347
+ V overlay = nullptr;
348
+ if (isstr(profile)) overlay = get(get(doc, "profile"), asstr(profile));
349
+
350
+ /* ONE ordered merge, lowest to highest. Levels 3-6 are not two
351
+ * namespaces collapsed separately and composed afterwards: that
352
+ * inverts the rule that PROFILE SPECIFICITY OUTRANKS DEFINITION
353
+ * SPECIFICITY, so a prod per-definition default would lose to a base
354
+ * instance value. */
355
+ const V layers[10] = {
356
+ defaultsof(shape), /* 1 */
357
+ get(input, "hostdefaults"), /* 2 */
358
+ optsof(get(doc, "default"), name), /* 3 */
359
+ optsof(get(doc, "instance"), ref), /* 4 */
360
+ optsof(ismap(overlay) ? get(overlay, "default") : nullptr, name), /* 5 */
361
+ optsof(ismap(overlay) ? get(overlay, "instance") : nullptr, ref), /* 6 */
362
+ get(input, "env"), /* 7 */
363
+ get(input, "hostoptions"), /* 8 */
364
+ get(input, "loadoptions"), /* 9 */
365
+ get(input, "patch"), /* 10 */
366
+ };
367
+
368
+ V out = vmap();
369
+ for (const auto& layer : layers) {
370
+ if (isnull(layer)) continue;
371
+ out = mergeone(out, layer, shape);
372
+ }
373
+ return out;
374
+ }
375
+
376
+ } // namespace plugin
@@ -0,0 +1,29 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/config.hpp)
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. See config.cpp for why the two functions are
6
+ * split. */
7
+
8
+ #ifndef VOXGIG_PLUGIN_CONFIG_HPP
9
+ #define VOXGIG_PLUGIN_CONFIG_HPP
10
+
11
+ #include "types.hpp"
12
+ #include "value.hpp"
13
+
14
+ namespace plugin {
15
+
16
+ /* {instance: {ref -> entry}, order: [ref], default: {name -> entry}} */
17
+ V normalizeconfig(const V& input);
18
+
19
+ /* §9.3's ten levels, and §9.4's merge directives. */
20
+ V resolveoptions(const V& input);
21
+
22
+ /* §9.4: validated WHEN THE SHAPE ENTERS THE CATALOG, not when a
23
+ * document exercises the key — so a malformed shape fails once, and in
24
+ * the same place everywhere. `declare/shape` pins the timing. */
25
+ void checkshape(const V& shape);
26
+
27
+ } // namespace plugin
28
+
29
+ #endif
@@ -0,0 +1,230 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/depend.cpp)
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
+ /* Dependency cardinality, policy, and the restart graph (§11.3).
5
+ *
6
+ * TWO AXES, BOTH DECLARED BY THE DEFINITION THAT HAS THE REQUIREMENT,
7
+ * because only it knows what it can cope with:
8
+ *
9
+ * | static (default) | dynamic
10
+ * -------------|---------------------------|--------------------------
11
+ * mandatory | unmet -> pending; | unmet -> pending;
12
+ * (default) | lost -> pending, | lost -> STAYS LIVE,
13
+ * | recursively | notified
14
+ * -------------|---------------------------|--------------------------
15
+ * optional:true| never gates activation; | never gates activation;
16
+ * | a change deactivates and | a change is a
17
+ * | reactivates | notification, nothing else
18
+ *
19
+ * `dynamic` means the plugin has said, IN WRITING, that it can survive
20
+ * its provider being swapped underneath it. It is not the default
21
+ * because most plugins cannot, and the cost of wrongly assuming they
22
+ * can is a live instance holding a dead reference. */
23
+
24
+ #include "depend.hpp"
25
+
26
+ #include <algorithm>
27
+
28
+ #include "ref.hpp"
29
+
30
+ namespace plugin {
31
+
32
+ /* A bare string is shorthand for `{name}`. */
33
+ V normrequire(const V& r) {
34
+ if (isstr(r)) {
35
+ V out = vmap();
36
+ set(out, "name", r);
37
+ return out;
38
+ }
39
+ return ismap(r) ? r : vmap();
40
+ }
41
+
42
+ /* BOTH AXES ARE READ AT TWO LEVELS, AND THE PER-REQUIREMENT ONE WINS.
43
+ *
44
+ * The instance-level `policy` and `optional` list are how a DOCUMENT
45
+ * states the axis without editing the definition, and they apply to
46
+ * every requirement. The per-requirement form is strictly more
47
+ * expressive: an instance that is `static` on its store and `dynamic`
48
+ * on its metrics cannot be written at all at the instance level, and
49
+ * that is the ordinary case rather than an exotic one.
50
+ *
51
+ * `optional` UNIONS rather than overriding — both spellings say this
52
+ * requirement need not gate activation, and there is no reading under
53
+ * which one of them means "actually, mandatory". */
54
+ V requirements(const V& options) {
55
+ V raw = get(options, "requires");
56
+ V marked = get(options, "optional");
57
+ V fallback = get(options, "policy");
58
+
59
+ V out = vlist();
60
+ for (size_t i = 0; i < len(raw); i++) {
61
+ V r = normrequire(at(raw, i));
62
+ V o = vmap();
63
+ for (const auto& k : keys(r)) set(o, k, get(r, k));
64
+
65
+ bool opt = truthy(get(r, "optional"));
66
+ if (!opt && islist(marked)) {
67
+ for (size_t j = 0; j < len(marked); j++) {
68
+ if (same(at(marked, j), get(r, "name"))) { opt = true; break; }
69
+ }
70
+ }
71
+ if (opt) set(o, "optional", vbool(true));
72
+
73
+ if (isnull(get(o, "policy")) && !isnull(fallback)) set(o, "policy", fallback);
74
+ push(out, o);
75
+ }
76
+ return out;
77
+ }
78
+
79
+ /* Does losing this requirement's SELECTED provider restart the
80
+ * consumer? The mandatory ones under `static`, and the `static`
81
+ * optional ones — both make a capability change deactivate and
82
+ * reactivate. `dynamic` never restarts. */
83
+ bool restartsonloss(const V& r) {
84
+ V p = get(r, "policy");
85
+ const std::string policy = isstr(p) ? asstr(p) : "static";
86
+ return "dynamic" != policy;
87
+ }
88
+
89
+ /* Does an unmet requirement keep the consumer out of `live`?
90
+ *
91
+ * CARDINALITY ALONE DECIDES THIS, NOT POLICY. `dynamic` is a statement
92
+ * about surviving a SWAP, not about starting without the thing at all —
93
+ * a mandatory-dynamic consumer still waits in `pending` for its first
94
+ * provider. Conflating the two would let a plugin that declared it can
95
+ * cope with replacement activate with nothing to call. */
96
+ bool gatesactivation(const V& r) { return true != asbool(get(r, "optional")); }
97
+
98
+ /* Edges that can cause a restart, which is exactly the set a cycle must
99
+ * be detected over (§11.3): the mandatory requirements AND THE `static`
100
+ * OPTIONAL ONES, because both make a capability change deactivate and
101
+ * reactivate the consumer — and a cycle of restarts does not settle.
102
+ *
103
+ * ONLY `dynamic` OPTIONAL EDGES ARE EXCLUDED, and they are the ones the
104
+ * exclusion was for. An earlier draft of §11.3 excluded EVERY optional
105
+ * edge and thereby admitted the non-terminating case it was trying to
106
+ * permit. */
107
+ bool restartcausing(const V& r) {
108
+ return gatesactivation(r) || restartsonloss(r);
109
+ }
110
+
111
+ V dependencycycle(const V& nodes) {
112
+ /* TWO INDEXES, NOT ONE MERGED MAP. Capability names and refs are
113
+ * matched differently — a capability by its exact name, a ref through
114
+ * the canonical spelling (§4 rule 5) — and one map keyed by both can
115
+ * only do one of them. Keyed by both and looked up raw, a cycle
116
+ * spelled `a$`/`b$` finds no providers and EVADES the load-time check
117
+ * that exists to catch a non-terminating reconcile. */
118
+ V bycap = vmap();
119
+ V isref = vmap();
120
+ for (size_t i = 0; i < len(nodes); i++) {
121
+ V n = at(nodes, i);
122
+ const std::string nref = asstr(get(n, "ref"));
123
+ set(isref, nref, vbool(true));
124
+ V provides = get(n, "provides");
125
+ for (size_t j = 0; j < len(provides); j++) {
126
+ const std::string cap = asstr(at(provides, j));
127
+ V l = get(bycap, cap);
128
+ if (isnull(l)) { l = vlist(); set(bycap, cap, l); }
129
+ push(l, vstr(nref));
130
+ }
131
+ }
132
+
133
+ V edges = vmap();
134
+ for (size_t i = 0; i < len(nodes); i++) {
135
+ V n = at(nodes, i);
136
+ const std::string nref = asstr(get(n, "ref"));
137
+ std::vector<std::string> out;
138
+ V reqs = get(n, "requires");
139
+ for (size_t j = 0; j < len(reqs); j++) {
140
+ V r = at(reqs, j);
141
+ if (!restartcausing(r)) continue;
142
+ const std::string rname = asstr(get(r, "name"));
143
+ std::vector<std::string> from;
144
+ V caps = get(bycap, rname);
145
+ for (size_t k = 0; k < len(caps); k++) from.push_back(asstr(at(caps, k)));
146
+ /* A node satisfies its own name AS A REF (§11.1), canonically —
147
+ * exactly what `providersof` does at runtime, so the load-time
148
+ * graph and the running one agree about what an edge is. */
149
+ std::string asref;
150
+ if (tryref(rname, asref) && has(isref, asref) &&
151
+ from.end() == std::find(from.begin(), from.end(), asref)) {
152
+ from.push_back(asref);
153
+ }
154
+ for (const auto& p : from) {
155
+ if (p != nref && out.end() == std::find(out.begin(), out.end(), p)) {
156
+ out.push_back(p);
157
+ }
158
+ }
159
+ }
160
+ std::sort(out.begin(), out.end());
161
+ V sorted = vlist();
162
+ for (const auto& p : out) push(sorted, vstr(p));
163
+ set(edges, nref, sorted);
164
+ }
165
+
166
+ /* Iterative DFS with an explicit stack: twenty ports, and several of
167
+ * them have no recursion budget worth relying on. */
168
+ enum { WHITE = 0, GREY = 1, BLACK = 2 };
169
+ V colour = vmap();
170
+ for (size_t i = 0; i < len(nodes); i++) {
171
+ set(colour, asstr(get(at(nodes, i), "ref")), vnum(WHITE));
172
+ }
173
+
174
+ for (const auto& start : sortedkeys(edges)) {
175
+ if (WHITE != static_cast<int>(asnum(get(colour, start)))) continue;
176
+
177
+ std::vector<std::string> path{start};
178
+ std::vector<std::pair<std::string, size_t>> stack{{start, 0}};
179
+ set(colour, start, vnum(GREY));
180
+
181
+ while (!stack.empty()) {
182
+ auto& top = stack.back();
183
+ V tos = get(edges, top.first);
184
+
185
+ if (top.second >= len(tos)) {
186
+ set(colour, top.first, vnum(BLACK));
187
+ stack.pop_back();
188
+ path.pop_back();
189
+ continue;
190
+ }
191
+
192
+ const std::string next = asstr(at(tos, top.second));
193
+ top.second++;
194
+ int c = static_cast<int>(asnum(get(colour, next)));
195
+
196
+ if (GREY == c) {
197
+ /* Report the cycle itself, not the walk that found it. */
198
+ V cycle = vlist();
199
+ bool started = false;
200
+ for (const auto& p : path) {
201
+ if (!started && p == next) started = true;
202
+ if (started) push(cycle, vstr(p));
203
+ }
204
+ push(cycle, vstr(next));
205
+ return cycle;
206
+ }
207
+ if (BLACK == c) continue;
208
+
209
+ set(colour, next, vnum(GREY));
210
+ path.push_back(next);
211
+ stack.push_back({next, 0});
212
+ }
213
+ }
214
+
215
+ return nullptr;
216
+ }
217
+
218
+ void checkcycle(const V& nodes) {
219
+ V cycle = dependencycycle(nodes);
220
+ if (!cycle) return;
221
+ std::string names;
222
+ for (size_t i = 0; i < len(cycle); i++) {
223
+ if (0 < i) names += " -> ";
224
+ names += asstr(at(cycle, i));
225
+ }
226
+ fail("plugin_dependency_cycle", "requirements cycle: " + names,
227
+ details1("cycle", cycle));
228
+ }
229
+
230
+ } // namespace plugin
@@ -0,0 +1,31 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/depend.hpp)
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
+ /* Dependency cardinality, policy, and the restart graph (§11.3). Two
5
+ * axes, both declared by the definition that has the requirement,
6
+ * because only it knows what it can cope with. See depend.cpp. */
7
+
8
+ #ifndef VOXGIG_PLUGIN_DEPEND_HPP
9
+ #define VOXGIG_PLUGIN_DEPEND_HPP
10
+
11
+ #include "types.hpp"
12
+ #include "value.hpp"
13
+
14
+ namespace plugin {
15
+
16
+ V normrequire(const V& r);
17
+ V requirements(const V& options);
18
+
19
+ bool restartsonloss(const V& r);
20
+ bool gatesactivation(const V& r);
21
+ bool restartcausing(const V& r);
22
+
23
+ /* [{ref, provides:[name], requires:[req]}] -> the cycle, or nullptr. */
24
+ V dependencycycle(const V& nodes);
25
+ /* Raise on a cycle, naming it. Separate from the detector so the
26
+ * detector stays pure and corpus-testable. */
27
+ void checkcycle(const V& nodes);
28
+
29
+ } // namespace plugin
30
+
31
+ #endif