@voxgig/sdkgen 4.8.2 → 4.9.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 (407) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/doctor.d.ts +1 -0
  3. package/dist/action/doctor.js +50 -2
  4. package/dist/action/doctor.js.map +1 -1
  5. package/dist/helpers/naming.js +4 -2
  6. package/dist/helpers/naming.js.map +1 -1
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/model/sdkgen.aon +21 -0
  9. package/package.json +1 -1
  10. package/project/.sdk/model/feature/secrets.aon +120 -18
  11. package/project/.sdk/model/target/c.aon +10 -0
  12. package/project/.sdk/model/target/clojure.aon +13 -0
  13. package/project/.sdk/model/target/cpp.aon +10 -0
  14. package/project/.sdk/model/target/csharp.aon +9 -0
  15. package/project/.sdk/model/target/dart.aon +10 -0
  16. package/project/.sdk/model/target/elixir.aon +9 -0
  17. package/project/.sdk/model/target/go.aon +13 -0
  18. package/project/.sdk/model/target/java.aon +9 -0
  19. package/project/.sdk/model/target/js.aon +7 -0
  20. package/project/.sdk/model/target/kotlin.aon +9 -0
  21. package/project/.sdk/model/target/lean.aon +17 -0
  22. package/project/.sdk/model/target/lua.aon +8 -0
  23. package/project/.sdk/model/target/ocaml.aon +9 -0
  24. package/project/.sdk/model/target/perl.aon +8 -0
  25. package/project/.sdk/model/target/php.aon +8 -0
  26. package/project/.sdk/model/target/py.aon +13 -0
  27. package/project/.sdk/model/target/rb.aon +8 -0
  28. package/project/.sdk/model/target/rust.aon +10 -0
  29. package/project/.sdk/model/target/scala.aon +21 -2
  30. package/project/.sdk/model/target/swift.aon +18 -0
  31. package/project/.sdk/model/target/ts.aon +13 -0
  32. package/project/.sdk/model/target/zig.aon +9 -0
  33. package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
  34. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
  35. package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
  36. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
  37. package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
  38. package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
  39. package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
  40. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
  41. package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
  42. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
  43. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
  44. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
  45. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
  46. package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
  47. package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
  48. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
  49. package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
  50. package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
  51. package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
  52. package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
  53. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
  54. package/project/.sdk/src/cmp/zig/Package_zig.ts +15 -11
  55. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
  56. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
  57. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
  58. package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -1
  59. package/project/.sdk/tm/c/Makefile +38 -3
  60. package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
  61. package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
  62. package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
  63. package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
  64. package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
  65. package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
  66. package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
  67. package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
  68. package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
  69. package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
  70. package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
  71. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
  72. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
  73. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
  74. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
  75. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
  76. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
  77. package/project/.sdk/tm/cpp/Makefile +5 -1
  78. package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
  79. package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
  80. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
  81. package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
  82. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
  83. package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
  84. package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
  85. package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
  86. package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
  87. package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
  88. package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
  89. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
  90. package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
  91. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
  92. package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
  93. package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
  94. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
  95. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
  96. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
  97. package/project/.sdk/tm/dart/test/omni.dart +520 -0
  98. package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  99. package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
  100. package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
  101. package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  102. package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  103. package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  104. package/project/.sdk/tm/elixir/Makefile +11 -3
  105. package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
  106. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
  107. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
  108. package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
  109. package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
  110. package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
  111. package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
  112. package/project/.sdk/tm/go/core/context.go +32 -16
  113. package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
  114. package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
  115. package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
  116. package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
  117. package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
  118. package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
  119. package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
  120. package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
  121. package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
  122. package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
  123. package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
  124. package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
  125. package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
  126. package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
  127. package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
  128. package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
  129. package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
  130. package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
  131. package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
  132. package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
  133. package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
  134. package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +208 -0
  135. package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
  136. package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +150 -0
  137. package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
  138. package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
  139. package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
  140. package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +442 -0
  141. package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -0
  142. package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
  143. package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
  144. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
  145. package/project/.sdk/tm/go/test/omni/omni.go +902 -0
  146. package/project/.sdk/tm/go/test/omni/util.go +381 -0
  147. package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
  148. package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
  149. package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
  150. package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
  151. package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
  152. package/project/.sdk/tm/go/utility/make_options.go +8 -1
  153. package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
  154. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
  155. package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
  156. package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
  157. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
  158. package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
  159. package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
  160. package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
  161. package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
  162. package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
  163. package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
  164. package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
  165. package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
  166. package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
  167. package/project/.sdk/tm/js/test/omni.js +251 -0
  168. package/project/.sdk/tm/js/test/omni.test.js +105 -0
  169. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
  170. package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
  171. package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
  172. package/project/.sdk/tm/js/test/vendor/omni/runner.js +628 -0
  173. package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -0
  174. package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
  175. package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
  176. package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
  177. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
  178. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
  179. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
  180. package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
  181. package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
  182. package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
  183. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
  184. package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
  185. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
  186. package/project/.sdk/tm/lean/Makefile +12 -5
  187. package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
  188. package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  189. package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  190. package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
  191. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
  192. package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  193. package/project/.sdk/tm/lua/test/omni.lua +456 -0
  194. package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
  195. package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
  196. package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
  197. package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
  198. package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
  199. package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
  200. package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
  201. package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
  202. package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
  203. package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
  204. package/project/.sdk/tm/ocaml/Makefile +37 -12
  205. package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
  206. package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
  207. package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
  208. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
  209. package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
  210. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
  211. package/project/.sdk/tm/perl/t/omni.pm +647 -0
  212. package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
  213. package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
  214. package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
  215. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
  216. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
  217. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
  218. package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
  219. package/project/.sdk/tm/php/test/Omni.php +691 -0
  220. package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
  221. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
  222. package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
  223. package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
  224. package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
  225. package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
  226. package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
  227. package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
  228. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
  229. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
  230. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
  231. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
  232. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
  233. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
  234. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
  235. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
  236. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
  237. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
  238. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
  239. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
  240. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
  241. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
  242. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
  243. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +76 -0
  244. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
  245. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
  246. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
  247. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
  248. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
  249. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
  250. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +151 -0
  251. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
  252. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +90 -0
  253. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
  254. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
  255. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
  256. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
  257. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +475 -0
  258. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
  259. package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
  260. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
  261. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
  262. package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
  263. package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
  264. package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
  265. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
  266. package/project/.sdk/tm/py/test/omni.py +415 -0
  267. package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
  268. package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
  269. package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
  270. package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
  271. package/project/.sdk/tm/py/test/voxgig_omni/runner.py +580 -0
  272. package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -0
  273. package/project/.sdk/tm/rb/test/omni.rb +505 -0
  274. package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
  275. package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
  276. package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
  277. package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
  278. package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
  279. package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
  280. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
  281. package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
  282. package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
  283. package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
  284. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
  285. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
  286. package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
  287. package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
  288. package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
  289. package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
  290. package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
  291. package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
  292. package/project/.sdk/tm/scala/Makefile +16 -6
  293. package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
  294. package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
  295. package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
  296. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  297. package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
  298. package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
  299. package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
  300. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
  301. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
  302. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
  303. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
  304. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
  305. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
  306. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
  307. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
  308. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
  309. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
  310. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
  311. package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
  312. package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
  313. package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
  314. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
  315. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
  316. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
  317. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
  318. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
  319. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
  320. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
  321. package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
  322. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
  323. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
  324. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
  325. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
  326. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
  327. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
  328. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
  329. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
  330. package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
  331. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
  332. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
  333. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
  334. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
  335. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
  336. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
  337. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
  338. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
  339. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
  340. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
  341. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
  342. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
  343. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
  344. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
  345. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
  346. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
  347. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
  348. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
  349. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
  350. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
  351. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
  352. package/project/.sdk/tm/ts/test/omni.ts +104 -32
  353. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
  354. package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
  355. package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
  356. package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
  357. package/project/.sdk/tm/zig/Makefile +15 -1
  358. package/project/.sdk/tm/zig/build.zig +23 -5
  359. package/project/.sdk/tm/zig/core/helpers.zig +52 -11
  360. package/project/.sdk/tm/zig/core/mem.zig +17 -1
  361. package/project/.sdk/tm/zig/core/utility.zig +23 -19
  362. package/project/.sdk/tm/zig/feature/audit.zig +2 -2
  363. package/project/.sdk/tm/zig/feature/cache.zig +2 -2
  364. package/project/.sdk/tm/zig/feature/debug.zig +5 -5
  365. package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
  366. package/project/.sdk/tm/zig/feature/paging.zig +2 -2
  367. package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
  368. package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
  369. package/project/.sdk/tm/zig/feature/support.zig +3 -3
  370. package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
  371. package/project/.sdk/tm/zig/feature/test.zig +10 -5
  372. package/project/.sdk/tm/zig/test/fh.zig +10 -10
  373. package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
  374. package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
  375. package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
  376. package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
  377. package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
  378. package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
  379. package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
  380. package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
  381. package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
  382. package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
  383. package/project/sdkgen-package.json +1 -1
  384. package/src/action/doctor.ts +66 -2
  385. package/src/helpers/naming.ts +4 -2
  386. package/project/.sdk/tm/c/tests/runner.h +0 -274
  387. package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
  388. package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
  389. package/project/.sdk/tm/dart/test/runner.dart +0 -406
  390. package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
  391. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
  392. package/project/.sdk/tm/go/test/runner_test.go +0 -629
  393. package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
  394. package/project/.sdk/tm/java/test/StructRunner.java +0 -281
  395. package/project/.sdk/tm/js/test/runner.js +0 -387
  396. package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
  397. package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
  398. package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
  399. package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
  400. package/project/.sdk/tm/php/test/StructRunner.php +0 -275
  401. package/project/.sdk/tm/py/test/struct_runner.py +0 -411
  402. package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
  403. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
  404. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
  405. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
  406. package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
  407. package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
@@ -0,0 +1,145 @@
1
+ ;; VENDORED: @voxgig/omni sdk-20260907-0029-0 (clojure/src/voxgig/omni/util.clj)
2
+ ;; Source: https://github.com/voxgig/omni @ 274708cc2d12b21707d975543953f845f8444be0 [tag: sdk-20260907-0029-0]
3
+ ;; License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ ;; Omni internal JSON utilities.
5
+ ;;
6
+ ;; Self-contained by design: the omni runner must be able to test *any*
7
+ ;; library, including libraries that provide these same operations.
8
+
9
+ (ns voxgig.omni.util
10
+ (:require [clojure.string :as string]))
11
+
12
+ (def NULLMARK "__NULL__") ;; Value is JSON null.
13
+ (def UNDEFMARK "__UNDEF__") ;; Value is not present.
14
+ (def EXISTSMARK "__EXISTS__") ;; Value exists (not undefined).
15
+
16
+ ;; Clojure has nil for null, so absence needs its own marker.
17
+ (def ABSENT ::absent)
18
+
19
+ (defn isabsent [val] (= ABSENT val))
20
+
21
+ (defn ismap [val] (map? val))
22
+
23
+ (defn islist [val] (vector? val))
24
+
25
+ (defn isnode [val] (or (ismap val) (islist val)))
26
+
27
+ ;; A JSON number? Booleans are not numbers.
28
+ (defn isnum [val] (and (number? val) (not (boolean? val))))
29
+
30
+ (defn isstr [val] (string? val))
31
+
32
+ (defn isnone [val] (or (nil? val) (isabsent val)))
33
+
34
+ ;; Deep copy a JSON value (Clojure values are immutable).
35
+ (defn clone [val] val)
36
+
37
+ ;; Read a value by path. Returns ABSENT when any step is missing.
38
+ (defn getpath [val path]
39
+ (reduce
40
+ (fn [current part]
41
+ (cond
42
+ (islist current)
43
+ (let [index (try (Integer/parseInt (str part)) (catch NumberFormatException _ nil))]
44
+ (if (and index (<= 0 index) (< index (count current)))
45
+ (nth current index)
46
+ (reduced ABSENT)))
47
+
48
+ (ismap current)
49
+ (if (contains? current (str part))
50
+ (get current (str part))
51
+ (reduced ABSENT))
52
+
53
+ :else (reduced ABSENT)))
54
+ val
55
+ path))
56
+
57
+ ;; Depth-first walk: children first, then the containing node.
58
+ (defn walk
59
+ ([val apply-fn] (walk val apply-fn []))
60
+ ([val apply-fn path]
61
+ (let [next (cond
62
+ (islist val)
63
+ (vec (map-indexed (fn [index entry] (walk entry apply-fn (conj path (str index))))
64
+ val))
65
+
66
+ (ismap val)
67
+ (reduce-kv (fn [out key entry] (assoc out key (walk entry apply-fn (conj path key))))
68
+ (array-map)
69
+ val)
70
+
71
+ :else val)]
72
+ (apply-fn next path))))
73
+
74
+ ;; Deep structural equality: numbers by value, bools never numbers.
75
+ (defn deepequal [a b]
76
+ (cond
77
+ (or (boolean? a) (boolean? b)) (and (boolean? a) (boolean? b) (= a b))
78
+ ;; NaN equals NaN: deepequal is structural, not IEEE (as canonical).
79
+ ;; NaN-ness is tested AFTER numeric coercion, the way numstr does it below:
80
+ ;; isnum accepts every number? type, so a `double?` guard would miss
81
+ ;; Float/NaN - which isnum accepts and == still reports unequal.
82
+ (or (isnum a) (isnum b))
83
+ (and (isnum a) (isnum b)
84
+ (or (== a b)
85
+ (and (Double/isNaN (double a))
86
+ (Double/isNaN (double b)))))
87
+ (or (isabsent a) (isabsent b)) (and (isabsent a) (isabsent b))
88
+ (or (nil? a) (nil? b)) (and (nil? a) (nil? b))
89
+
90
+ (or (islist a) (islist b))
91
+ (and (islist a) (islist b) (= (count a) (count b))
92
+ (every? true? (map deepequal a b)))
93
+
94
+ (or (ismap a) (ismap b))
95
+ (and (ismap a) (ismap b) (= (count a) (count b))
96
+ (every? (fn [[key entry]] (and (contains? b key) (deepequal entry (get b key)))) a))
97
+
98
+ :else (= a b)))
99
+
100
+ ;; Render a number the same way in every port: 5.0 prints as 5.
101
+ (defn numstr [val]
102
+ (let [asdouble (double val)]
103
+ (cond
104
+ (or (Double/isNaN asdouble) (Double/isInfinite asdouble)) "null"
105
+ (and (== asdouble (Math/rint asdouble)) (< (Math/abs asdouble) 9007199254740992.0))
106
+ (str (long asdouble))
107
+ :else (str asdouble))))
108
+
109
+ ;; Render a string as a JSON string literal.
110
+ (defn quote-str [^String val]
111
+ (let [out (StringBuilder. "\"")]
112
+ (doseq [ch val]
113
+ (cond
114
+ (= \" ch) (.append out "\\\"")
115
+ (= \\ ch) (.append out "\\\\")
116
+ (= \newline ch) (.append out "\\n")
117
+ (= \return ch) (.append out "\\r")
118
+ (= \tab ch) (.append out "\\t")
119
+ (< (int ch) 0x20) (.append out (format "\\u%04x" (int ch)))
120
+ :else (.append out ch)))
121
+ (.toString (.append out "\""))))
122
+
123
+ ;; Compact JSON text with map keys sorted, identical in every port.
124
+ (defn jsonstr [val]
125
+ (cond
126
+ (isabsent val) "undefined"
127
+ (nil? val) "null"
128
+ (boolean? val) (if val "true" "false")
129
+ (string? val) (quote-str val)
130
+ (isnum val) (numstr val)
131
+ (islist val) (str "[" (string/join "," (map jsonstr val)) "]")
132
+ (ismap val) (str "{"
133
+ (string/join "," (map (fn [key] (str (quote-str (str key)) ":"
134
+ (jsonstr (get val key))))
135
+ (sort (map str (keys val)))))
136
+ "}")
137
+ :else (quote-str (str val))))
138
+
139
+ ;; Strings verbatim, everything else as compact JSON.
140
+ (defn stringify [val]
141
+ (if (string? val) val (jsonstr val)))
142
+
143
+ ;; Render a path as a dotted string.
144
+ (defn pathify [path]
145
+ (string/join "." (map str path)))
@@ -17,8 +17,12 @@ TEST_BINS := $(TEST_SRCS:.cpp=.out)
17
17
  # as "still failing" through several rebuilds because the binary under test
18
18
  # predated it. Listing the headers is cheap and makes `make test` mean what it
19
19
  # says.
20
+ # test/ is listed too: the corpus suites are driven by test/*.hpp (the omni
21
+ # resolver and the retained runner support) and by the vendored omni headers
22
+ # under test/vendor/omni/, none of which the pattern rule below names either.
20
23
  SDK_HDRS := $(wildcard core/*.hpp entity/*.hpp feature/*.hpp \
21
- utility/*.hpp utility/*/*.hpp *.hpp)
24
+ utility/*.hpp utility/*/*.hpp *.hpp \
25
+ test/*.hpp test/vendor/omni/*.hpp)
22
26
 
23
27
  .PHONY: test build clean
24
28
 
@@ -0,0 +1,473 @@
1
+ // ProjectName SDK — the corpus test runner: vendored @voxgig/omni driven
2
+ // through its NATIVE API (omni::makeRunner(spec, provider)), presented to
3
+ // the corpus tests in the runner shape they already use (run.spec,
4
+ // run.runset, run.runsetflags, run.client). No compat shim is vendored:
5
+ // the adapter below IS the whole bridge, per language, per the vendor-tag
6
+ // rollout (docs/design/vendor-tag-rollout.md, Decision 4). It supersedes
7
+ // the engine half of runner_support.hpp (runset/match_deep/canon) and the
8
+ // whole of struct_runner.hpp; the SUPPORT half of runner_support.hpp
9
+ // (read_file, load_env_local, env_override, load_test_control,
10
+ // is_control_skipped, get_spec, make_ctx_from_map, fixctx,
11
+ // entity_list_to_data, now_ms) lives on, name unchanged, because the
12
+ // generated entity suites include it.
13
+ //
14
+ // C++-specific decisions, each load-bearing:
15
+ //
16
+ // 1. TWO VALUE MODELS. omni::Json (json.hpp: an enum tag plus BY-VALUE
17
+ // vector members) vs sdk::Value (utility/voxgigstruct/value.hpp: a
18
+ // variant over monostate/nullptr/bool/int64/double/string/
19
+ // shared_ptr<List>/shared_ptr<Map>/Injector/Modify/Sentinel). to_sdk /
20
+ // to_omni convert at the subject boundary. Integral JSON numbers cross
21
+ // as int64_t, exactly as the SDK's own parser (value_io.hpp) feeds the
22
+ // utilities — their arithmetic and string rendering are written
23
+ // against that. An Injector/Modify/Sentinel has no JSON form, so it
24
+ // becomes its own rendering rather than silently collapsing to null.
25
+ //
26
+ // 2. ZERO-ARGUMENT ENTRIES, NATIVELY. The corpus carries entries with no
27
+ // `in`, `args` or `ctx`, meaning "call the subject with NO value".
28
+ // This port distinguishes that case itself: omni::Json has a
29
+ // first-class Type::Absent separate from Type::Null, resolveargs
30
+ // pushes `entry.get("in")` (absent when the key is missing), and
31
+ // fixjson never invents a NULLMARK for a key that is not there. So
32
+ // cpp needs no novalargs spec rewrite (go) and no compat shim
33
+ // (lua/php): the ONE conversion is the sentinel swap at the call
34
+ // boundary, Json::Absent <-> Value::undef() (std::monostate), which is
35
+ // the SDK's own no-value sentinel — the same shape as java
36
+ // (Json.ABSENT <-> Struct.UNDEF) and kotlin.
37
+ //
38
+ // 3. MUTATED ARGUMENTS CANNOT CROSS BY IDENTITY, so every set is driven
39
+ // through omni::RunPack::runsetflags_args and the wrapped subject
40
+ // REFILLS omni's own argument vector after the call. to_sdk builds NEW
41
+ // containers, so an in-place rewrite by a subject would otherwise be
42
+ // invisible to the runner — and `match: {args: ...}` asserts exactly
43
+ // that (struct minor/setpath, merge/integrity: 13 entries in the
44
+ // shared corpus). runset/runsetflags cannot serve: their Subject is
45
+ // taken by const reference and cannot write back.
46
+ //
47
+ // 4. `match: {ctx: ...}` IS REWRITTEN TO `match: {args: [...]}` before
48
+ // the spec reaches omni (ctxmatch_to_args below). This is the one
49
+ // place cpp diverges from the eleven targets already migrated, and it
50
+ // is forced by the port's value semantics: resolveargs stores the
51
+ // contextified argument as `entry.set("ctx", first)` (omni.hpp), which
52
+ // for a by-value Json is a deep COPY taken BEFORE the subject runs,
53
+ // and checkresult then builds the match base from that stale copy
54
+ // while building `args` from the LIVE vector the subject mutated. java
55
+ // and kotlin are immune because their map entries are references to
56
+ // one container. All nine `match.ctx` entries in the shared corpus
57
+ // assert POST-call state (spec.headers after prepareAuth, result.body
58
+ // after resultBody, spec.step after transformRequest, ...), so without
59
+ // the rewrite every one of them would read "absent". The rewrite is
60
+ // safe: an entry never carries both `ctx` and `args` (omni.hpp
61
+ // checkentry forbids it under spec version 1, and the corpus never
62
+ // does it under v0), and omni's getpath walks list indices by string,
63
+ // so `args.0.spec.step` resolves. The only cost is that a failure
64
+ // message names the path `args.0....` rather than `ctx....`.
65
+ //
66
+ // 5. NO subject-by-name provider hook. The SDK's Utility fields are TYPED
67
+ // (utility->prepareQuery(ctx) takes a CtxPtr), so a generic name
68
+ // lookup cannot produce omni's std::function<Json(vector<Json>&)>
69
+ // without a per-name adapter; every corpus call site passes its
70
+ // subject explicitly, so the hook would be dead weight. DEF.client
71
+ // entries still resolve through the `client` hook below — but note
72
+ // this port stamps `ctx.client` with Json::boolean(true) (PRESENCE,
73
+ // not identity), so a DEF-built client can never be read back out of
74
+ // the ctx map: a section needing a specially-optioned client
75
+ // constructs it at the call site (makeSpec, prepareAuth), exactly as
76
+ // the retired engine did. omni_ctx therefore IGNORES `ctx.client`.
77
+ //
78
+ // 6. A cpp SDK failure is thrown as sdk::SdkErrorPtr — a shared_ptr, NOT
79
+ // a std::exception — so omni's `catch (const std::exception&)` would
80
+ // never see it and an expected-error entry would escape the runner
81
+ // entirely. The wrapped subject catches it and rethrows the message as
82
+ // a std::runtime_error, stashing the error so the errify hook can put
83
+ // its `code` beside the message for a `match: {err: {code: ...}}`
84
+ // assertion (this port's errify hook REPLACES the default and receives
85
+ // only the message, which is why the stash exists; the binaries are
86
+ // single-threaded).
87
+ //
88
+ // 7. OMNI#54 AT THIS TAG: util.hpp's jsonstr has no cycle guard, and the
89
+ // errify half is already solved natively by the Provider::errify hook.
90
+ // The cycle risk is structurally impossible on omni's side — a Json is
91
+ // a by-value tree and literally cannot be cyclic — PROVIDED typed SDK
92
+ // state (a CtxPtr, a live ProjectNameSDK, an Injector closure) never
93
+ // enters the Json world, which decisions 1 and 5 guarantee. to_omni
94
+ // still refuses to recurse past MAXCONVERTDEPTH, so a cyclic
95
+ // sdk::Value fails loudly with the entry named instead of blowing the
96
+ // stack.
97
+
98
+ #ifndef SDK_TEST_OMNI_RESOLVER_HPP
99
+ #define SDK_TEST_OMNI_RESOLVER_HPP
100
+
101
+ #include <cmath>
102
+ #include <cstdint>
103
+ #include <functional>
104
+ #include <memory>
105
+ #include <stdexcept>
106
+ #include <string>
107
+ #include <vector>
108
+
109
+ #include "../core/sdk.hpp"
110
+ #include "runner_support.hpp"
111
+ #include "vendor/omni/omni.hpp"
112
+
113
+ namespace sdk {
114
+ namespace resolver {
115
+
116
+ // The sentinels, under the names the corpus tests already use.
117
+ inline const std::string NULLMARK = ::omni::NULLMARK;
118
+ inline const std::string UNDEFMARK = ::omni::UNDEFMARK;
119
+ inline const std::string EXISTSMARK = ::omni::EXISTSMARK;
120
+
121
+ using OmniError = ::omni::OmniError;
122
+ using Json = ::omni::Json;
123
+
124
+ // A depth no corpus value comes close to; see decision 7.
125
+ inline constexpr int MAXCONVERTDEPTH = 128;
126
+
127
+ // The function under test, in omni's native argument shape. The vector is
128
+ // MUTABLE on purpose: a subject that rewrites its argument in place (the
129
+ // struct setpath / merge-integrity groups) is what `match: {args: ...}`
130
+ // asserts on, and the wrapper refills omni's own arguments from it.
131
+ using Subject = std::function<Value(std::vector<Value>&)>;
132
+
133
+ // How many corpus entries this binary has actually driven. Counted in the
134
+ // wrapped subject, i.e. once per entry that reached the system under test.
135
+ // A suite whose count collapses has stopped running the corpus, which is
136
+ // the failure this whole migration exists to make visible.
137
+ inline long long& cases() {
138
+ static long long n = 0;
139
+ return n;
140
+ }
141
+
142
+ // ---- value models (decision 1) ----------------------------------------
143
+
144
+ /** omni's value model -> this port's. */
145
+ inline Value to_sdk(const Json& val) {
146
+ switch (val.type) {
147
+ case Json::Type::Absent:
148
+ return Value::undef();
149
+ case Json::Type::Null:
150
+ return Value(nullptr);
151
+ case Json::Type::Bool:
152
+ return Value(val.boolval);
153
+ case Json::Type::Num: {
154
+ double d = val.numval;
155
+ // Integral JSON numbers become int64_t, exactly as the SDK's own
156
+ // zero-dep parser produces them.
157
+ if (std::isfinite(d) && std::floor(d) == d && std::fabs(d) < 9007199254740992.0) {
158
+ return Value(static_cast<int64_t>(d));
159
+ }
160
+ return Value(d);
161
+ }
162
+ case Json::Type::Str:
163
+ return Value(val.strval);
164
+ case Json::Type::List: {
165
+ auto out = std::make_shared<List>();
166
+ out->reserve(val.listval.size());
167
+ for (const auto& entry : val.listval) out->push_back(to_sdk(entry));
168
+ return Value(std::move(out));
169
+ }
170
+ case Json::Type::Map: {
171
+ auto out = std::shared_ptr<Map>(new Map());
172
+ for (const auto& entry : val.mapval) out->set(entry.first, to_sdk(entry.second));
173
+ return Value(std::move(out));
174
+ }
175
+ }
176
+ return Value::undef();
177
+ }
178
+
179
+ /** This port's value model -> omni's. */
180
+ inline Json to_omni(const Value& val, int depth = 0) {
181
+ if (MAXCONVERTDEPTH < depth) {
182
+ throw std::runtime_error("omni resolver: value nested deeper than " +
183
+ std::to_string(MAXCONVERTDEPTH) + " (cyclic?)");
184
+ }
185
+ if (val.is_undef()) return Json::absent();
186
+ if (val.is_null()) return Json::null();
187
+ if (val.is_bool()) return Json::boolean(val.as_bool());
188
+ if (val.is_int()) return Json::num(static_cast<double>(val.as_int()));
189
+ if (val.is_double()) return Json::num(val.as_double());
190
+ if (val.is_string()) return Json::str(val.as_string());
191
+ if (val.is_list()) {
192
+ Json out = Json::list();
193
+ for (const auto& entry : *val.as_list()) out.push(to_omni(entry, depth + 1));
194
+ return out;
195
+ }
196
+ if (val.is_map()) {
197
+ Json out = Json::map();
198
+ for (const auto& entry : *val.as_map()) out.set(entry.first, to_omni(entry.second, depth + 1));
199
+ return out;
200
+ }
201
+ // Injector / Modify / SKIP / DELETE: no JSON form, and omni only ever
202
+ // stringifies one.
203
+ return Json::str(vs::stringify(val));
204
+ }
205
+
206
+ // ---- match.ctx -> match.args[0] (decision 4) --------------------------
207
+
208
+ // Rewrite a group's `match: {ctx: X}` assertions into `match: {args: [X]}`,
209
+ // which is the only match base this port builds from the LIVE (post-call)
210
+ // arguments. Everything else in the group is left untouched, and a group
211
+ // with no ctx assertion comes back unchanged.
212
+ inline Json ctxmatch_to_args(const Json& testspec) {
213
+ if (!testspec.ismap()) return testspec;
214
+
215
+ Json testset = testspec.get("set");
216
+ if (!testset.islist()) return testspec;
217
+
218
+ Json out = testspec;
219
+ Json newset = Json::list();
220
+
221
+ for (const auto& original : testset.listval) {
222
+ Json entry = original;
223
+ Json check = entry.ismap() ? entry.get("match") : Json::absent();
224
+
225
+ if (check.ismap() && check.has("ctx") && !check.has("args")) {
226
+ Json rebuilt = Json::map();
227
+ for (const auto& field : check.mapval) {
228
+ if ("ctx" == field.first) {
229
+ Json wrap = Json::list();
230
+ wrap.push(field.second);
231
+ rebuilt.set("args", wrap);
232
+ } else {
233
+ rebuilt.set(field.first, field.second);
234
+ }
235
+ }
236
+ entry.set("match", rebuilt);
237
+ }
238
+
239
+ newset.push(entry);
240
+ }
241
+
242
+ out.set("set", newset);
243
+ return out;
244
+ }
245
+
246
+ // ---- errors (decision 6) ---------------------------------------------
247
+
248
+ // The last SdkError a subject raised, so the errify hook can recover its
249
+ // code from the message omni hands back. Single-threaded by construction:
250
+ // each cpp test is its own binary and runs its sets in sequence.
251
+ inline SdkErrorPtr& lasterror() {
252
+ static SdkErrorPtr err;
253
+ return err;
254
+ }
255
+
256
+ // ---- runner ----------------------------------------------------------
257
+
258
+ class NamedRunner;
259
+
260
+ inline std::shared_ptr<::omni::Provider> sdk_provider(std::shared_ptr<ProjectNameSDK> client);
261
+
262
+ /**
263
+ * What the runner returns for one named spec section — the shape the
264
+ * corpus call sites consume. A failing entry throws omni::OmniError,
265
+ * which testlib's T_RUN records with the entry named.
266
+ */
267
+ class Run {
268
+ public:
269
+ // The resolved spec section, in this port's value model.
270
+ Value spec;
271
+ std::shared_ptr<ProjectNameSDK> client;
272
+
273
+ Run(const ::omni::RunPack& pack, std::shared_ptr<ProjectNameSDK> client_)
274
+ : spec(to_sdk(pack.spec)), client(std::move(client_)), pack_(pack) {}
275
+
276
+ /** A named group of the resolved spec. */
277
+ Value set(const std::string& name) const { return getp(spec, Value(name)); }
278
+
279
+ /** Run one set of test entries with omni's default flags. */
280
+ void runset(const std::string& label, const Value& testspec, const Subject& subject) const {
281
+ runsetflags(label, testspec, true, subject);
282
+ }
283
+
284
+ /**
285
+ * Run one set of test entries. `nullflag` is omni's `null` flag: true
286
+ * rewrites every JSON null (and absent) to NULLMARK on both sides, false
287
+ * keeps them apart.
288
+ */
289
+ void runsetflags(const std::string& label, const Value& testspec, bool nullflag,
290
+ const Subject& subject) const {
291
+ ::omni::Flags flags;
292
+ flags.null = nullflag;
293
+ flags.name = label;
294
+
295
+ ::omni::SubjectArgs wrapped = [&subject](std::vector<Json>& args) -> Json {
296
+ std::vector<Value> pargs;
297
+ pargs.reserve(args.size());
298
+ for (const auto& arg : args) pargs.push_back(to_sdk(arg));
299
+
300
+ cases()++;
301
+ lasterror() = nullptr;
302
+
303
+ Value got;
304
+ try {
305
+ got = subject(pargs);
306
+ } catch (const SdkErrorPtr& err) {
307
+ // decision 6: a shared_ptr throw is invisible to omni's catch.
308
+ lasterror() = err;
309
+ throw std::runtime_error(err->getMessage());
310
+ }
311
+
312
+ // decision 3: refill omni's own arguments so `match.args` (and the
313
+ // rewritten `match.ctx`) see the in-place rewrite.
314
+ for (size_t index = 0; index < args.size(); index++) {
315
+ args[index] = to_omni(pargs[index]);
316
+ }
317
+
318
+ return to_omni(got);
319
+ };
320
+
321
+ pack_.runsetflags_args(ctxmatch_to_args(to_omni(testspec)), flags, wrapped);
322
+ }
323
+
324
+ private:
325
+ ::omni::RunPack pack_;
326
+ };
327
+
328
+ /** A loaded spec: resolves one named section at a time. */
329
+ class NamedRunner {
330
+ public:
331
+ NamedRunner(const ::omni::Runner& runner, std::shared_ptr<ProjectNameSDK> client)
332
+ : runner_(runner), client_(std::move(client)) {}
333
+
334
+ Run runner(const std::string& name, const Value& store = Value::undef()) const {
335
+ return Run(runner_.runner(name, to_omni(store)), client_);
336
+ }
337
+
338
+ private:
339
+ ::omni::Runner runner_;
340
+ std::shared_ptr<ProjectNameSDK> client_;
341
+ };
342
+
343
+ /** Wrap a live client as an omni provider (decisions 5 and 6). */
344
+ inline std::shared_ptr<::omni::Provider> sdk_provider(std::shared_ptr<ProjectNameSDK> client) {
345
+ auto provider = std::make_shared<::omni::Provider>();
346
+
347
+ // A DEF.client entry becomes another live test SDK, wrapped the same
348
+ // way. (This port cannot hand the provider back through the ctx map —
349
+ // see decision 5 — so a section needing that client also constructs it
350
+ // at the call site.)
351
+ provider->client = [](const Json& options) -> std::shared_ptr<::omni::Provider> {
352
+ Value opts = to_sdk(options);
353
+ if (!opts.is_map()) opts = vmap();
354
+ return sdk_provider(ProjectNameSDK::testSDK(Value::undef(), opts));
355
+ };
356
+
357
+ // Client options may reference the runner store.
358
+ provider->inject = [](const Json& options, const Json& store) -> Json {
359
+ return to_omni(vs::inject(to_sdk(options), to_sdk(store)));
360
+ };
361
+
362
+ // Keep the SDK error's code beside its message, so a corpus
363
+ // `match: {err: {code: ...}}` can assert on it — this port's errify hook
364
+ // REPLACES the default and is handed the message alone, hence the stash
365
+ // (decision 6).
366
+ provider->errify = [](const std::string& message) -> Json {
367
+ Json out = Json::map();
368
+ SdkErrorPtr err = lasterror();
369
+ if (err && err->getMessage() == message) {
370
+ out.set("name", Json::str("SdkError"));
371
+ out.set("message", Json::str(message));
372
+ if (!err->code.empty()) {
373
+ out.set("code", Json::str(err->code));
374
+ }
375
+ return out;
376
+ }
377
+ out.set("name", Json::str("Error"));
378
+ out.set("message", Json::str(message));
379
+ return out;
380
+ };
381
+
382
+ (void)client;
383
+ return provider;
384
+ }
385
+
386
+ /**
387
+ * Make a runner for a spec FILE. The path is resolved by omni against the
388
+ * process working directory; cpp test binaries run from the SDK root as
389
+ * `./test/x.out`, so the "../.sdk/test/test.json" constant the suites
390
+ * already use carries over unchanged.
391
+ */
392
+ inline NamedRunner makeRunner(const std::string& path, std::shared_ptr<ProjectNameSDK> client) {
393
+ return NamedRunner(::omni::makeRunner(path, sdk_provider(client)), client);
394
+ }
395
+
396
+ /**
397
+ * Make a runner for an IN-MEMORY spec — omni's own capability, which keeps
398
+ * the smoke test free of a fixture file. Named apart from makeRunner
399
+ * because `const char*` converts to both std::string and Value.
400
+ */
401
+ inline NamedRunner makeRunnerSpec(const Value& spec, std::shared_ptr<ProjectNameSDK> client) {
402
+ return NamedRunner(::omni::makeRunner(to_omni(spec), sdk_provider(client)), client);
403
+ }
404
+
405
+ // ---- ctx bridge -------------------------------------------------------
406
+
407
+ /**
408
+ * Build the typed Context a generated utility takes from the ctx MAP omni
409
+ * handed the subject (args[0]). The map's `client` entry is omni's
410
+ * presence marker (Json::boolean(true)) and is deliberately ignored — see
411
+ * decision 5. (The engine half of the retired runset call sites did this
412
+ * as make_ctx_from_map + fixctx, per section, by hand.)
413
+ */
414
+ inline CtxPtr omni_ctx(const Value& arg, std::shared_ptr<ProjectNameSDK> client,
415
+ UtilityPtr utility) {
416
+ Value ctxmap = Helpers::toMapAny(arg);
417
+ if (!ctxmap.is_map()) ctxmap = vmap();
418
+ CtxPtr ctx = rs::make_ctx_from_map(ctxmap, client, utility);
419
+ rs::fixctx(ctx, client);
420
+ return ctx;
421
+ }
422
+
423
+ /**
424
+ * Write the OBSERVABLE state of a typed context back into the ctx map the
425
+ * entry holds, which is where a `match: {ctx: ...}` assertion reads
426
+ * (through the wrapped subject's refill — decision 3 — and the rewrite of
427
+ * decision 4). The subject mutated the typed context; the map is what the
428
+ * runner can walk. (The retired engine call sites did this per section, by
429
+ * hand, as "update entry ctx for match".)
430
+ */
431
+ inline void omni_sync_ctx(const Value& arg, CtxPtr ctx) {
432
+ Value ctxmap = Helpers::toMapAny(arg);
433
+ if (!ctxmap.is_map() || !ctx) return;
434
+
435
+ if (ctx->spec) {
436
+ Value spec = vmap();
437
+ map_put(spec, "base", Value(ctx->spec->base));
438
+ map_put(spec, "prefix", Value(ctx->spec->prefix));
439
+ map_put(spec, "suffix", Value(ctx->spec->suffix));
440
+ map_put(spec, "path", Value(ctx->spec->path));
441
+ map_put(spec, "method", Value(ctx->spec->method));
442
+ map_put(spec, "params", ctx->spec->params);
443
+ map_put(spec, "query", ctx->spec->query);
444
+ map_put(spec, "headers", ctx->spec->headers);
445
+ map_put(spec, "step", Value(ctx->spec->step));
446
+ map_put(spec, "alias", ctx->spec->alias);
447
+ if (!ctx->spec->body.is_undef()) map_put(spec, "body", ctx->spec->body);
448
+ if (!ctx->spec->url.empty()) map_put(spec, "url", Value(ctx->spec->url));
449
+ map_put(ctxmap, "spec", spec);
450
+ }
451
+
452
+ if (ctx->result) {
453
+ Value result = vmap();
454
+ map_put(result, "ok", Value(ctx->result->ok));
455
+ map_put(result, "status", Value(ctx->result->status));
456
+ map_put(result, "statusText", Value(ctx->result->statusText));
457
+ map_put(result, "headers", ctx->result->headers);
458
+ if (!ctx->result->body.is_undef()) map_put(result, "body", ctx->result->body);
459
+ if (ctx->result->err) {
460
+ map_put(result, "err", vmap({{"message", Value(ctx->result->err->getMessage())}}));
461
+ }
462
+ if (!ctx->result->resdata.is_undef()) map_put(result, "resdata", ctx->result->resdata);
463
+ if (!ctx->result->resmatch.is_undef()) map_put(result, "resmatch", ctx->result->resmatch);
464
+ map_put(ctxmap, "result", result);
465
+ }
466
+
467
+ if (ctx->response) map_put(ctxmap, "response", Value("exists"));
468
+ }
469
+
470
+ } // namespace resolver
471
+ } // namespace sdk
472
+
473
+ #endif // SDK_TEST_OMNI_RESOLVER_HPP