@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.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin 0.1.6 (go/plugin/order.go)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 8d8968afc0a2008fbd795b41ab166307d989f02a [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Ordering (§7) — one rule, one place.
|
|
5
|
+
*
|
|
6
|
+
* sdkgen grew two special cases in `makeOptions` (`test`, then
|
|
7
|
+
* `station`) and the third was not far off. This sort is the whole
|
|
8
|
+
* replacement, and the tiers are in this order for a reason:
|
|
9
|
+
*
|
|
10
|
+
* 1 constraints before/after edges, by ref or by name
|
|
11
|
+
* 2 bands integer, lower first, default 0
|
|
12
|
+
* 3 declaration ties break by `pos`
|
|
13
|
+
*
|
|
14
|
+
* CONSTRAINTS BEAT BANDS precisely so the correct tool wins when both
|
|
15
|
+
* are present. A band expresses a genuine cross-cutting layer; a
|
|
16
|
+
* constraint expresses a relationship between two specific things; and a
|
|
17
|
+
* band chosen by trial and error to fix an ordering bug is a bug wearing
|
|
18
|
+
* a number. */
|
|
19
|
+
|
|
20
|
+
package plugin
|
|
21
|
+
|
|
22
|
+
import (
|
|
23
|
+
"sort"
|
|
24
|
+
"strings"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
type Binding struct {
|
|
28
|
+
Ref string `json:"ref"`
|
|
29
|
+
Pos int `json:"pos"`
|
|
30
|
+
Order *OrderBlock `json:"order,omitempty"`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Pin is where a host has pinned a binding. Positional, not ordinal:
|
|
34
|
+
// §6.2 composes b1(b2(b3(base))) with the FIRST binding OUTERMOST, so
|
|
35
|
+
// `first` and `innermost` are opposites, and a pin spelled in sort terms
|
|
36
|
+
// would be read backwards by exactly the people it protects.
|
|
37
|
+
type Pin map[string]string
|
|
38
|
+
|
|
39
|
+
func ResolveOrder(bindings []Binding, pin Pin) ([]string, error) {
|
|
40
|
+
nodes := append([]Binding{}, bindings...)
|
|
41
|
+
byref := map[string]Binding{}
|
|
42
|
+
for _, b := range nodes {
|
|
43
|
+
byref[b.Ref] = b
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Constraints are edges. A constraint naming an ABSENT binding is
|
|
47
|
+
// satisfied VACUOUSLY (§7) — a plugin ordered `after: 'test'` must
|
|
48
|
+
// load in a host with no test plugin. That is sdkgen's __after__
|
|
49
|
+
// behaviour, kept.
|
|
50
|
+
edges := map[string][]string{}
|
|
51
|
+
for _, b := range nodes {
|
|
52
|
+
edges[b.Ref] = []string{}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
for _, b := range nodes {
|
|
56
|
+
if nil == b.Order {
|
|
57
|
+
continue
|
|
58
|
+
}
|
|
59
|
+
// An ABSENT constraint and an EMPTY LIST are both "no constraint".
|
|
60
|
+
if declared(b.Order.After) {
|
|
61
|
+
for _, t := range targets(b.Order.After, nodes) {
|
|
62
|
+
edges[t] = append(edges[t], b.Ref)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if declared(b.Order.Before) {
|
|
66
|
+
for _, t := range targets(b.Order.Before, nodes) {
|
|
67
|
+
edges[b.Ref] = append(edges[b.Ref], t)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Stable topological sort. Among ready nodes, band first (lower runs
|
|
73
|
+
// first), then `pos` — the position the DOCUMENT visibly states, not
|
|
74
|
+
// the order instances happened to load and not the incarnation `seq`.
|
|
75
|
+
indeg := map[string]int{}
|
|
76
|
+
for _, b := range nodes {
|
|
77
|
+
indeg[b.Ref] = 0
|
|
78
|
+
}
|
|
79
|
+
for _, from := range sortedkeys(edges) {
|
|
80
|
+
for _, to := range edges[from] {
|
|
81
|
+
indeg[to] = indeg[to] + 1
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
out := []string{}
|
|
86
|
+
ready := []Binding{}
|
|
87
|
+
for _, b := range nodes {
|
|
88
|
+
if 0 == indeg[b.Ref] {
|
|
89
|
+
ready = append(ready, b)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for 0 < len(ready) {
|
|
94
|
+
sort.SliceStable(ready, rankless(ready))
|
|
95
|
+
next := ready[0]
|
|
96
|
+
ready = ready[1:]
|
|
97
|
+
out = append(out, next.Ref)
|
|
98
|
+
for _, to := range edges[next.Ref] {
|
|
99
|
+
indeg[to] = indeg[to] - 1
|
|
100
|
+
if 0 == indeg[to] {
|
|
101
|
+
ready = append(ready, byref[to])
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if len(out) != len(nodes) {
|
|
107
|
+
stuck := []string{}
|
|
108
|
+
for _, b := range nodes {
|
|
109
|
+
if !hasstring(out, b.Ref) {
|
|
110
|
+
stuck = append(stuck, b.Ref)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return nil, Fail("plugin_order_cycle",
|
|
114
|
+
"before/after constraints cycle: "+strings.Join(stuck, " -> "),
|
|
115
|
+
map[string]any{"cycle": stuck})
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return applypin(out, edges, pin)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
func rankless(l []Binding) func(i, j int) bool {
|
|
122
|
+
return func(i, j int) bool {
|
|
123
|
+
a, b := l[i], l[j]
|
|
124
|
+
if ab, bb := band(a), band(b); ab != bb {
|
|
125
|
+
return ab < bb
|
|
126
|
+
}
|
|
127
|
+
return a.Pos < b.Pos
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
func band(b Binding) int {
|
|
132
|
+
if nil == b.Order || nil == b.Order.Band {
|
|
133
|
+
return 0
|
|
134
|
+
}
|
|
135
|
+
return *b.Order.Band
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// targets: matching is by REF, or by NAME across all of that
|
|
139
|
+
// definition's instances (§7) — which is the whole reason the two
|
|
140
|
+
// spellings exist.
|
|
141
|
+
func targets(spec OrderRef, nodes []Binding) []string {
|
|
142
|
+
hit := []string{}
|
|
143
|
+
// A list fans out to the UNION of what each spelling names, so
|
|
144
|
+
// `after: ['a','b']` means after BOTH, and the same instance named
|
|
145
|
+
// twice - once by name, once by ref - is one edge, not two.
|
|
146
|
+
for _, one := range spec.list {
|
|
147
|
+
for _, b := range nodes {
|
|
148
|
+
if seen(hit, b.Ref) {
|
|
149
|
+
continue
|
|
150
|
+
}
|
|
151
|
+
if b.Ref == one {
|
|
152
|
+
hit = append(hit, b.Ref)
|
|
153
|
+
continue
|
|
154
|
+
}
|
|
155
|
+
if refname(b.Ref) == one {
|
|
156
|
+
hit = append(hit, b.Ref)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return hit
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// declared: was a constraint actually stated? An empty list is not one.
|
|
164
|
+
func declared(spec OrderRef) bool {
|
|
165
|
+
for _, one := range spec.list {
|
|
166
|
+
if "" != one {
|
|
167
|
+
return true
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return false
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
func seen(hit []string, ref string) bool {
|
|
174
|
+
for _, h := range hit {
|
|
175
|
+
if h == ref {
|
|
176
|
+
return true
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return false
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* A PIN IS NOT A CONSTRAINT (§7).
|
|
183
|
+
*
|
|
184
|
+
* Constraints and bands are negotiable by definition — they are what
|
|
185
|
+
* plugins and documents say they want, and the sort's job is to satisfy
|
|
186
|
+
* them all. A pin is the host stating a structural invariant of its own
|
|
187
|
+
* architecture, which is a different kind of claim and must not lose a
|
|
188
|
+
* tie to a document.
|
|
189
|
+
*
|
|
190
|
+
* So a pin PLACES the binding at the named end, and an ordering that
|
|
191
|
+
* would move it away is `plugin_order_pinned` — rejected, not honoured
|
|
192
|
+
* into a broken wrap. Station's transport adapter must sit immediately
|
|
193
|
+
* outside the base transport; an `order` list that moves it has to be an
|
|
194
|
+
* error rather than a preference. */
|
|
195
|
+
func applypin(order []string, edges map[string][]string, pin Pin) ([]string, error) {
|
|
196
|
+
if nil == pin {
|
|
197
|
+
return order, nil
|
|
198
|
+
}
|
|
199
|
+
out := append([]string{}, order...)
|
|
200
|
+
|
|
201
|
+
for _, name := range sortedkeys(pin) {
|
|
202
|
+
want := pin[name]
|
|
203
|
+
idx := -1
|
|
204
|
+
for i, r := range out {
|
|
205
|
+
if refname(r) == name {
|
|
206
|
+
idx = i
|
|
207
|
+
break
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if -1 == idx {
|
|
211
|
+
continue
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// `first`/`outermost` is index 0; `last`/`innermost` is the end.
|
|
215
|
+
// §6.2 makes the first chain binding outermost, which is why the
|
|
216
|
+
// vocabulary is positional and why the two spellings pair this
|
|
217
|
+
// way.
|
|
218
|
+
wantfirst := "first" == want || "outermost" == want
|
|
219
|
+
ref := out[idx]
|
|
220
|
+
out = append(out[:idx], out[idx+1:]...)
|
|
221
|
+
if wantfirst {
|
|
222
|
+
out = append([]string{ref}, out...)
|
|
223
|
+
} else {
|
|
224
|
+
out = append(out, ref)
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Now check that the placement did not break a constraint. This is
|
|
229
|
+
// the half that makes a pin a rejection rather than an override: the
|
|
230
|
+
// host wins on position, but it does not get to silently discard a
|
|
231
|
+
// relationship a plugin declared.
|
|
232
|
+
at := map[string]int{}
|
|
233
|
+
for i, r := range out {
|
|
234
|
+
at[r] = i
|
|
235
|
+
}
|
|
236
|
+
for _, from := range sortedkeys(edges) {
|
|
237
|
+
for _, to := range edges[from] {
|
|
238
|
+
if at[from] > at[to] {
|
|
239
|
+
return nil, Fail("plugin_order_pinned",
|
|
240
|
+
"a pin would move a binding an ordering constrains: "+
|
|
241
|
+
from+" must precede "+to,
|
|
242
|
+
map[string]any{"before": from, "after": to})
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return out, nil
|
|
248
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin 0.1.6 (go/plugin/point.go)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 8d8968afc0a2008fbd795b41ab166307d989f02a [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Extension points (§6). Three kinds, chosen because they are what the
|
|
5
|
+
* two existing systems actually needed, and no more.
|
|
6
|
+
*
|
|
7
|
+
* A PLUGIN NEVER MUTATES THE HOST. That inversion is what makes
|
|
8
|
+
* deactivation possible: sdkgen's `utility.fetcher = wrapped` is not
|
|
9
|
+
* undoable, but "this instance holds slot 3 of the request chain" is
|
|
10
|
+
* undoable in O(1). OSGi named it the whiteboard pattern in 2004, in a
|
|
11
|
+
* paper called *Listeners Considered Harmful*, and for exactly this
|
|
12
|
+
* reason. */
|
|
13
|
+
|
|
14
|
+
package plugin
|
|
15
|
+
|
|
16
|
+
import "sort"
|
|
17
|
+
|
|
18
|
+
type Kind string
|
|
19
|
+
|
|
20
|
+
const (
|
|
21
|
+
KindHook Kind = "hook"
|
|
22
|
+
KindChain Kind = "chain"
|
|
23
|
+
KindProvider Kind = "provider"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// Mode is §6.1: "fan-out" is not one answer but four. In a language with
|
|
27
|
+
// asynchrony, "call every binding" hides a decision — start them all and
|
|
28
|
+
// wait, await each in turn, or do not wait — and a design that leaves it
|
|
29
|
+
// unsaid gets four different answers from four ports, in the concurrency
|
|
30
|
+
// behaviour of production code no corpus entry happens to cover.
|
|
31
|
+
type Mode string
|
|
32
|
+
|
|
33
|
+
const (
|
|
34
|
+
ModeEmit Mode = "emit"
|
|
35
|
+
ModeParallel Mode = "parallel"
|
|
36
|
+
ModeSerial Mode = "serial"
|
|
37
|
+
ModeBail Mode = "bail"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
/* BindFn IS ONE TYPE FOR ALL THREE KINDS, AND THAT IS A PORT DECISION
|
|
41
|
+
* WORTH STATING.
|
|
42
|
+
*
|
|
43
|
+
* The canonical calls `fn(arg)` for a hook, `fn(next, ...args)` for a
|
|
44
|
+
* chain and `fn(...args)` for a provider — three arities on one
|
|
45
|
+
* untyped slot. Go could give each kind its own func type, but then
|
|
46
|
+
* `bind` needs three spellings and a probe that binds the same
|
|
47
|
+
* function to a hook point in one corpus entry and a provider point in
|
|
48
|
+
* the next (which `point/bail` and `point/provider` do, with the same
|
|
49
|
+
* `provider` probe) could not be written at all.
|
|
50
|
+
*
|
|
51
|
+
* So one variadic signature carries all three, and a chain's `next` is
|
|
52
|
+
* simply its first argument — exactly as in the canonical.
|
|
53
|
+
*
|
|
54
|
+
* A BINDING CANNOT RAISE IN GO. It RETURNS an error value instead, and
|
|
55
|
+
* §6.1's collecting modes gather those. */
|
|
56
|
+
type BindFn func(args ...any) any
|
|
57
|
+
|
|
58
|
+
type Spec struct {
|
|
59
|
+
Kind Kind `json:"kind,omitempty"`
|
|
60
|
+
Mode Mode `json:"mode,omitempty"`
|
|
61
|
+
// Base is `chain` only: the host owns the base, and a plugin cannot
|
|
62
|
+
// replace it (§6.2). One that wants to SUBSTITUTE rather than wrap
|
|
63
|
+
// binds innermost and simply does not call `next`.
|
|
64
|
+
Base BindFn `json:"-"`
|
|
65
|
+
// Exclusive is `provider` only: a second binding is an error rather
|
|
66
|
+
// than a shadow.
|
|
67
|
+
Exclusive bool `json:"exclusive,omitempty"`
|
|
68
|
+
// Default is `provider` only: the host's fallback.
|
|
69
|
+
Default any `json:"default,omitempty"`
|
|
70
|
+
Pin Pin `json:"pin,omitempty"`
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type Bound struct {
|
|
74
|
+
Ref string
|
|
75
|
+
Point string
|
|
76
|
+
Fn BindFn
|
|
77
|
+
// Band: `provider` ranks by HIGHEST band, unlike hook and chain
|
|
78
|
+
// which run lowest first. Kept as declared so the two rules stay
|
|
79
|
+
// visibly different rather than one being derived from the other by
|
|
80
|
+
// a reader who then gets it backwards.
|
|
81
|
+
Band int
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Emit is fan-out. Return values are ignored except in `bail`.
|
|
85
|
+
//
|
|
86
|
+
// The second return is the canonical's synchronous throw under
|
|
87
|
+
// `mode: emit`; the first is the collected error list under the
|
|
88
|
+
// gathering modes, and the bailing value under `bail`.
|
|
89
|
+
func Emit(bindings []Bound, mode Mode, arg any) (any, error) {
|
|
90
|
+
if ModeBail == mode {
|
|
91
|
+
// Stops at the first binding that RETURNS A VALUE — the
|
|
92
|
+
// "handled, stop" case. A NIL RETURN DECLINES (§6.1): go has one
|
|
93
|
+
// way to say nothing, and the model's rule is written to that
|
|
94
|
+
// rather than to JavaScript's null/undefined pair.
|
|
95
|
+
for _, b := range bindings {
|
|
96
|
+
if v := b.Fn(arg); nil != v {
|
|
97
|
+
if err, bad := v.(error); bad {
|
|
98
|
+
return nil, err
|
|
99
|
+
}
|
|
100
|
+
return v, nil
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return nil, nil
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
errors := []any{}
|
|
107
|
+
for _, b := range bindings {
|
|
108
|
+
v := b.Fn(arg)
|
|
109
|
+
err, bad := v.(error)
|
|
110
|
+
if !bad {
|
|
111
|
+
continue
|
|
112
|
+
}
|
|
113
|
+
// `emit` raises synchronously; the collecting modes gather.
|
|
114
|
+
if ModeEmit == mode {
|
|
115
|
+
return nil, err
|
|
116
|
+
}
|
|
117
|
+
errors = append(errors, err)
|
|
118
|
+
}
|
|
119
|
+
if ModeEmit == mode {
|
|
120
|
+
return nil, nil
|
|
121
|
+
}
|
|
122
|
+
return errors, nil
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Compose is b1(b2(b3(base))), FIRST BINDING OUTERMOST (§6.2).
|
|
126
|
+
//
|
|
127
|
+
// Recomputed by the host whenever the live set changes, and cached
|
|
128
|
+
// between changes. Plugins receive `next` as an argument; they never see
|
|
129
|
+
// or store the previous value of anything. A plugin that stashes `next`
|
|
130
|
+
// and calls it after deactivation is a bug the host cannot prevent, and
|
|
131
|
+
// this says so rather than pretending otherwise.
|
|
132
|
+
func Compose(bindings []Bound, base BindFn) BindFn {
|
|
133
|
+
next := base
|
|
134
|
+
for i := len(bindings) - 1; 0 <= i; i-- {
|
|
135
|
+
fn := bindings[i].Fn
|
|
136
|
+
inner := next
|
|
137
|
+
next = func(args ...any) any {
|
|
138
|
+
return fn(append([]any{inner}, args...)...)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return next
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
type Picked struct {
|
|
145
|
+
Winner *Bound
|
|
146
|
+
Shadowed []string
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Provider selects at most one live implementation (§6.3). The winner is
|
|
150
|
+
// the highest band, ties broken by ref sort, and THE LOSERS ARE VISIBLE
|
|
151
|
+
// rather than silently ignored.
|
|
152
|
+
func Provider(bindings []Bound, spec Spec) (Picked, error) {
|
|
153
|
+
if 0 == len(bindings) {
|
|
154
|
+
return Picked{Shadowed: []string{}}, nil
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if spec.Exclusive && 1 < len(bindings) {
|
|
158
|
+
refs := []string{}
|
|
159
|
+
for _, b := range bindings {
|
|
160
|
+
refs = append(refs, b.Ref)
|
|
161
|
+
}
|
|
162
|
+
sort.Strings(refs)
|
|
163
|
+
return Picked{}, Fail("plugin_point_exclusive",
|
|
164
|
+
"point is exclusive and has "+itoa(len(bindings))+" bindings: "+
|
|
165
|
+
join(refs, ", "),
|
|
166
|
+
map[string]any{"refs": refs})
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
ranked := append([]Bound{}, bindings...)
|
|
170
|
+
sort.SliceStable(ranked, func(i, j int) bool {
|
|
171
|
+
a, b := ranked[i], ranked[j]
|
|
172
|
+
if a.Band != b.Band {
|
|
173
|
+
return a.Band > b.Band // HIGHEST band wins
|
|
174
|
+
}
|
|
175
|
+
return a.Ref < b.Ref
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
shadowed := []string{}
|
|
179
|
+
for _, b := range ranked[1:] {
|
|
180
|
+
shadowed = append(shadowed, b.Ref)
|
|
181
|
+
}
|
|
182
|
+
winner := ranked[0]
|
|
183
|
+
return Picked{Winner: &winner, Shadowed: shadowed}, nil
|
|
184
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin 0.1.6 (go/plugin/ref.go)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 8d8968afc0a2008fbd795b41ab166307d989f02a [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Identity: name+tag, written `name$tag` (§4).
|
|
5
|
+
*
|
|
6
|
+
* The four pure functions, and the whole of what `ref` pins. They are
|
|
7
|
+
* the first thing a new port implements and the first corpus section it
|
|
8
|
+
* passes. */
|
|
9
|
+
|
|
10
|
+
package plugin
|
|
11
|
+
|
|
12
|
+
import (
|
|
13
|
+
"regexp"
|
|
14
|
+
"strings"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
// §4: `^[a-zA-Z@][a-zA-Z0-9.~_\-/]*$`, max 1024.
|
|
18
|
+
var nameRe = regexp.MustCompile(`^[a-zA-Z@][a-zA-Z0-9.~_\-/]*$`)
|
|
19
|
+
|
|
20
|
+
// §4: `^[a-zA-Z0-9.~_-]+$`, max 1024, or empty.
|
|
21
|
+
//
|
|
22
|
+
// The asymmetry with a name is deliberate: a tag MAY start with a digit
|
|
23
|
+
// because auto-tagging assigns integer tags (`stripe$1`), and a tag
|
|
24
|
+
// admits neither `@` nor `/` because a name is a package specifier and a
|
|
25
|
+
// tag is not.
|
|
26
|
+
var tagRe = regexp.MustCompile(`^[a-zA-Z0-9.~_-]+$`)
|
|
27
|
+
|
|
28
|
+
const refMax = 1024
|
|
29
|
+
|
|
30
|
+
func CheckName(name string) bool {
|
|
31
|
+
if 0 == len(name) || refMax < len(name) {
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
return nameRe.MatchString(name)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
func CheckTag(tag string) bool {
|
|
38
|
+
// The empty tag is an ordinary tag (§4 rule 2). The single-instance
|
|
39
|
+
// case writes no tag and never learns tags exist.
|
|
40
|
+
if 0 == len(tag) {
|
|
41
|
+
return true
|
|
42
|
+
}
|
|
43
|
+
if refMax < len(tag) {
|
|
44
|
+
return false
|
|
45
|
+
}
|
|
46
|
+
return tagRe.MatchString(tag)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ParseRef turns `name$tag` into the pair. Canonicalizing: `stripe$` and
|
|
50
|
+
// `stripe` both give tag "".
|
|
51
|
+
func ParseRef(str string) (Ref, error) {
|
|
52
|
+
// Split on the FIRST `$`. Nothing in the grammar decides this — `$`
|
|
53
|
+
// is in neither character class — so the corpus is the arbiter (§4
|
|
54
|
+
// rule 5), and it picks the split that blames the part actually at
|
|
55
|
+
// fault: `a$b$c` is a good name with a bad tag, not the reverse.
|
|
56
|
+
name := str
|
|
57
|
+
tag := ""
|
|
58
|
+
if cut := strings.Index(str, "$"); -1 != cut {
|
|
59
|
+
name = str[:cut]
|
|
60
|
+
tag = str[cut+1:]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if !CheckName(name) {
|
|
64
|
+
return Ref{}, Fail("plugin_bad_name", "invalid plugin name: "+name,
|
|
65
|
+
map[string]any{"name": name})
|
|
66
|
+
}
|
|
67
|
+
if !CheckTag(tag) {
|
|
68
|
+
return Ref{}, Fail("plugin_bad_tag", "invalid plugin tag: "+tag,
|
|
69
|
+
map[string]any{"name": name, "tag": tag})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return Ref{Name: name, Tag: tag}, nil
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// FormatRef turns the pair into `name$tag`. An empty tag NEVER writes
|
|
76
|
+
// the separator, which is the half of canonicalization FormatRef owns:
|
|
77
|
+
// parse tolerates `stripe$`, format never produces it, so a round trip
|
|
78
|
+
// is idempotent.
|
|
79
|
+
func FormatRef(name string, tag string) (string, error) {
|
|
80
|
+
if !CheckName(name) {
|
|
81
|
+
return "", Fail("plugin_bad_name", "invalid plugin name: "+name,
|
|
82
|
+
map[string]any{"name": name})
|
|
83
|
+
}
|
|
84
|
+
if !CheckTag(tag) {
|
|
85
|
+
return "", Fail("plugin_bad_tag", "invalid plugin tag: "+tag,
|
|
86
|
+
map[string]any{"name": name, "tag": tag})
|
|
87
|
+
}
|
|
88
|
+
if "" == tag {
|
|
89
|
+
return name, nil
|
|
90
|
+
}
|
|
91
|
+
return name + "$" + tag, nil
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// CanonRef is the canonical spelling of a ref. §4 rule 5: ports must
|
|
95
|
+
// canonicalize before comparison.
|
|
96
|
+
func CanonRef(str string) (string, error) {
|
|
97
|
+
r, err := ParseRef(str)
|
|
98
|
+
if nil != err {
|
|
99
|
+
return "", err
|
|
100
|
+
}
|
|
101
|
+
return FormatRef(r.Name, r.Tag)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// canon is CanonRef for the many internal callers that have already
|
|
105
|
+
// established the ref is well formed, or that want the input back
|
|
106
|
+
// unchanged when it is not. NEVER use it where a bad ref must be
|
|
107
|
+
// reported — the corpus pins plugin_bad_name at every public entry.
|
|
108
|
+
func canon(str string) string {
|
|
109
|
+
c, err := CanonRef(str)
|
|
110
|
+
if nil != err {
|
|
111
|
+
return str
|
|
112
|
+
}
|
|
113
|
+
return c
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// refname is the name half, for the internal callers that only compare.
|
|
117
|
+
func refname(str string) string {
|
|
118
|
+
r, err := ParseRef(str)
|
|
119
|
+
if nil != err {
|
|
120
|
+
return str
|
|
121
|
+
}
|
|
122
|
+
return r.Name
|
|
123
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin 0.1.6 (go/plugin/resolve.go)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 8d8968afc0a2008fbd795b41ab166307d989f02a [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Dynamic resolution (§10.2) — name to candidate module ids.
|
|
5
|
+
*
|
|
6
|
+
* PURE. It returns the ids a host WOULD try, in order; it does not load
|
|
7
|
+
* anything. That separation is what lets the corpus pin resolution in
|
|
8
|
+
* every language including those with no dynamic loading at all, and it
|
|
9
|
+
* is why §15.4 puts real module loading in per-port integration tests
|
|
10
|
+
* rather than here.
|
|
11
|
+
*
|
|
12
|
+
* GO IS TIER S (§10.3): static-only, registration through `init()` or
|
|
13
|
+
* an explicit list handed to MakeHost. That changes nothing here —
|
|
14
|
+
* candidate generation is what the corpus pins, and a port with no
|
|
15
|
+
* dynamic loading at all still answers it identically. */
|
|
16
|
+
|
|
17
|
+
package plugin
|
|
18
|
+
|
|
19
|
+
import "strings"
|
|
20
|
+
|
|
21
|
+
type Source struct {
|
|
22
|
+
Kind string `json:"kind"`
|
|
23
|
+
Prefix []string `json:"prefix,omitempty"`
|
|
24
|
+
Dir string `json:"dir,omitempty"`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
func ResolveCandidates(name string, sources []Source) []string {
|
|
28
|
+
out := []string{}
|
|
29
|
+
|
|
30
|
+
// A SCOPED NAME RESOLVES VERBATIM ONLY (§10.2). `@acme/thing` is
|
|
31
|
+
// already a package id; prefixing it produces
|
|
32
|
+
// `@voxgig/plugin-@acme/thing`, which is not a thing that can exist.
|
|
33
|
+
if strings.HasPrefix(name, "@") {
|
|
34
|
+
return []string{name}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
list := sources
|
|
38
|
+
if 0 == len(list) {
|
|
39
|
+
list = defaultSources
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for _, src := range list {
|
|
43
|
+
if "module" == src.Kind {
|
|
44
|
+
prefixes := src.Prefix
|
|
45
|
+
if 0 == len(prefixes) {
|
|
46
|
+
prefixes = []string{""}
|
|
47
|
+
}
|
|
48
|
+
for _, p := range prefixes {
|
|
49
|
+
if id := p + name; !hasstring(out, id) {
|
|
50
|
+
out = append(out, id)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
} else if "path" == src.Kind {
|
|
54
|
+
if id := strings.TrimRight(src.Dir, "/") + "/" + name; !hasstring(out, id) {
|
|
55
|
+
out = append(out, id)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return out
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var defaultSources = []Source{
|
|
64
|
+
{Kind: "module", Prefix: []string{"@voxgig/plugin-", "voxgig-plugin-", "plugin-", ""}},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ResolveFrom: A MODULE PATH IS NOT A NAME (§10.2). The ref grammar
|
|
68
|
+
// starts a name with a letter or `@`, so `./local/thing` is not a ref
|
|
69
|
+
// and never reaches candidate generation — seneca allows a path where a
|
|
70
|
+
// plugin name goes, and this design deliberately does not, because a ref
|
|
71
|
+
// is an ADDRESS WITHIN A HOST and a path is a LOCATION ON A DISK.
|
|
72
|
+
//
|
|
73
|
+
// Loading from an explicit location is a separate field that bypasses
|
|
74
|
+
// candidate generation entirely: `from` is passed to the resolver
|
|
75
|
+
// verbatim, and a resolver that cannot honour a location raises
|
|
76
|
+
// plugin_resolve_failed.
|
|
77
|
+
func ResolveFrom(from string) []string {
|
|
78
|
+
return []string{from}
|
|
79
|
+
}
|