@voxgig/sdkgen 4.8.2 → 4.8.3

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 (376) 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/src/cmp/clojure/Package_clojure.ts +9 -2
  33. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
  34. package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
  35. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
  36. package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
  37. package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
  38. package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
  39. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
  40. package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
  41. package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
  42. package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
  43. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
  44. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
  45. package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
  46. package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
  47. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
  48. package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
  49. package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
  50. package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
  51. package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
  52. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
  53. package/project/.sdk/tm/c/Makefile +38 -3
  54. package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
  55. package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
  56. package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
  57. package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
  58. package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
  59. package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
  60. package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
  61. package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
  62. package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
  63. package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
  64. package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
  65. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
  66. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
  67. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
  68. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
  69. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
  70. package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
  71. package/project/.sdk/tm/cpp/Makefile +5 -1
  72. package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
  73. package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
  74. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
  75. package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
  76. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
  77. package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
  78. package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
  79. package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
  80. package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
  81. package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
  82. package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
  83. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
  84. package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
  85. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
  86. package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
  87. package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
  88. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
  89. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
  90. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
  91. package/project/.sdk/tm/dart/test/omni.dart +520 -0
  92. package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
  93. package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
  94. package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
  95. package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
  96. package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
  97. package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
  98. package/project/.sdk/tm/elixir/Makefile +11 -3
  99. package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
  100. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
  101. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
  102. package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
  103. package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
  104. package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
  105. package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
  106. package/project/.sdk/tm/go/core/context.go +32 -16
  107. package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
  108. package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
  109. package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
  110. package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
  111. package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
  112. package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
  113. package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
  114. package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
  115. package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
  116. package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
  117. package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
  118. package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
  119. package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
  120. package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
  121. package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
  122. package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
  123. package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
  124. package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
  125. package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
  126. package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
  127. package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
  128. package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
  129. package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
  130. package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
  131. package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
  132. package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
  133. package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
  134. package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
  135. package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
  136. package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
  137. package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
  138. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
  139. package/project/.sdk/tm/go/test/omni/omni.go +897 -0
  140. package/project/.sdk/tm/go/test/omni/util.go +360 -0
  141. package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
  142. package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
  143. package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
  144. package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
  145. package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
  146. package/project/.sdk/tm/go/utility/make_options.go +8 -1
  147. package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
  148. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
  149. package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
  150. package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
  151. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
  152. package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
  153. package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
  154. package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
  155. package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
  156. package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
  157. package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
  158. package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
  159. package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
  160. package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
  161. package/project/.sdk/tm/js/test/omni.js +251 -0
  162. package/project/.sdk/tm/js/test/omni.test.js +105 -0
  163. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
  164. package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
  165. package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
  166. package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
  167. package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
  168. package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
  169. package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
  170. package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
  171. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
  172. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
  173. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
  174. package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
  175. package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
  176. package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
  177. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
  178. package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
  179. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
  180. package/project/.sdk/tm/lean/Makefile +12 -5
  181. package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
  182. package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
  183. package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
  184. package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
  185. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
  186. package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
  187. package/project/.sdk/tm/lua/test/omni.lua +456 -0
  188. package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
  189. package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
  190. package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
  191. package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
  192. package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
  193. package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
  194. package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
  195. package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
  196. package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
  197. package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
  198. package/project/.sdk/tm/ocaml/Makefile +37 -12
  199. package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
  200. package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
  201. package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
  202. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
  203. package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
  204. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
  205. package/project/.sdk/tm/perl/t/omni.pm +647 -0
  206. package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
  207. package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
  208. package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
  209. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
  210. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
  211. package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
  212. package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
  213. package/project/.sdk/tm/php/test/Omni.php +691 -0
  214. package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
  215. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
  216. package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
  217. package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
  218. package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
  219. package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
  220. package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
  221. package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
  222. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
  223. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
  224. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
  225. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
  226. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
  227. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
  228. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
  229. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
  230. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
  231. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
  232. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
  233. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
  234. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
  235. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
  236. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
  237. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
  238. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
  239. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
  240. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
  241. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
  242. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
  243. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
  244. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
  245. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
  246. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
  247. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
  248. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
  249. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
  250. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
  251. package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
  252. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
  253. package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
  254. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
  255. package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
  256. package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
  257. package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
  258. package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
  259. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
  260. package/project/.sdk/tm/py/test/omni.py +415 -0
  261. package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
  262. package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
  263. package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
  264. package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
  265. package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
  266. package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
  267. package/project/.sdk/tm/rb/test/omni.rb +505 -0
  268. package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
  269. package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
  270. package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
  271. package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
  272. package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
  273. package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
  274. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
  275. package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
  276. package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
  277. package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
  278. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
  279. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
  280. package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
  281. package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
  282. package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
  283. package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
  284. package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
  285. package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
  286. package/project/.sdk/tm/scala/Makefile +16 -6
  287. package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
  288. package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
  289. package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
  290. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  291. package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
  292. package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
  293. package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
  294. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
  295. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
  296. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
  297. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
  298. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
  299. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
  300. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
  301. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
  302. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
  303. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
  304. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
  305. package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
  306. package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
  307. package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
  308. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
  309. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
  310. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
  311. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
  312. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
  313. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
  314. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
  315. package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
  316. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
  317. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
  318. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
  319. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
  320. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
  321. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
  322. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
  323. package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
  324. package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
  325. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
  326. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
  327. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
  328. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
  329. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
  330. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
  331. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
  332. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
  333. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
  334. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
  335. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
  336. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
  337. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
  338. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
  339. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
  340. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
  341. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
  342. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
  343. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
  344. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
  345. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
  346. package/project/.sdk/tm/ts/test/omni.ts +104 -32
  347. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
  348. package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
  349. package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
  350. package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
  351. package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
  352. package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
  353. package/project/sdkgen-package.json +1 -1
  354. package/src/action/doctor.ts +66 -2
  355. package/src/helpers/naming.ts +4 -2
  356. package/project/.sdk/tm/c/tests/runner.h +0 -274
  357. package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
  358. package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
  359. package/project/.sdk/tm/dart/test/runner.dart +0 -406
  360. package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
  361. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
  362. package/project/.sdk/tm/go/test/runner_test.go +0 -629
  363. package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
  364. package/project/.sdk/tm/java/test/StructRunner.java +0 -281
  365. package/project/.sdk/tm/js/test/runner.js +0 -387
  366. package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
  367. package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
  368. package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
  369. package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
  370. package/project/.sdk/tm/php/test/StructRunner.php +0 -275
  371. package/project/.sdk/tm/py/test/struct_runner.py +0 -411
  372. package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
  373. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
  374. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
  375. package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
  376. package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
@@ -0,0 +1,748 @@
1
+ // The corpus test runner: vendored @voxgig/omni driven through its NATIVE
2
+ // API (`omni.MakeRunner(specref, provider)`), presented to the corpus tests
3
+ // in the struct-runner shape they already use (`RunPack.Spec`,
4
+ // `RunPack.RunSet`, `RunPack.RunSetFlags`, `RunPack.Client`). No compat
5
+ // shim is vendored: the adapter below IS the whole bridge, per language,
6
+ // per the vendor-tag rollout (docs/design/vendor-tag-rollout.md,
7
+ // Decision 4). It supersedes the engine halves of the retired
8
+ // runner_test.go and struct_runner_test.go (support lives on in
9
+ // testsupport_test.go).
10
+ //
11
+ // Go-specific decisions, each load-bearing:
12
+ //
13
+ // 1. REFLECTION PROVIDER. The omni provider hooks reach the client by
14
+ // reflection over the names the clients already expose (Utility() /
15
+ // GetUtility(), Struct(), Contextify(), Tester()), so ONE resolver
16
+ // serves both the generated SDK and the struct-corpus client in
17
+ // struct_utility_test.go. Ported from upstream's go compat shim
18
+ // (omni go/compat/struct), which this resolver replaces.
19
+ //
20
+ // 2. CONTEXTS STAY MAPS ACROSS THE RUNNER. omni sets `entry.ctx` to the
21
+ // contextified args[0] and `match: {ctx: ...}` assertions read THROUGH
22
+ // it with omni's own GetPath, which walks JSON maps only. A typed
23
+ // *sdk.Context there would make every ctx assertion read "absent". So
24
+ // Contextify returns the MAP; a corpus subject builds the typed context
25
+ // with omniCtx(args[0], ...) at the call site, runs the utility, and
26
+ // writes the observable ctx state back into the same map with
27
+ // omniSyncCtx - which is what makes the live SDK reachable through
28
+ // ctx.Client for the generated utilities (the ts resolver gets both for
29
+ // free from prototype delegation; maps-plus-sync is the go idiom for
30
+ // the same contract).
31
+ //
32
+ // 3. ZERO-ARGUMENT ENTRIES (novalargs). The corpus carries entries with no
33
+ // `in`, `args` or `ctx`, meaning "call the subject with NO argument".
34
+ // omni's native rule passes [clone(entry.in)] - one null. The upstream
35
+ // go compat shim corrected this by handing such entries the struct
36
+ // port's own no-value sentinel (NOVAL); that correction is ported here
37
+ // (novalargs/novalsubject/NOVALMARK), not dropped.
38
+ //
39
+ // 4. THE VENDORED GO PORT LACKS THE omni#54 RUNNER FIXES the TypeScript
40
+ // port has at this tag (omni#57 tracks porting them): JsonStr has no
41
+ // cycle guard, and Match clones its base. Both only bite on CYCLIC
42
+ // values, and go's Clone/FixJson pass non-JSON values (a typed context,
43
+ // a client) through by reference without walking them - so decision 2
44
+ // above (JSON-only maps in entries, typed state kept out of them) is
45
+ // also what keeps every value the runner clones or stringifies acyclic.
46
+ // The errify half (non-Error throwables) cannot arise in go: subjects
47
+ // return `error` values, and the Errify hook below keeps the SDK
48
+ // error's code for `match: {err: {code: ...}}` assertions.
49
+
50
+ package sdktest
51
+
52
+ import (
53
+ "fmt"
54
+ "reflect"
55
+ "strings"
56
+ "sync"
57
+
58
+ sdk "GOMODULE"
59
+ omni "GOMODULE/test/omni"
60
+
61
+ vs "github.com/voxgig/struct"
62
+ )
63
+
64
+ // The shared corpus, compiled by the project build. Relative to this
65
+ // package directory, which is where `go test` runs.
66
+ const TEST_JSON_FILE = "../../.sdk/test/test.json"
67
+
68
+ // The sentinels, under the names the corpus tests already use.
69
+ var (
70
+ NULLMARK = omni.NULLMARK
71
+ UNDEFMARK = omni.UNDEFMARK
72
+ EXISTSMARK = omni.EXISTSMARK
73
+ )
74
+
75
+ // TestingT is the part of *testing.T the runner API uses. An interface, so
76
+ // the runner-must-fail smoke test can hand in a recorder and observe the
77
+ // failure instead of failing itself.
78
+ type TestingT interface {
79
+ Helper()
80
+ Error(args ...any)
81
+ }
82
+
83
+ // Subject is the function under test, in omni's native form.
84
+ type Subject = omni.Subject
85
+
86
+ // RunSet runs one set of test entries, reporting failures to the test.
87
+ type RunSet func(t TestingT, testspec any, testsubject any)
88
+
89
+ // RunSetFlags runs one set of test entries with flags.
90
+ type RunSetFlags func(t TestingT, testspec any, flags map[string]bool, testsubject any)
91
+
92
+ // RunPack is what the runner returns for one named spec section - the
93
+ // struct-runner shape the corpus call sites consume.
94
+ type RunPack struct {
95
+ Spec map[string]any
96
+ RunSet RunSet
97
+ RunSetFlags RunSetFlags
98
+ Subject Subject
99
+ Client any
100
+ }
101
+
102
+ // MakeRunner is the struct runner's makeRunner(testfile, client)
103
+ // signature, backed by vendored omni. `testfile` is a spec path or an
104
+ // already-parsed spec value (omni's own capability), which keeps smoke
105
+ // tests free of fixture files.
106
+ func MakeRunner(testfile any, client any) func(name string, store any) (*RunPack, error) {
107
+ provider := omniProvider(client)
108
+ sentinel := any(vs.NOVAL)
109
+ runner, mkerr := omni.MakeRunner(testfile, provider)
110
+
111
+ return func(name string, store any) (*RunPack, error) {
112
+ if nil != mkerr {
113
+ return nil, mkerr
114
+ }
115
+
116
+ pack, err := runner(name, store)
117
+ if nil != err {
118
+ return nil, err
119
+ }
120
+
121
+ spec, _ := pack.Spec.(map[string]any)
122
+
123
+ runsetflags := func(t TestingT, testspec any, flags map[string]bool, testsubject any) {
124
+ t.Helper()
125
+
126
+ usespec, patched := novalargs(fixnums(testspec), sentinel)
127
+
128
+ subject := pack.Subject
129
+ if nil != testsubject {
130
+ subject = subjectify(testsubject)
131
+ }
132
+ subject = novalsubject(subject, sentinel, patched)
133
+
134
+ if err := pack.RunSetFlags(usespec, omniflags(flags), subject); nil != err {
135
+ t.Error(err.Error())
136
+ }
137
+ }
138
+
139
+ runset := func(t TestingT, testspec any, testsubject any) {
140
+ t.Helper()
141
+ runsetflags(t, testspec, nil, testsubject)
142
+ }
143
+
144
+ return &RunPack{
145
+ Spec: spec,
146
+ RunSet: runset,
147
+ RunSetFlags: runsetflags,
148
+ Subject: pack.Subject,
149
+ Client: client,
150
+ }, nil
151
+ }
152
+ }
153
+
154
+ // The runner's flags are booleans; omni's carry any value.
155
+ func omniflags(flags map[string]bool) omni.Flags {
156
+ out := omni.Flags{}
157
+ for name, flag := range flags {
158
+ out[name] = flag
159
+ }
160
+ return out
161
+ }
162
+
163
+ // providerclients maps each omni provider back to the live client it
164
+ // wraps, and defproviders marks the ones a spec's DEF.client built - the
165
+ // only ones omniCtx lets override a call site's explicit client (the base
166
+ // provider rides on EVERY ctx entry, and letting it win would defeat the
167
+ // sections that deliberately construct a differently-optioned client).
168
+ // Guarded: corpus subtests may run concurrently.
169
+ var (
170
+ providerclientsmu sync.Mutex
171
+ providerclients = map[*omni.Provider]any{}
172
+ defproviders = map[*omni.Provider]bool{}
173
+ )
174
+
175
+ func registerprovider(provider *omni.Provider, client any) {
176
+ providerclientsmu.Lock()
177
+ defer providerclientsmu.Unlock()
178
+ providerclients[provider] = client
179
+ }
180
+
181
+ func markdefprovider(provider *omni.Provider) {
182
+ providerclientsmu.Lock()
183
+ defer providerclientsmu.Unlock()
184
+ defproviders[provider] = true
185
+ }
186
+
187
+ func defproviderclient(provider *omni.Provider) any {
188
+ providerclientsmu.Lock()
189
+ defer providerclientsmu.Unlock()
190
+ if !defproviders[provider] {
191
+ return nil
192
+ }
193
+ return providerclients[provider]
194
+ }
195
+
196
+ // omniProvider wraps a client as an omni provider. The live client is
197
+ // registered so that map ctx entries can be resolved back to it.
198
+ func omniProvider(client any) *omni.Provider {
199
+ provider := &omni.Provider{
200
+ // A subject resolves from the utility: a method, a utility func
201
+ // field (the generated SDK's shape), or a func field on the
202
+ // utility's Struct() container (the struct corpus client's shape).
203
+ Subject: func(name string) omni.Subject {
204
+ utility := utilityof(client)
205
+
206
+ if method := findmethod(utility, name); method.IsValid() {
207
+ return subjectify(method.Interface())
208
+ }
209
+
210
+ if field := findfield(utility, name); field.IsValid() &&
211
+ reflect.Func == field.Kind() && !field.IsNil() {
212
+ return subjectify(field.Interface())
213
+ }
214
+
215
+ field := findfield(structutilof(utility), name)
216
+ if field.IsValid() && reflect.Func == field.Kind() && !field.IsNil() {
217
+ return subjectify(field.Interface())
218
+ }
219
+
220
+ return nil
221
+ },
222
+
223
+ // A DEF.client entry becomes another live client instance, wrapped
224
+ // the same way.
225
+ Client: func(options any) (*omni.Provider, error) {
226
+ tester := findmethod(reflect.ValueOf(client), "tester")
227
+ if !tester.IsValid() {
228
+ return nil, fmt.Errorf("omniresolver: client has no Tester method")
229
+ }
230
+
231
+ opts, is := options.(map[string]any)
232
+ if !is {
233
+ opts = map[string]any{}
234
+ }
235
+
236
+ results := tester.Call([]reflect.Value{reflect.ValueOf(opts)})
237
+ if 2 != len(results) {
238
+ return nil, fmt.Errorf("omniresolver: Tester must return (client, error)")
239
+ }
240
+ if err, is := results[1].Interface().(error); is && nil != err {
241
+ return nil, err
242
+ }
243
+
244
+ sub := omniProvider(results[0].Interface())
245
+ markdefprovider(sub)
246
+ return sub, nil
247
+ },
248
+
249
+ // The ctx STAYS a map (see decision 2 above). The client's own
250
+ // contextify hook runs when it has one (the struct corpus client
251
+ // does); the utility rides along for subjects that read it.
252
+ Contextify: func(val any) any {
253
+ utility := utilityof(client)
254
+
255
+ ctx := val
256
+ if hook := findmethod(utility, "contextify"); hook.IsValid() {
257
+ if ctxmap, is := val.(map[string]any); is {
258
+ results := hook.Call([]reflect.Value{reflect.ValueOf(ctxmap)})
259
+ if 1 == len(results) {
260
+ ctx = results[0].Interface()
261
+ }
262
+ }
263
+ }
264
+
265
+ if ctxmap, is := ctx.(map[string]any); is && utility.IsValid() {
266
+ ctxmap["utility"] = utility.Interface()
267
+ }
268
+
269
+ return ctx
270
+ },
271
+
272
+ // Client options may reference the runner store.
273
+ Inject: func(options any, store any) any {
274
+ vs.Inject(options, store)
275
+ return options
276
+ },
277
+
278
+ // Keep the SDK error's code beside its message, so a corpus
279
+ // `match: {err: {code: ...}}` can assert on it - the go analogue
280
+ // of the omni#54 errify fix.
281
+ Errify: func(err any) any {
282
+ if sdkerr, is := err.(*sdk.ProjectNameError); is {
283
+ out := map[string]any{
284
+ "name": "ProjectNameError",
285
+ "message": sdkerr.Error(),
286
+ }
287
+ if "" != sdkerr.Code {
288
+ out["code"] = sdkerr.Code
289
+ }
290
+ return out
291
+ }
292
+ return omni.Errify(err)
293
+ },
294
+ }
295
+
296
+ registerprovider(provider, client)
297
+
298
+ return provider
299
+ }
300
+
301
+ // utilityof reaches the client's utility: Utility() on the struct corpus
302
+ // client, GetUtility() on the generated SDK. Only a ZERO-ARGUMENT method
303
+ // counts - a generated SDK with an entity named `utility` has an entity
304
+ // ACCESSOR of the same name that takes options, and calling that here
305
+ // would panic (the fixture model ships reserved-name entities precisely to
306
+ // catch this class of collision).
307
+ func utilityof(client any) reflect.Value {
308
+ method := findnullarymethod(reflect.ValueOf(client), "utility")
309
+ if !method.IsValid() {
310
+ method = findnullarymethod(reflect.ValueOf(client), "getutility")
311
+ }
312
+ if !method.IsValid() {
313
+ return reflect.Value{}
314
+ }
315
+
316
+ results := method.Call(nil)
317
+ if 1 != len(results) {
318
+ return reflect.Value{}
319
+ }
320
+
321
+ return reflect.ValueOf(results[0].Interface())
322
+ }
323
+
324
+ // findnullarymethod is findmethod restricted to methods that take no
325
+ // arguments and return exactly one value.
326
+ func findnullarymethod(val reflect.Value, name string) reflect.Value {
327
+ if !val.IsValid() || "" == name {
328
+ return reflect.Value{}
329
+ }
330
+
331
+ valtype := val.Type()
332
+ for index := 0; index < valtype.NumMethod(); index++ {
333
+ if !strings.EqualFold(valtype.Method(index).Name, name) {
334
+ continue
335
+ }
336
+ method := val.Method(index)
337
+ if 0 == method.Type().NumIn() && 1 == method.Type().NumOut() {
338
+ return method
339
+ }
340
+ }
341
+
342
+ return reflect.Value{}
343
+ }
344
+
345
+ func structutilof(utility reflect.Value) reflect.Value {
346
+ method := findnullarymethod(utility, "struct")
347
+ if !method.IsValid() {
348
+ return reflect.Value{}
349
+ }
350
+
351
+ results := method.Call(nil)
352
+ if 1 != len(results) {
353
+ return reflect.Value{}
354
+ }
355
+
356
+ return reflect.ValueOf(results[0].Interface())
357
+ }
358
+
359
+ // Spec names are lower case; Go names are exported, and some are
360
+ // multi-word (`getpath` is `GetPath`), so match without case.
361
+ func findmethod(val reflect.Value, name string) reflect.Value {
362
+ if !val.IsValid() || "" == name {
363
+ return reflect.Value{}
364
+ }
365
+
366
+ valtype := val.Type()
367
+ for index := 0; index < valtype.NumMethod(); index++ {
368
+ if strings.EqualFold(valtype.Method(index).Name, name) {
369
+ return val.Method(index)
370
+ }
371
+ }
372
+
373
+ return reflect.Value{}
374
+ }
375
+
376
+ func findfield(val reflect.Value, name string) reflect.Value {
377
+ if !val.IsValid() || "" == name {
378
+ return reflect.Value{}
379
+ }
380
+
381
+ if reflect.Pointer == val.Kind() {
382
+ if val.IsNil() {
383
+ return reflect.Value{}
384
+ }
385
+ val = val.Elem()
386
+ }
387
+
388
+ if reflect.Struct != val.Kind() {
389
+ return reflect.Value{}
390
+ }
391
+
392
+ valtype := val.Type()
393
+ for index := 0; index < valtype.NumField(); index++ {
394
+ if strings.EqualFold(valtype.Field(index).Name, name) {
395
+ return val.Field(index)
396
+ }
397
+ }
398
+
399
+ return reflect.Value{}
400
+ }
401
+
402
+ // novalargs rewrites entries with no `in`, `args` or `ctx` to carry a
403
+ // MARKER the subject wrapper swaps for the port's real no-value sentinel
404
+ // at the call boundary. The marker (a string) survives omni's fixjson
405
+ // normalisation; the sentinel (a struct pointer) would not. Ported from
406
+ // the upstream go compat shim - see decision 3 in the header.
407
+ func novalargs(testspec any, sentinel any) (any, bool) {
408
+ if nil == sentinel {
409
+ return testspec, false
410
+ }
411
+
412
+ spec, is := testspec.(map[string]any)
413
+ if !is {
414
+ return testspec, false
415
+ }
416
+
417
+ set, is := spec["set"].([]any)
418
+ if !is {
419
+ return testspec, false
420
+ }
421
+
422
+ found := false
423
+ for _, entry := range set {
424
+ if noargs(entry) {
425
+ found = true
426
+ break
427
+ }
428
+ }
429
+ if !found {
430
+ return testspec, false
431
+ }
432
+
433
+ patched := make([]any, len(set))
434
+ for index, entry := range set {
435
+ if noargs(entry) {
436
+ copied := map[string]any{}
437
+ for key, val := range entry.(map[string]any) {
438
+ copied[key] = val
439
+ }
440
+ copied["args"] = []any{NOVALMARK}
441
+ entry = copied
442
+ }
443
+ patched[index] = entry
444
+ }
445
+
446
+ out := map[string]any{}
447
+ for key, val := range spec {
448
+ out[key] = val
449
+ }
450
+ out["set"] = patched
451
+
452
+ return out, true
453
+ }
454
+
455
+ // NOVALMARK stands in for the port's no-value between novalargs and
456
+ // novalsubject. Deliberately not one of omni's own sentinels: those are
457
+ // meaningful to the runner, and this one must pass through it inert.
458
+ const NOVALMARK = "__OMNIRESOLVER_NOVAL__"
459
+
460
+ // novalsubject swaps the marker back for the real sentinel at the point of
461
+ // call. Only installed for a spec novalargs actually rewrote, so a corpus
462
+ // value that legitimately holds the marker string is never touched.
463
+ func novalsubject(subject Subject, sentinel any, patched bool) Subject {
464
+ if nil == sentinel || nil == subject || !patched {
465
+ return subject
466
+ }
467
+
468
+ return func(args ...any) (any, error) {
469
+ for index, arg := range args {
470
+ if mark, is := arg.(string); is && NOVALMARK == mark {
471
+ args[index] = sentinel
472
+ }
473
+ }
474
+ return subject(args...)
475
+ }
476
+ }
477
+
478
+ func noargs(entry any) bool {
479
+ fields, is := entry.(map[string]any)
480
+ if !is {
481
+ return false
482
+ }
483
+
484
+ for _, key := range []string{"in", "args", "ctx"} {
485
+ if _, has := fields[key]; has {
486
+ return false
487
+ }
488
+ }
489
+
490
+ return true
491
+ }
492
+
493
+ // fixnums: an integral JSON number becomes a Go `int`, on both the spec
494
+ // and the result side. The struct port's API is written in `int`
495
+ // (`Typename(t int)`, `Flatten(list, depths ...int)`), and omni's go
496
+ // runner keeps JSON numbers as float64 - handing a subject a type its
497
+ // signature rejects. omni's DeepEqual compares numbers by value, so the
498
+ // normalisation is invisible to assertions.
499
+ func fixnums(val any) any {
500
+ switch value := val.(type) {
501
+ case float64:
502
+ if value == float64(int(value)) {
503
+ return int(value)
504
+ }
505
+ return val
506
+
507
+ case map[string]any:
508
+ out := make(map[string]any, len(value))
509
+ for key, entry := range value {
510
+ out[key] = fixnums(entry)
511
+ }
512
+ return out
513
+
514
+ case []any:
515
+ out := make([]any, len(value))
516
+ for index, entry := range value {
517
+ out[index] = fixnums(entry)
518
+ }
519
+ return out
520
+
521
+ default:
522
+ return val
523
+ }
524
+ }
525
+
526
+ // subjectify adapts any Go function to omni's calling convention, so a
527
+ // corpus test can pass the library function itself as the subject
528
+ // (voxgigstruct.IsNode is func(any) bool - nothing assigns to
529
+ // omni.Subject without this). Missing arguments become the parameter's
530
+ // zero value, and a (value, error) pair becomes omni's result.
531
+ func subjectify(fn any) Subject {
532
+ if subject, is := fn.(Subject); is {
533
+ return subject
534
+ }
535
+
536
+ fnval := reflect.ValueOf(fn)
537
+ if !fnval.IsValid() || reflect.Func != fnval.Kind() {
538
+ panic("omniresolver: subject is not a function")
539
+ }
540
+
541
+ fntype := fnval.Type()
542
+
543
+ return func(args ...any) (any, error) {
544
+ fixed := fntype.NumIn()
545
+ if fntype.IsVariadic() {
546
+ fixed--
547
+ }
548
+
549
+ if len(args) < fixed {
550
+ extended := make([]any, fixed)
551
+ copy(extended, args)
552
+ args = extended
553
+ }
554
+
555
+ in := make([]reflect.Value, 0, len(args))
556
+
557
+ for index := 0; index < fixed; index++ {
558
+ val, err := callarg(args[index], fntype.In(index), index)
559
+ if nil != err {
560
+ return nil, err
561
+ }
562
+ in = append(in, val)
563
+ }
564
+
565
+ if fntype.IsVariadic() {
566
+ elemtype := fntype.In(fntype.NumIn() - 1).Elem()
567
+ for index := fixed; index < len(args); index++ {
568
+ val, err := callarg(args[index], elemtype, index)
569
+ if nil != err {
570
+ return nil, err
571
+ }
572
+ in = append(in, val)
573
+ }
574
+ }
575
+
576
+ out := fnval.Call(in)
577
+
578
+ switch len(out) {
579
+ case 0:
580
+ return nil, nil
581
+ case 1:
582
+ return fixnums(out[0].Interface()), nil
583
+ case 2:
584
+ err, _ := out[1].Interface().(error)
585
+ return fixnums(out[0].Interface()), err
586
+ default:
587
+ return nil, fmt.Errorf("omniresolver: subject returns too many values (%d)", len(out))
588
+ }
589
+ }
590
+ }
591
+
592
+ func callarg(arg any, paramtype reflect.Type, index int) (reflect.Value, error) {
593
+ if nil == arg {
594
+ return reflect.Zero(paramtype), nil
595
+ }
596
+
597
+ val := reflect.ValueOf(arg)
598
+ if !val.Type().AssignableTo(paramtype) {
599
+ return reflect.Value{}, fmt.Errorf(
600
+ "omniresolver: argument %d type %T not assignable to parameter type %s",
601
+ index, arg, paramtype)
602
+ }
603
+
604
+ return val, nil
605
+ }
606
+
607
+ // omniCtx builds the typed *sdk.Context a generated utility takes from the
608
+ // ctx MAP omni handed the subject (args[0]). The map's `client` entry - an
609
+ // omni provider when a DEF entry selected one - resolves back to the live
610
+ // SDK it wraps; otherwise the given client is used. The engine half of the
611
+ // retired runner_test.go did this as makeCtxFromMap.
612
+ func omniCtx(arg any, client *sdk.ProjectNameSDK, utility *sdk.Utility) *sdk.Context {
613
+ ctxmap, _ := arg.(map[string]any)
614
+ if ctxmap == nil {
615
+ ctxmap = map[string]any{}
616
+ }
617
+
618
+ // Only a DEF-built client overrides the caller's: the base provider is
619
+ // on every ctx entry, and a call site that constructed a special client
620
+ // (a DEF.setup options set) must keep it - the same override the ts
621
+ // subjects perform by assigning ctx.client after contextify.
622
+ if provider, is := ctxmap["client"].(*omni.Provider); is {
623
+ if live, is := defproviderclient(provider).(*sdk.ProjectNameSDK); is {
624
+ client = live
625
+ utility = live.GetUtility()
626
+ }
627
+ }
628
+
629
+ ctx := sdk.NewContext(ctxmap, nil)
630
+
631
+ if client != nil {
632
+ ctx.Client = client
633
+ ctx.Utility = utility
634
+ }
635
+ if ctx.Options == nil && client != nil {
636
+ ctx.Options = client.OptionsMap()
637
+ }
638
+
639
+ // Handle spec from JSON map (NewContext expects *Spec, but JSON gives map)
640
+ if specMap, ok := ctxmap["spec"].(map[string]any); ok {
641
+ ctx.Spec = sdk.NewSpec(specMap)
642
+ }
643
+
644
+ // Handle result from JSON map
645
+ if resMap, ok := ctxmap["result"].(map[string]any); ok {
646
+ ctx.Result = sdk.NewResult(resMap)
647
+ if errMap, ok := resMap["err"].(map[string]any); ok {
648
+ if msg, ok := errMap["message"].(string); ok {
649
+ ctx.Result.Err = &sdk.ProjectNameError{Msg: msg}
650
+ }
651
+ }
652
+ }
653
+
654
+ // Handle response from JSON map
655
+ if respMap, ok := ctxmap["response"].(map[string]any); ok {
656
+ ctx.Response = sdk.NewResponse(respMap)
657
+ if body := respMap["body"]; body != nil {
658
+ bodyCopy := body
659
+ ctx.Response.JsonFunc = func() any { return bodyCopy }
660
+ }
661
+ if headers, ok := respMap["headers"].(map[string]any); ok {
662
+ lowerHeaders := map[string]any{}
663
+ for k, v := range headers {
664
+ lowerHeaders[strings.ToLower(k)] = v
665
+ }
666
+ ctx.Response.Headers = lowerHeaders
667
+ }
668
+ }
669
+
670
+ return ctx
671
+ }
672
+
673
+ // omniSyncCtx writes the OBSERVABLE state of a typed context back into the
674
+ // ctx map the entry holds, which is where a `match: {ctx: ...}` assertion
675
+ // reads. The subject mutated the typed context; the map is what the runner
676
+ // can walk. (The retired engine did this per section, by hand, as "update
677
+ // entry ctx for match".)
678
+ func omniSyncCtx(arg any, ctx *sdk.Context) {
679
+ ctxmap, _ := arg.(map[string]any)
680
+ if ctxmap == nil || ctx == nil {
681
+ return
682
+ }
683
+
684
+ if ctx.Spec != nil {
685
+ spec := map[string]any{
686
+ "base": ctx.Spec.Base,
687
+ "prefix": ctx.Spec.Prefix,
688
+ "suffix": ctx.Spec.Suffix,
689
+ "path": ctx.Spec.Path,
690
+ "method": ctx.Spec.Method,
691
+ "params": ctx.Spec.Params,
692
+ "query": ctx.Spec.Query,
693
+ "headers": ctx.Spec.Headers,
694
+ "step": ctx.Spec.Step,
695
+ "alias": ctx.Spec.Alias,
696
+ }
697
+ if ctx.Spec.Body != nil {
698
+ spec["body"] = ctx.Spec.Body
699
+ }
700
+ if ctx.Spec.Url != "" {
701
+ spec["url"] = ctx.Spec.Url
702
+ }
703
+ ctxmap["spec"] = spec
704
+ }
705
+
706
+ if ctx.Result != nil {
707
+ res := map[string]any{
708
+ "ok": ctx.Result.Ok,
709
+ "status": ctx.Result.Status,
710
+ "statusText": ctx.Result.StatusText,
711
+ "headers": ctx.Result.Headers,
712
+ }
713
+ if ctx.Result.Body != nil {
714
+ res["body"] = ctx.Result.Body
715
+ }
716
+ if ctx.Result.Err != nil {
717
+ res["err"] = map[string]any{
718
+ "message": ctx.Result.Err.Error(),
719
+ }
720
+ }
721
+ if ctx.Result.Resdata != nil {
722
+ res["resdata"] = ctx.Result.Resdata
723
+ }
724
+ if ctx.Result.Resmatch != nil {
725
+ res["resmatch"] = ctx.Result.Resmatch
726
+ }
727
+ ctxmap["result"] = res
728
+ }
729
+
730
+ if ctx.Response != nil {
731
+ ctxmap["response"] = "exists"
732
+ }
733
+ }
734
+
735
+ // omniErrArg turns a corpus argument shaped {"message": ..., "code": ...}
736
+ // into an SDK error value (the retired engine's errFromMap).
737
+ func omniErrArg(arg any) error {
738
+ m, _ := arg.(map[string]any)
739
+ if m == nil {
740
+ return nil
741
+ }
742
+ msg, _ := m["message"].(string)
743
+ if msg == "" {
744
+ return nil
745
+ }
746
+ code, _ := m["code"].(string)
747
+ return &sdk.ProjectNameError{Msg: msg, Code: code}
748
+ }