@voxgig/sdkgen 4.9.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/manifest.d.ts +2 -1
- package/dist/helpers/manifest.js +75 -1
- package/dist/helpers/manifest.js.map +1 -1
- package/dist/helpers/modelNames.d.ts +7 -0
- package/dist/helpers/modelNames.js +232 -0
- package/dist/helpers/modelNames.js.map +1 -0
- package/dist/helpers/naming.d.ts +2 -1
- package/dist/helpers/naming.js +45 -1
- package/dist/helpers/naming.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -2
- package/dist/sdkgen.js +12 -3
- package/dist/sdkgen.js.map +1 -1
- package/dist/testkit.d.ts +2 -0
- package/dist/testkit.js +80 -24
- package/dist/testkit.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.js +17 -7
- package/dist/utility.js.map +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +671 -0
- package/project/.sdk/model/target/clojure.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +5 -0
- package/project/.sdk/model/target/elixir.aon +6 -0
- package/project/.sdk/model/target/java.aon +5 -0
- package/project/.sdk/model/target/js.aon +5 -0
- package/project/.sdk/model/target/kotlin.aon +7 -0
- package/project/.sdk/model/target/perl.aon +5 -0
- package/project/.sdk/model/target/php.aon +5 -0
- package/project/.sdk/model/target/rb.aon +5 -0
- package/project/.sdk/model/target/rust.aon +5 -0
- package/project/.sdk/model/target/scala.aon +38 -2
- package/project/.sdk/model/target/swift.aon +10 -0
- package/project/.sdk/src/cmp/clojure/Config_clojure.ts +51 -4
- package/project/.sdk/src/cmp/clojure/Main_clojure.ts +43 -1
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +17 -1
- package/project/.sdk/src/cmp/clojure/featureextra_clojure.ts +130 -0
- package/project/.sdk/src/cmp/csharp/Config_csharp.ts +70 -0
- package/project/.sdk/src/cmp/csharp/Main_csharp.ts +9 -1
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +25 -1
- package/project/.sdk/src/cmp/elixir/Config_elixir.ts +68 -2
- package/project/.sdk/src/cmp/elixir/Main_elixir.ts +16 -0
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +14 -1
- package/project/.sdk/src/cmp/java/Config_java.ts +84 -2
- package/project/.sdk/src/cmp/java/Main_java.ts +10 -1
- package/project/.sdk/src/cmp/js/Config_js.ts +75 -8
- package/project/.sdk/src/cmp/js/Main_js.ts +66 -2
- package/project/.sdk/src/cmp/js/fragment/Config.data.fragment.js +18 -1
- package/project/.sdk/src/cmp/js/fragment/Config.fragment.js +18 -1
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +7 -0
- package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +63 -1
- package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +32 -2
- package/project/.sdk/src/cmp/perl/Config_perl.ts +129 -3
- package/project/.sdk/src/cmp/perl/Main_perl.ts +41 -1
- package/project/.sdk/src/cmp/perl/Package_perl.ts +13 -1
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +1 -0
- package/project/.sdk/src/cmp/php/Config_php.ts +105 -1
- package/project/.sdk/src/cmp/php/Gitignore_php.ts +4 -2
- package/project/.sdk/src/cmp/php/Main_php.ts +16 -1
- package/project/.sdk/src/cmp/rb/Config_rb.ts +92 -2
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +11 -1
- package/project/.sdk/src/cmp/rb/Main_rb.ts +7 -1
- package/project/.sdk/src/cmp/rust/Main_rust.ts +99 -1
- package/project/.sdk/src/cmp/rust/Package_rust.ts +72 -6
- package/project/.sdk/src/cmp/scala/Config_scala.ts +44 -0
- package/project/.sdk/src/cmp/scala/Main_scala.ts +68 -1
- package/project/.sdk/src/cmp/swift/Config_swift.ts +62 -1
- package/project/.sdk/src/cmp/swift/Main_swift.ts +35 -1
- package/project/.sdk/src/cmp/swift/Package_swift.ts +81 -11
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +58 -44
- package/project/.sdk/src/cmp/swift/utility_swift.ts +22 -0
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +2 -2
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +2 -2
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +2 -2
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +2 -2
- package/project/.sdk/tm/clojure/Makefile +3 -0
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +503 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/capability.clj +84 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/catalog.clj +44 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/config.clj +240 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/depend.clj +199 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/env.clj +111 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/export.clj +46 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/graph.clj +122 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/host.clj +1018 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/json.clj +106 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/order.clj +157 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/point.clj +77 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/ref.clj +92 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/resolve.clj +46 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/types.clj +177 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/version.clj +90 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin.clj +40 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/addr.clj +111 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/chain.clj +297 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/core.clj +192 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/json.clj +261 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/aws.clj +165 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/azuresecrets.clj +111 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/boru.clj +107 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/doppler.clj +61 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/gcpsecrets.clj +88 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/hashicorp.clj +115 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/httpjson.clj +214 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/infisical.clj +80 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/onepassword.clj +93 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/proc.clj +63 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/secretspec.clj +99 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/sigv4.clj +142 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/provider.clj +25 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/providers.clj +196 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto.clj +113 -0
- package/project/.sdk/tm/clojure/src/sdk/core.clj +9 -0
- package/project/.sdk/tm/clojure/src/sdk/features.clj +13 -1
- package/project/.sdk/tm/clojure/test/sdk/test/feature/secrets.clj +547 -0
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +103 -14
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +2 -2
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +2 -2
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +2 -2
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +2 -2
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +2 -2
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +2 -2
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +889 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Capability.cs +196 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Catalog.cs +70 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Config.cs +505 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Definition.cs +52 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Depend.cs +285 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Entry.cs +55 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Env.cs +228 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Export.cs +102 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Graph.cs +256 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Host.cs +1379 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Inst.cs +177 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Json.cs +326 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Order.cs +295 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Plugin.cs +113 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Point.cs +177 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Refs.cs +198 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Resolve.cs +95 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Types.cs +351 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Version.cs +196 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Aws.cs +325 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/AzureSecrets.cs +195 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Boru.cs +192 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Child.cs +75 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Doppler.cs +112 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/GcpSecrets.cs +167 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Hashicorp.cs +221 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/HttpJson.cs +213 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Infisical.cs +155 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/OnePassword.cs +169 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/SecretSpec.cs +172 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Sigv4.cs +240 -0
- package/project/.sdk/tm/csharp/feature/secrets/sekreto/Json.cs +192 -0
- package/project/.sdk/tm/csharp/feature/secrets/sekreto/Providers.cs +503 -0
- package/project/.sdk/tm/csharp/feature/secrets/sekreto/Sekreto.cs +775 -0
- package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +1702 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +2 -2
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +2 -2
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +10 -0
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/capability.ex +118 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/catalog.ex +56 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/config.ex +320 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/depend.ex +205 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/env.ex +166 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/error.ex +13 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/export.ex +73 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/graph.ex +185 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/host.ex +1182 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/inst.ex +139 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/json.ex +132 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/order.ex +179 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/point.ex +99 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/ref.ex +129 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/resolve.ex +59 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/types.ex +190 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/version.ex +136 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/voxgig_plugin.ex +42 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/json.ex +368 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/aws.ex +257 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/azuresecrets.ex +160 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/boru.ex +127 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/doppler.ex +96 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/gcpsecrets.ex +124 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/hashicorp.ex +162 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/http.ex +627 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/httpjson.ex +134 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/infisical.ex +125 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/onepassword.ex +152 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/proc.ex +80 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/secretspec.ex +101 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/sigv4.ex +176 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/provider.ex +67 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/providers.ex +536 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/sekreto.ex +662 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +824 -0
- package/project/.sdk/tm/elixir/test/feature/secrets/secrets_test.exs +1072 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +2 -2
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +2 -2
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +2 -2
- package/project/.sdk/tm/go/feature/secrets_feature.go +16 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +123 -0
- package/project/.sdk/tm/go/test/omni/omni.go +2 -2
- package/project/.sdk/tm/go/test/omni/util.go +2 -2
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +1 -1
- package/project/.sdk/tm/java/feature/SecretsFeature.java +766 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Capability.java +181 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Catalog.java +64 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Config.java +433 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Definition.java +54 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Depend.java +292 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Entry.java +49 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Env.java +204 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Export.java +93 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Graph.java +244 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Host.java +1196 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Inst.java +173 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Json.java +339 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Order.java +274 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Plugin.java +94 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/PluginException.java +37 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Point.java +172 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Refs.java +171 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Resolve.java +89 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Types.java +232 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Version.java +198 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/Addr.java +142 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/Builtins.java +229 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/Json.java +302 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/Provider.java +21 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/Sekreto.java +698 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/Support.java +100 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Aws.java +294 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Azuresecrets.java +164 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Boru.java +161 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Doppler.java +103 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Gcpsecrets.java +143 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Hashicorp.java +186 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Httpjson.java +192 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Infisical.java +139 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Onepassword.java +143 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Proc.java +80 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Secretspec.java +138 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Sigv4.java +243 -0
- package/project/.sdk/tm/java/test/feature/secrets/SecretsFeatureTest.java +986 -0
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +2 -2
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +2 -2
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +2 -2
- package/project/.sdk/tm/java/utility/MakeOptions.java +7 -0
- package/project/.sdk/tm/java/utility/struct/Struct.java +1 -1
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +431 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/capability.js +119 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/catalog.js +42 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/config.js +323 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/depend.js +196 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/env.js +120 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/export.js +48 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/graph.js +150 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/host.js +949 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/index.js +35 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/order.js +165 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/point.js +94 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/ref.js +106 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/resolve.js +59 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/types.js +79 -0
- package/project/.sdk/tm/js/src/feature/secrets/plugin/version.js +100 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/Sekreto.js +574 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/index.js +56 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/aws.js +188 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/azuresecrets.js +135 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/boru.js +128 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/doppler.js +67 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/gcpsecrets.js +115 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/hashicorp.js +139 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/httpjson.js +93 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/infisical.js +99 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/onepassword.js +111 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/secretspec.js +105 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/sigv4.js +157 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/addr.js +119 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/builtin.js +39 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/dotenv.js +40 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/env.js +21 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/file.js +42 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/memory.js +18 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/support.js +151 -0
- package/project/.sdk/tm/js/src/utility/StructUtility.js +1 -1
- package/project/.sdk/tm/js/test/feature/secrets/Secrets.test.js +946 -0
- package/project/.sdk/tm/js/test/vendor/omni/index.js +1 -1
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +1 -1
- package/project/.sdk/tm/js/test/vendor/omni/util.js +1 -1
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +659 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Capability.kt +117 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Catalog.kt +40 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Config.kt +322 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Depend.kt +227 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Env.kt +163 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Export.kt +57 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Graph.kt +179 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Host.kt +1131 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Json.kt +241 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Order.kt +180 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Plugin.kt +64 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Point.kt +124 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Refs.kt +125 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Resolve.kt +66 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Types.kt +171 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Version.kt +132 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Json.kt +359 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Provider.kt +21 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Providers.kt +308 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Sekreto.kt +525 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Spec.kt +126 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Support.kt +205 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Aws.kt +251 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Azuresecrets.kt +145 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Boru.kt +130 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Doppler.kt +77 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Gcpsecrets.kt +119 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Hashicorp.kt +156 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Httpjson.kt +219 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Infisical.kt +114 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Onepassword.kt +114 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Secretspec.kt +118 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Sigv4.kt +220 -0
- package/project/.sdk/tm/kotlin/test/feature/secrets/SecretsTest.kt +1148 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +2 -2
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +2 -2
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +2 -2
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +1 -1
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +2 -2
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +2 -2
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +2 -2
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +2 -2
- package/project/.sdk/tm/lua/utility/struct/regex.lua +1 -1
- package/project/.sdk/tm/lua/utility/struct/struct.lua +1 -1
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +2 -2
- package/project/.sdk/tm/perl/Makefile +6 -1
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Capability.pm +141 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Catalog.pm +65 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Config.pm +346 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Depend.pm +216 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Env.pm +176 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Export.pm +59 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Graph.pm +157 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Host.pm +1139 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Order.pm +187 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Point.pm +100 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Ref.pm +119 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Resolve.pm +71 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Types.pm +251 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Version.pm +122 -0
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin.pm +70 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Aws.pm +263 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Azuresecrets.pm +159 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Boru.pm +180 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Doppler.pm +92 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Gcpsecrets.pm +138 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Hashicorp.pm +213 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Httpjson.pm +173 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Infisical.pm +132 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Onepassword.pm +132 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Proc.pm +102 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Secretspec.pm +132 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Sigv4.pm +190 -0
- package/project/.sdk/tm/perl/feature/secrets/sekreto/Voxgig/Sekreto/Addr.pm +124 -0
- package/project/.sdk/tm/perl/feature/secrets/sekreto/Voxgig/Sekreto/Providers.pm +301 -0
- package/project/.sdk/tm/perl/feature/secrets/sekreto/Voxgig/Sekreto.pm +605 -0
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +675 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +1 -1
- package/project/.sdk/tm/perl/t/feature/secrets/secrets.t +957 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +1 -1
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +1 -1
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +1 -1
- package/project/.sdk/tm/php/feature/SecretsFeature.php +670 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Capability.php +226 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Catalog.php +75 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Config.php +444 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Depend.php +262 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Env.php +202 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Export.php +74 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Graph.php +195 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Host.php +1514 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Order.php +260 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Point.php +129 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Ref.php +169 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Resolve.php +79 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Types.php +348 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Version.php +163 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/plugin.php +40 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/aws.php +274 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/azuresecrets.php +170 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/boru.php +163 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/doppler.php +106 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/gcpsecrets.php +144 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/hashicorp.php +194 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/httpjson.php +113 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/infisical.php +131 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/onepassword.php +150 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/runcmd.php +101 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/secretspec.php +146 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/sigv4.php +161 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/src/Addr.php +129 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/src/Providers.php +322 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/src/Sekreto.php +724 -0
- package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +1067 -0
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +2 -2
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +2 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +2 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +1 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +1 -1
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +1 -1
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +1 -1
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +1 -1
- package/project/.sdk/tm/rb/Makefile +7 -1
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/capability.rb +118 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/catalog.rb +55 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/config.rb +315 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/depend.rb +197 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/env.rb +143 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/export.rb +52 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/graph.rb +147 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/host.rb +1079 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/order.rb +169 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/point.rb +93 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/ref.rb +112 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/resolve.rb +56 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/types.rb +99 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/version.rb +106 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin.rb +24 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/addr.rb +111 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/aws.rb +200 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/azuresecrets.rb +130 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/boru.rb +121 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/doppler.rb +66 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.rb +107 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/hashicorp.rb +137 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/httpjson.rb +136 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/infisical.rb +97 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/onepassword.rb +104 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/secretspec.rb +113 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/sigv4.rb +127 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/providers.rb +210 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/sekreto.rb +465 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto.rb +30 -0
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +561 -0
- package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +842 -0
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +2 -2
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +2 -2
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/capability.rs +130 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/catalog.rs +114 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/config.rs +416 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/depend.rs +245 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/env.rs +200 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/export.rs +90 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/graph.rs +231 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/host.rs +1565 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/mod.rs +18 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/order.rs +226 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/point.rs +137 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/refs.rs +148 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/resolve.rs +83 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/types.rs +132 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/value.rs +433 -0
- package/project/.sdk/tm/rust/feature/secrets/plugin/version.rs +174 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/aws/crypto.rs +146 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/aws/sigv4.rs +230 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/aws.rs +328 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/azuresecrets.rs +184 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/boru.rs +172 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/doppler.rs +102 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/gcpsecrets.rs +153 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/hashicorp.rs +228 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/httpjson/http.rs +537 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/httpjson/json.rs +300 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/httpjson.rs +137 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/infisical.rs +148 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/onepassword.rs +165 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/secretspec.rs +150 -0
- package/project/.sdk/tm/rust/feature/secrets/sekreto/addr.rs +144 -0
- package/project/.sdk/tm/rust/feature/secrets/sekreto/mod.rs +51 -0
- package/project/.sdk/tm/rust/feature/secrets/sekreto/providers.rs +637 -0
- package/project/.sdk/tm/rust/feature/secrets/sekreto/sekreto.rs +677 -0
- package/project/.sdk/tm/rust/feature/secrets.rs +961 -0
- package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +1509 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +2 -2
- package/project/.sdk/tm/scala/Makefile +8 -3
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +556 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Capability.scala +96 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Config.scala +270 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Depend.scala +216 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Env.scala +144 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Export.scala +59 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Graph.scala +149 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Host.scala +1089 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Json.scala +156 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Order.scala +169 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Plugin.scala +47 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Point.scala +107 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Refs.scala +131 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Resolve.scala +53 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Types.scala +110 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Value.scala +157 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Version.scala +136 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Json.scala +302 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Provider.scala +20 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Providers.scala +281 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Sekreto.scala +473 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Spec.scala +123 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Support.scala +216 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Aws.scala +225 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Azuresecrets.scala +124 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Boru.scala +104 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Doppler.scala +68 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Gcpsecrets.scala +97 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Hashicorp.scala +131 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Httpjson.scala +209 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Infisical.scala +98 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Onepassword.scala +90 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Secretspec.scala +95 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Sigv4.scala +214 -0
- package/project/.sdk/tm/scala/sdktest/feature/secrets/SecretsTestMain.scala +971 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +2 -2
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +2 -2
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +2 -2
- package/project/.sdk/tm/scala/utility/Make.scala +7 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/SecretsFeature.swift +669 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Capability.swift +98 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Catalog.swift +87 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Config.swift +298 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Depend.swift +209 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Env.swift +191 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Export.swift +63 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Graph.swift +158 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Host.swift +1141 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Json.swift +192 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Order.swift +183 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Point.swift +130 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Refs.swift +141 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Resolve.swift +59 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Types.swift +125 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Value.swift +198 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Version.swift +139 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Aws.swift +271 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Azuresecrets.swift +173 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Boru.swift +139 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Crypto.swift +198 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Doppler.swift +86 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Gcpsecrets.swift +129 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Hashicorp.swift +175 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Httpjson.swift +310 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Infisical.swift +140 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Onepassword.swift +118 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Proc.swift +105 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Secretspec.swift +111 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Sigv4.swift +297 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Addr.swift +120 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Json.swift +452 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Provider.swift +25 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Providers.swift +689 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Sekreto.swift +755 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +9 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +30 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/feature/secrets/SecretsFeatureTest.swift +1030 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +2 -2
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +2 -2
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +2 -2
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/aws.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/azuresecrets.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/boru.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/doppler.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/gcpsecrets.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/hashicorp.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/infisical.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/onepassword.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/sigv4.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +1 -1
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +1 -1
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +1 -1
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +1 -1
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +1 -1
- package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +2 -2
- package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +2 -2
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +2 -2
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +2 -2
- package/project/sdkgen-package.json +1 -4
- package/src/helpers/manifest.ts +81 -1
- package/src/helpers/modelNames.ts +284 -0
- package/src/helpers/naming.ts +45 -1
- package/src/sdkgen.ts +11 -1
- package/src/testkit.ts +115 -26
- package/src/utility.ts +17 -7
- package/project/.sdk/model/target/dart.aon +0 -58
- package/project/.sdk/model/target/lean.aon +0 -91
- package/project/.sdk/model/target/seneca-provider.aon +0 -120
- package/project/.sdk/src/cmp/dart/Config_dart.ts +0 -176
- package/project/.sdk/src/cmp/dart/EntityBase_dart.ts +0 -34
- package/project/.sdk/src/cmp/dart/EntityOperation_dart.ts +0 -43
- package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +0 -207
- package/project/.sdk/src/cmp/dart/Entity_dart.ts +0 -87
- package/project/.sdk/src/cmp/dart/Gitignore_dart.ts +0 -34
- package/project/.sdk/src/cmp/dart/MainEntity_dart.ts +0 -33
- package/project/.sdk/src/cmp/dart/Main_dart.ts +0 -106
- package/project/.sdk/src/cmp/dart/Package_dart.ts +0 -82
- package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +0 -177
- package/project/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +0 -238
- package/project/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +0 -53
- package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +0 -152
- package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +0 -59
- package/project/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +0 -65
- package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +0 -151
- package/project/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +0 -63
- package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +0 -225
- package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +0 -397
- package/project/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +0 -24
- package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +0 -106
- package/project/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +0 -78
- package/project/.sdk/src/cmp/dart/SdkError_dart.ts +0 -42
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +0 -516
- package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +0 -628
- package/project/.sdk/src/cmp/dart/Test_dart.ts +0 -116
- package/project/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +0 -79
- package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +0 -51
- package/project/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +0 -25
- package/project/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +0 -29
- package/project/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +0 -28
- package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +0 -302
- package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +0 -98
- package/project/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +0 -90
- package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +0 -102
- package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +0 -108
- package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +0 -102
- package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +0 -338
- package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +0 -26
- package/project/.sdk/src/cmp/dart/tsconfig.json +0 -15
- package/project/.sdk/src/cmp/dart/utility_dart.ts +0 -155
- package/project/.sdk/src/cmp/lean/Config_lean.ts +0 -93
- package/project/.sdk/src/cmp/lean/Entity_lean.ts +0 -9
- package/project/.sdk/src/cmp/lean/Gitignore_lean.ts +0 -18
- package/project/.sdk/src/cmp/lean/Main_lean.ts +0 -120
- package/project/.sdk/src/cmp/lean/Package_lean.ts +0 -93
- package/project/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +0 -29
- package/project/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +0 -19
- package/project/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +0 -25
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +0 -39
- package/project/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +0 -25
- package/project/.sdk/src/cmp/lean/ReadmeModel_lean.ts +0 -24
- package/project/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +0 -22
- package/project/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +0 -50
- package/project/.sdk/src/cmp/lean/ReadmeRef_lean.ts +0 -40
- package/project/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +0 -16
- package/project/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +0 -23
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +0 -19
- package/project/.sdk/src/cmp/lean/Test_lean.ts +0 -261
- package/project/.sdk/src/cmp/lean/utility_lean.ts +0 -129
- package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +0 -4080
- package/project/.sdk/src/cmp/seneca-provider/Gitignore_seneca-provider.ts +0 -161
- package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +0 -1011
- package/project/.sdk/tm/dart/LICENSE +0 -22
- package/project/.sdk/tm/dart/Makefile +0 -50
- package/project/.sdk/tm/dart/lib/Context.dart +0 -150
- package/project/.sdk/tm/dart/lib/Control.dart +0 -15
- package/project/.sdk/tm/dart/lib/Operation.dart +0 -31
- package/project/.sdk/tm/dart/lib/Point.dart +0 -51
- package/project/.sdk/tm/dart/lib/Response.dart +0 -32
- package/project/.sdk/tm/dart/lib/Result.dart +0 -39
- package/project/.sdk/tm/dart/lib/Spec.dart +0 -49
- package/project/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +0 -103
- package/project/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +0 -76
- package/project/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +0 -152
- package/project/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +0 -104
- package/project/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +0 -446
- package/project/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +0 -153
- package/project/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +0 -92
- package/project/.sdk/tm/dart/lib/feature/log/LogFeature.dart +0 -85
- package/project/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +0 -103
- package/project/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +0 -186
- package/project/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +0 -240
- package/project/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +0 -118
- package/project/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +0 -103
- package/project/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +0 -121
- package/project/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +0 -155
- package/project/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +0 -97
- package/project/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +0 -136
- package/project/.sdk/tm/dart/lib/feature/test/TestFeature.dart +0 -328
- package/project/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +0 -104
- package/project/.sdk/tm/dart/lib/utility/CleanUtility.dart +0 -12
- package/project/.sdk/tm/dart/lib/utility/DoneUtility.dart +0 -18
- package/project/.sdk/tm/dart/lib/utility/ErrUtility.dart +0 -46
- package/project/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +0 -35
- package/project/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +0 -20
- package/project/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +0 -9
- package/project/.sdk/tm/dart/lib/utility/FetcherUtility.dart +0 -104
- package/project/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +0 -162
- package/project/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +0 -6
- package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +0 -71
- package/project/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +0 -42
- package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +0 -233
- package/project/.sdk/tm/dart/lib/utility/MakePointUtility.dart +0 -130
- package/project/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +0 -66
- package/project/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +0 -59
- package/project/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +0 -49
- package/project/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +0 -77
- package/project/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +0 -51
- package/project/.sdk/tm/dart/lib/utility/ParamUtility.dart +0 -56
- package/project/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +0 -46
- package/project/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +0 -19
- package/project/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +0 -11
- package/project/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +0 -30
- package/project/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +0 -23
- package/project/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +0 -9
- package/project/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +0 -18
- package/project/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +0 -29
- package/project/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +0 -15
- package/project/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +0 -18
- package/project/.sdk/tm/dart/lib/utility/StructUtility.dart +0 -127
- package/project/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +0 -28
- package/project/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +0 -44
- package/project/.sdk/tm/dart/lib/utility/Utility.dart +0 -239
- package/project/.sdk/tm/dart/lib/utility/voxgig_struct.dart +0 -2462
- package/project/.sdk/tm/dart/src/feature/README.md +0 -3
- package/project/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/dart/test/custom_test.dart +0 -65
- package/project/.sdk/tm/dart/test/exists_test.dart +0 -12
- package/project/.sdk/tm/dart/test/feature/harness.dart +0 -329
- package/project/.sdk/tm/dart/test/feature_test.dart +0 -1193
- package/project/.sdk/tm/dart/test/harness.dart +0 -153
- package/project/.sdk/tm/dart/test/netsim_test.dart +0 -48
- package/project/.sdk/tm/dart/test/omni.dart +0 -520
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +0 -143
- package/project/.sdk/tm/dart/test/pipeline_test.dart +0 -608
- package/project/.sdk/tm/dart/test/primary_test.dart +0 -476
- package/project/.sdk/tm/dart/test/sdk-test-control.json +0 -19
- package/project/.sdk/tm/dart/test/struct_test.dart +0 -468
- package/project/.sdk/tm/dart/test/utility.dart +0 -198
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +0 -7
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +0 -653
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +0 -232
- package/project/.sdk/tm/lean/LICENSE +0 -21
- package/project/.sdk/tm/lean/Makefile +0 -32
- package/project/.sdk/tm/lean/VERSION +0 -1
- package/project/.sdk/tm/lean/src/SdkFeature.lean +0 -171
- package/project/.sdk/tm/lean/src/SdkFeatures.lean +0 -787
- package/project/.sdk/tm/lean/src/SdkJson.lean +0 -134
- package/project/.sdk/tm/lean/src/SdkRuntime.lean +0 -374
- package/project/.sdk/tm/lean/src/SdkUtility.lean +0 -809
- package/project/.sdk/tm/lean/src/VoxgigStruct.lean +0 -2880
- package/project/.sdk/tm/lean/src/Vregex.lean +0 -412
- package/project/.sdk/tm/lean/src/feature/README.md +0 -5
- package/project/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/lean/test/OmniResolver.lean +0 -358
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +0 -174
- package/project/.sdk/tm/lean/test/StructCorpus.lean +0 -368
- package/project/.sdk/tm/lean/test/TFeature.lean +0 -281
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +0 -227
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +0 -997
- package/project/.sdk/tm/seneca-provider/CODE_OF_CONDUCT.md +0 -132
- package/project/.sdk/tm/seneca-provider/LICENSE +0 -21
- package/project/.sdk/tm/seneca-provider/Makefile +0 -15
- package/project/.sdk/tm/seneca-provider/src/tsconfig.json +0 -18
- package/project/.sdk/tm/seneca-provider/test/tsconfig.json +0 -16
- package/project/.sdk/tm/seneca-provider/tsfmt.json +0 -3
- /package/project/.sdk/tm/{dart/src/feature/audit → clojure/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/base → csharp/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/cache → elixir/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/clienttrack → java/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/cost → kotlin/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/debug → perl/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/idempotency → php/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/log → rb/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/metrics → rust/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/netsim → scala/src/feature/secrets}/.gitkeep +0 -0
- /package/project/.sdk/tm/{dart/src/feature/paging → swift/src/feature/secrets}/.gitkeep +0 -0
|
@@ -0,0 +1,1565 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (rust/src/host.rs)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
//! The host: the lifecycle state machine (§5), extension points (§6), and
|
|
5
|
+
//! resource capture (§8).
|
|
6
|
+
//!
|
|
7
|
+
//! TWO RULES SHAPE EVERY METHOD BELOW.
|
|
8
|
+
//!
|
|
9
|
+
//! Transitions are SEQUENTIAL (§5.2). One at a time, in call order, never
|
|
10
|
+
//! interleaved; a transition triggered from inside a lifecycle callback is
|
|
11
|
+
//! `plugin_reentrant`. A hard rule, because it is the only way the
|
|
12
|
+
//! semantics can be identical in Go, in Rust and in single-threaded
|
|
13
|
+
//! JavaScript.
|
|
14
|
+
//!
|
|
15
|
+
//! Reconciliation is EAGER (§18's portability budget). A transition
|
|
16
|
+
//! settles by running the state machine to a fixed point, not by
|
|
17
|
+
//! suspending on a promise.
|
|
18
|
+
//!
|
|
19
|
+
//! AND ONE RULE IS RUST'S OWN: NEVER HOLD A BORROW ACROSS A CALLBACK. A
|
|
20
|
+
//! definition's `define` calls back into the host - `bind`, `export`,
|
|
21
|
+
//! `acquire`, even `nest` - so every method here reads what it needs out
|
|
22
|
+
//! of a `RefCell`, DROPS the borrow, and only then runs anything a plugin
|
|
23
|
+
//! wrote. A held borrow does not produce a wrong answer, it panics, which
|
|
24
|
+
//! is the one failure mode a conformance suite cannot report as a
|
|
25
|
+
//! divergence.
|
|
26
|
+
|
|
27
|
+
use std::cell::{Cell, RefCell};
|
|
28
|
+
use std::collections::{BTreeMap, BTreeSet};
|
|
29
|
+
use std::rc::Rc;
|
|
30
|
+
|
|
31
|
+
use super::capability::resolve_capability;
|
|
32
|
+
use super::catalog::{Catalog, Definition};
|
|
33
|
+
use super::config::{normalize_config, resolve_options};
|
|
34
|
+
use super::depend::{checkcycle, gatesactivation, requirements, restartsonloss, Node};
|
|
35
|
+
use super::export::{resolve_export, Exported};
|
|
36
|
+
use super::order::{resolve_order, Binding};
|
|
37
|
+
use super::point::{compose, point_emit, point_provider, Bound, NextFn};
|
|
38
|
+
use super::refs::{canon, canon_ref, format_ref, parse_ref, refname};
|
|
39
|
+
use super::types::{details, fail, PluginError};
|
|
40
|
+
use super::value::Value;
|
|
41
|
+
|
|
42
|
+
/// A registered teardown. §8.3's scope: every entry runs, in reverse, and
|
|
43
|
+
/// a failing one does not stop the rest.
|
|
44
|
+
pub type ScopeFn = Rc<dyn Fn() -> Result<(), PluginError>>;
|
|
45
|
+
|
|
46
|
+
/// One instance's record.
|
|
47
|
+
pub struct Entry {
|
|
48
|
+
pub eref: String,
|
|
49
|
+
pub def: Rc<Definition>,
|
|
50
|
+
pub status: String,
|
|
51
|
+
pub pos: f64,
|
|
52
|
+
pub seq: f64,
|
|
53
|
+
pub options: Value,
|
|
54
|
+
pub state: Value,
|
|
55
|
+
pub order: Value,
|
|
56
|
+
pub unmet: Vec<String>,
|
|
57
|
+
pub scope: Vec<ScopeFn>,
|
|
58
|
+
/// §11.4's ALWAYS-RELUCTANT rebinding made concrete: the provider ref
|
|
59
|
+
/// this instance's activation actually chose, per requirement name.
|
|
60
|
+
/// Re-ranking on every question silently re-points a live consumer at
|
|
61
|
+
/// any better newcomer, and then losing the provider it was really
|
|
62
|
+
/// using does not restart it.
|
|
63
|
+
pub selected: BTreeMap<String, String>,
|
|
64
|
+
pub bindings: Vec<Bound>,
|
|
65
|
+
pub exports: BTreeMap<String, Value>,
|
|
66
|
+
pub provides: Vec<Value>,
|
|
67
|
+
pub inner: Option<Host>,
|
|
68
|
+
pub barred: bool,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
pub struct HostInner {
|
|
72
|
+
opts: Value,
|
|
73
|
+
dependency: String,
|
|
74
|
+
reserved: Value,
|
|
75
|
+
points: Value,
|
|
76
|
+
catalog: RefCell<Catalog>,
|
|
77
|
+
inst: RefCell<BTreeMap<String, Rc<RefCell<Entry>>>>,
|
|
78
|
+
log: RefCell<Vec<String>>,
|
|
79
|
+
/// §14: the lifecycle event record. `seq` distinguishes ONE
|
|
80
|
+
/// INCARNATION of stripe$test from the next, which is the whole reason
|
|
81
|
+
/// it is not `pos` (§4 rule 4).
|
|
82
|
+
events: RefCell<Vec<Value>>,
|
|
83
|
+
seqn: Cell<f64>,
|
|
84
|
+
open: Cell<i64>,
|
|
85
|
+
transition: Cell<bool>,
|
|
86
|
+
/// WHICH callback is running, not merely that one is. §8.1 puts
|
|
87
|
+
/// resource capture in `activate` and 8.3 says `release` outside
|
|
88
|
+
/// `activate` is `plugin_release_scope` - and a bare flag cannot tell
|
|
89
|
+
/// `activate` from `define`, so it admitted an acquire in `define`
|
|
90
|
+
/// whose scope `unload` would never unwind.
|
|
91
|
+
phase: RefCell<String>,
|
|
92
|
+
/// Set for the duration of a bulk teardown, so `held` knows this is a
|
|
93
|
+
/// coordinated operation rather than an ad-hoc deactivation.
|
|
94
|
+
coordinated: Cell<bool>,
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#[derive(Clone)]
|
|
98
|
+
pub struct Host(pub Rc<HostInner>);
|
|
99
|
+
|
|
100
|
+
pub fn make_host(options: &Value) -> Host {
|
|
101
|
+
Host::new(options)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
impl Host {
|
|
105
|
+
pub fn new(options: &Value) -> Host {
|
|
106
|
+
let opts = options.clone();
|
|
107
|
+
let dependency = opts
|
|
108
|
+
.get("dependency")
|
|
109
|
+
.as_str()
|
|
110
|
+
.unwrap_or("restart")
|
|
111
|
+
.to_string();
|
|
112
|
+
Host(Rc::new(HostInner {
|
|
113
|
+
reserved: opts.get("reserved"),
|
|
114
|
+
points: opts.get("points"),
|
|
115
|
+
catalog: RefCell::new(Catalog::new()),
|
|
116
|
+
inst: RefCell::new(BTreeMap::new()),
|
|
117
|
+
log: RefCell::new(Vec::new()),
|
|
118
|
+
events: RefCell::new(Vec::new()),
|
|
119
|
+
seqn: Cell::new(0.0),
|
|
120
|
+
open: Cell::new(0),
|
|
121
|
+
transition: Cell::new(false),
|
|
122
|
+
phase: RefCell::new(String::new()),
|
|
123
|
+
coordinated: Cell::new(false),
|
|
124
|
+
dependency,
|
|
125
|
+
opts,
|
|
126
|
+
}))
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
pub fn with_catalog(options: &Value, catalog: Catalog) -> Host {
|
|
130
|
+
let host = Host::new(options);
|
|
131
|
+
*host.0.catalog.borrow_mut() = catalog;
|
|
132
|
+
host
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
pub fn define(&self, definition: Definition) -> Result<(), PluginError> {
|
|
136
|
+
self.0.catalog.borrow_mut().add(definition)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
pub fn intransition(&self) -> bool {
|
|
140
|
+
self.0.transition.get()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
pub fn phase(&self) -> String {
|
|
144
|
+
self.0.phase.borrow().clone()
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
pub fn haspoint(&self, name: &str) -> bool {
|
|
148
|
+
self.0.points.has(name)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
pub fn open_inc(&self) {
|
|
152
|
+
self.0.open.set(self.0.open.get() + 1);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
pub fn open_dec(&self) {
|
|
156
|
+
self.0.open.set(self.0.open.get() - 1);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// --- observation ------------------------------------------------
|
|
160
|
+
|
|
161
|
+
/// Introspection NEVER advances the state (§5.2). A status page must
|
|
162
|
+
/// not be a way to accidentally import twenty packages.
|
|
163
|
+
pub fn list(&self) -> Value {
|
|
164
|
+
let mut out = Value::map();
|
|
165
|
+
for (eref, entry) in self.0.inst.borrow().iter() {
|
|
166
|
+
out.set(eref, Value::str(&entry.borrow().status));
|
|
167
|
+
}
|
|
168
|
+
out
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/// The instance record, or `None` when nothing is registered under
|
|
172
|
+
/// that ref. THE REF IS VALIDATED, not merely canonicalized: looking
|
|
173
|
+
/// an instance up by `"bad name"` is `plugin_bad_name`, not a quiet
|
|
174
|
+
/// miss, and `declare/lookup#malformed` is the entry that says so.
|
|
175
|
+
pub fn instance(&self, eref: &Value) -> Result<Option<Rc<RefCell<Entry>>>, PluginError> {
|
|
176
|
+
let r = canon_ref(eref)?;
|
|
177
|
+
Ok(self.0.inst.borrow().get(&r).cloned())
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
pub fn trace(&self) -> Value {
|
|
181
|
+
Value::List(self.0.events.borrow().clone())
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
pub fn observable(&self, result: Value) -> Value {
|
|
185
|
+
let mut out = Value::map();
|
|
186
|
+
out.set("status", self.list());
|
|
187
|
+
out.set("open", Value::Num(self.0.open.get() as f64));
|
|
188
|
+
out.set(
|
|
189
|
+
"log",
|
|
190
|
+
Value::List(self.0.log.borrow().iter().map(|l| Value::str(l)).collect()),
|
|
191
|
+
);
|
|
192
|
+
out.set("result", result);
|
|
193
|
+
out
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// --- the state machine ------------------------------------------
|
|
197
|
+
|
|
198
|
+
fn guard(&self) -> Result<(), PluginError> {
|
|
199
|
+
if !self.0.transition.get() {
|
|
200
|
+
return Ok(());
|
|
201
|
+
}
|
|
202
|
+
fail(
|
|
203
|
+
"plugin_reentrant",
|
|
204
|
+
"transition attempted from inside a lifecycle callback",
|
|
205
|
+
Value::Null,
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
fn need(&self, eref: &Value) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
210
|
+
let r = canon_ref(eref)?;
|
|
211
|
+
match self.0.inst.borrow().get(&r) {
|
|
212
|
+
Some(e) => Ok(e.clone()),
|
|
213
|
+
None => fail(
|
|
214
|
+
"plugin_not_loaded",
|
|
215
|
+
&format!("no such instance: {}", r),
|
|
216
|
+
details(&[("ref", Value::str(&r))]),
|
|
217
|
+
),
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
fn checkreserved(&self, eref: &str) -> Result<(), PluginError> {
|
|
222
|
+
let list = match self.0.reserved.as_list() {
|
|
223
|
+
Some(l) if !l.is_empty() => l.clone(),
|
|
224
|
+
_ => return Ok(()),
|
|
225
|
+
};
|
|
226
|
+
let name = refname(eref);
|
|
227
|
+
if !list.iter().any(|r| r.as_str() == Some(name.as_str())) {
|
|
228
|
+
return Ok(());
|
|
229
|
+
}
|
|
230
|
+
fail(
|
|
231
|
+
"plugin_ref_reserved",
|
|
232
|
+
&format!("ref is reserved by the host: {}", eref),
|
|
233
|
+
details(&[("ref", Value::str(eref))]),
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
fn run(
|
|
238
|
+
&self,
|
|
239
|
+
entry: &Rc<RefCell<Entry>>,
|
|
240
|
+
callback: &str,
|
|
241
|
+
at: &str,
|
|
242
|
+
) -> Result<(), PluginError> {
|
|
243
|
+
// Read everything the log and the event record need, then DROP the
|
|
244
|
+
// borrow: the callback below reaches back into this entry.
|
|
245
|
+
let (eref, seq, status, def) = {
|
|
246
|
+
let e = entry.borrow();
|
|
247
|
+
(e.eref.clone(), e.seq, e.status.clone(), e.def.clone())
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
self.0.log.borrow_mut().push(format!("{}:{}", eref, at));
|
|
251
|
+
let mut event = Value::map();
|
|
252
|
+
event.set("ref", Value::str(&eref));
|
|
253
|
+
event.set("event", Value::str(at));
|
|
254
|
+
event.set("seq", Value::Num(seq));
|
|
255
|
+
event.set("status", Value::str(&status));
|
|
256
|
+
self.0.events.borrow_mut().push(event);
|
|
257
|
+
|
|
258
|
+
let func = match def.callback(callback) {
|
|
259
|
+
Some(f) => f,
|
|
260
|
+
None => return Ok(()),
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
self.0.transition.set(true);
|
|
264
|
+
*self.0.phase.borrow_mut() = at.to_string();
|
|
265
|
+
let inst = Inst::new(self.clone(), entry.clone())?;
|
|
266
|
+
let outcome = func(&inst);
|
|
267
|
+
self.0.transition.set(false);
|
|
268
|
+
self.0.phase.borrow_mut().clear();
|
|
269
|
+
|
|
270
|
+
match outcome {
|
|
271
|
+
Ok(()) => Ok(()),
|
|
272
|
+
// §12: `plugin_define_failed` and its three siblings are "a
|
|
273
|
+
// callback raised; wraps the cause". AN ERROR THAT ALREADY
|
|
274
|
+
// CARRIES A CODE KEEPS IT - the code is the error's identity,
|
|
275
|
+
// and a plugin raising `store_unreachable` must not have it
|
|
276
|
+
// rewritten. Only a code-less error is wrapped.
|
|
277
|
+
Err(e) if !e.code.is_empty() => Err(e),
|
|
278
|
+
Err(e) => fail(
|
|
279
|
+
&format!("plugin_{}_failed", at),
|
|
280
|
+
&format!("{} raised in {}: {}", eref, at, e.message),
|
|
281
|
+
details(&[
|
|
282
|
+
("ref", Value::str(&eref)),
|
|
283
|
+
("cause", Value::str(&e.message)),
|
|
284
|
+
]),
|
|
285
|
+
),
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/// AUTO-TAGGING IS EXPLICIT (§4 rule 3). `declare('stripe', tag: '?')`
|
|
290
|
+
/// assigns the LOWEST UNUSED POSITIVE INTEGER tag and returns the
|
|
291
|
+
/// assigned pair. Without `'?'`, a collision is an error.
|
|
292
|
+
fn autotag(&self, name: &str) -> Result<String, PluginError> {
|
|
293
|
+
let mut n = 1;
|
|
294
|
+
loop {
|
|
295
|
+
let cand = format_ref(&Value::str(name), &Value::str(&n.to_string()))?;
|
|
296
|
+
if !self.0.inst.borrow().contains_key(&cand) {
|
|
297
|
+
return Ok(cand);
|
|
298
|
+
}
|
|
299
|
+
n += 1;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
pub fn declare(&self, eref: &Value, spec: &Value) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
304
|
+
let eref = if spec.get("tag").as_str() == Some("?") {
|
|
305
|
+
Value::str(&self.autotag(&refname(&canon_ref(eref)?))?)
|
|
306
|
+
} else {
|
|
307
|
+
eref.clone()
|
|
308
|
+
};
|
|
309
|
+
let r = canon_ref(&eref)?;
|
|
310
|
+
if !spec.get("hostowned").truthy() {
|
|
311
|
+
self.checkreserved(&r)?;
|
|
312
|
+
}
|
|
313
|
+
let defname = spec
|
|
314
|
+
.get("definition")
|
|
315
|
+
.as_str()
|
|
316
|
+
.map(|s| s.to_string())
|
|
317
|
+
.unwrap_or_else(|| refname(&r));
|
|
318
|
+
let definition = match self.0.catalog.borrow().get(&defname) {
|
|
319
|
+
Some(d) => d,
|
|
320
|
+
None => {
|
|
321
|
+
return fail(
|
|
322
|
+
"plugin_unknown_definition",
|
|
323
|
+
&format!("not in catalog: {}", defname),
|
|
324
|
+
details(&[("name", Value::str(&defname))]),
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
let existing = self.0.inst.borrow().get(&r).cloned();
|
|
330
|
+
if let Some(existing) = existing {
|
|
331
|
+
// §4 rule 1: a pair addresses at most one instance.
|
|
332
|
+
// Re-declaring the SAME definition is the idempotent case; a
|
|
333
|
+
// different one is a duplicate, not a silent overwrite
|
|
334
|
+
// (seneca) and not an impossibility (sdkgen).
|
|
335
|
+
if existing.borrow().def.name != definition.name {
|
|
336
|
+
return fail(
|
|
337
|
+
"plugin_ref_duplicate",
|
|
338
|
+
&format!("instance already declared: {}", r),
|
|
339
|
+
details(&[("ref", Value::str(&r))]),
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
return Ok(existing);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
let pos = match spec.get("pos").as_num() {
|
|
346
|
+
Some(p) => p,
|
|
347
|
+
None => self.0.inst.borrow().len() as f64,
|
|
348
|
+
};
|
|
349
|
+
let entry = Rc::new(RefCell::new(Entry {
|
|
350
|
+
eref: r.clone(),
|
|
351
|
+
def: definition,
|
|
352
|
+
status: "declared".to_string(),
|
|
353
|
+
pos,
|
|
354
|
+
seq: self.0.seqn.get(),
|
|
355
|
+
options: if spec.get("options").is_null() {
|
|
356
|
+
Value::map()
|
|
357
|
+
} else {
|
|
358
|
+
spec.get("options")
|
|
359
|
+
},
|
|
360
|
+
state: Value::map(),
|
|
361
|
+
order: spec.get("order"),
|
|
362
|
+
unmet: Vec::new(),
|
|
363
|
+
scope: Vec::new(),
|
|
364
|
+
selected: BTreeMap::new(),
|
|
365
|
+
bindings: Vec::new(),
|
|
366
|
+
exports: BTreeMap::new(),
|
|
367
|
+
provides: Vec::new(),
|
|
368
|
+
inner: None,
|
|
369
|
+
barred: false,
|
|
370
|
+
}));
|
|
371
|
+
self.0.seqn.set(self.0.seqn.get() + 1.0);
|
|
372
|
+
self.0.inst.borrow_mut().insert(r, entry.clone());
|
|
373
|
+
Ok(entry)
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/// §9.1: a host that reserves a name MUST still be able to declare the
|
|
377
|
+
/// instance it reserved - "The host declares those instances itself,
|
|
378
|
+
/// after the user merge, and always wins."
|
|
379
|
+
///
|
|
380
|
+
/// THE BOUNDARY IS BY METHOD, NOT BY CALLER, and that is a real limit:
|
|
381
|
+
/// no language here can tell the embedding host from a plugin holding
|
|
382
|
+
/// the same host object. What reservation protects is CONFIGURATION -
|
|
383
|
+
/// documents, overlays, `VOXGIG_PLUGIN_*`, construction options and
|
|
384
|
+
/// ordinary declare/load/options - and all of that still checks.
|
|
385
|
+
pub fn hostdeclare(
|
|
386
|
+
&self,
|
|
387
|
+
eref: &Value,
|
|
388
|
+
spec: &Value,
|
|
389
|
+
) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
390
|
+
self.guard()?;
|
|
391
|
+
let mut spec = spec.clone();
|
|
392
|
+
if spec.as_map().is_none() {
|
|
393
|
+
spec = Value::map();
|
|
394
|
+
}
|
|
395
|
+
spec.set("hostowned", Value::Bool(true));
|
|
396
|
+
self.declare(eref, &spec)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
pub fn load(&self, eref: &Value, spec: &Value) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
400
|
+
self.guard()?;
|
|
401
|
+
let entry = self.declare(eref, spec)?;
|
|
402
|
+
if "declared" != entry.borrow().status {
|
|
403
|
+
return Ok(entry); // idempotent trivially
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// PRESENCE, NOT TRUTH: an empty options map must CLEAR what the
|
|
407
|
+
// instance was declared with.
|
|
408
|
+
if spec.has("options") && !spec.get("options").is_null() {
|
|
409
|
+
entry.borrow_mut().options = spec.get("options");
|
|
410
|
+
}
|
|
411
|
+
if let Err(e) = self.run(&entry, "define", "define") {
|
|
412
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
413
|
+
return Err(e);
|
|
414
|
+
}
|
|
415
|
+
entry.borrow_mut().status = "loaded".to_string();
|
|
416
|
+
|
|
417
|
+
// AT LOAD, and before anything runs: a cycle through
|
|
418
|
+
// restart-causing requirements does not settle, and the only safe
|
|
419
|
+
// time to report a non-terminating reconcile is before it starts
|
|
420
|
+
// (§11.3). `provides` is populated by `define`, which has just
|
|
421
|
+
// run, so this is the first moment the graph is complete.
|
|
422
|
+
if let Err(e) = checkcycle(&self.graphnodes()) {
|
|
423
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
424
|
+
return Err(e);
|
|
425
|
+
}
|
|
426
|
+
Ok(entry)
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/// The requirement graph as plain data, for the pure detector.
|
|
430
|
+
fn graphnodes(&self) -> Vec<Node> {
|
|
431
|
+
let mut out = Vec::new();
|
|
432
|
+
for (eref, entry) in self.0.inst.borrow().iter() {
|
|
433
|
+
let e = entry.borrow();
|
|
434
|
+
out.push(Node {
|
|
435
|
+
eref: eref.clone(),
|
|
436
|
+
provides: e
|
|
437
|
+
.provides
|
|
438
|
+
.iter()
|
|
439
|
+
.map(|p| p.get("name").as_str().unwrap_or("").to_string())
|
|
440
|
+
.collect(),
|
|
441
|
+
requires: requirements(&e.options),
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
out
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
pub fn activate(&self, eref: &Value) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
448
|
+
self.guard()?;
|
|
449
|
+
let entry = self.need(eref)?;
|
|
450
|
+
let (status, barred, myref) = {
|
|
451
|
+
let e = entry.borrow();
|
|
452
|
+
(e.status.clone(), e.barred, e.eref.clone())
|
|
453
|
+
};
|
|
454
|
+
if "live" == status {
|
|
455
|
+
return Ok(entry); // no-op returning success
|
|
456
|
+
}
|
|
457
|
+
if "failed" == status {
|
|
458
|
+
return fail(
|
|
459
|
+
"plugin_bad_state",
|
|
460
|
+
&format!("instance has failed: {}", myref),
|
|
461
|
+
details(&[("ref", Value::str(&myref))]),
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
// §9.6: `active: false` bars the instance from running, and the
|
|
465
|
+
// bar is on the INSTANCE rather than on the apply that set it.
|
|
466
|
+
// `ready` reaches this through `activate`, so one guard covers
|
|
467
|
+
// both verbs the design names.
|
|
468
|
+
if barred {
|
|
469
|
+
return fail(
|
|
470
|
+
"plugin_inactive",
|
|
471
|
+
&format!("instance is barred by active: false: {}", myref),
|
|
472
|
+
details(&[("ref", Value::str(&myref))]),
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
if "declared" == status {
|
|
476
|
+
self.load(&Value::str(&myref), &Value::map())?;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// A declared requirement that is not live means `pending`:
|
|
480
|
+
// activation is a STANDING REQUEST, not a one-shot event.
|
|
481
|
+
let unmet = self.unmetof(&entry);
|
|
482
|
+
if !unmet.is_empty() {
|
|
483
|
+
let mut e = entry.borrow_mut();
|
|
484
|
+
e.unmet = unmet;
|
|
485
|
+
e.status = "pending".to_string();
|
|
486
|
+
return Ok(entry.clone());
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if let Err(err) = self.run(&entry, "activate", "activate") {
|
|
490
|
+
// Unwind whatever the partial activation captured, in reverse.
|
|
491
|
+
self.unwind(&entry);
|
|
492
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
493
|
+
return Err(err);
|
|
494
|
+
}
|
|
495
|
+
// §11.4: THE SELECTION IS MADE HERE, once, and remembered. Every
|
|
496
|
+
// later question - the cascade, `hold`, `unmet` - reads it back
|
|
497
|
+
// rather than re-ranking, which is what "always-reluctant" means.
|
|
498
|
+
let reqs = requirements(&entry.borrow().options);
|
|
499
|
+
for req in reqs.iter() {
|
|
500
|
+
self.chosen(&entry, req, true);
|
|
501
|
+
}
|
|
502
|
+
entry.borrow_mut().status = "live".to_string();
|
|
503
|
+
self.reconcile();
|
|
504
|
+
Ok(entry)
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
pub fn deactivate(&self, eref: &Value) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
508
|
+
self.guard()?;
|
|
509
|
+
let entry = self.need(eref)?;
|
|
510
|
+
let (status, myref) = {
|
|
511
|
+
let e = entry.borrow();
|
|
512
|
+
(e.status.clone(), e.eref.clone())
|
|
513
|
+
};
|
|
514
|
+
if "loaded" == status || "declared" == status {
|
|
515
|
+
return Ok(entry);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// §5.2: `unload` is THE ONLY TRANSITION OUT OF `failed`.
|
|
519
|
+
if "failed" == status {
|
|
520
|
+
return fail(
|
|
521
|
+
"plugin_bad_state",
|
|
522
|
+
&format!("instance has failed: {}", myref),
|
|
523
|
+
details(&[("ref", Value::str(&myref))]),
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
if "pending" == status {
|
|
528
|
+
// DEACTIVATING A PENDING INSTANCE RUNS NO CALLBACK (§5.2). It
|
|
529
|
+
// never reached activate, so it holds no scope and no live
|
|
530
|
+
// bindings; running the definition's deactivate there would be
|
|
531
|
+
// teardown without matching setup, which plugins are not
|
|
532
|
+
// written to survive and which could fail an instance that had
|
|
533
|
+
// done nothing wrong. It cannot fail.
|
|
534
|
+
let mut e = entry.borrow_mut();
|
|
535
|
+
e.status = "loaded".to_string();
|
|
536
|
+
e.unmet = Vec::new();
|
|
537
|
+
return Ok(entry.clone());
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
self.held(&myref)?;
|
|
541
|
+
self.cascade(&myref, &mut BTreeSet::new());
|
|
542
|
+
|
|
543
|
+
if let Err(err) = self.run(&entry, "deactivate", "deactivate") {
|
|
544
|
+
self.unwind(&entry);
|
|
545
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
546
|
+
return Err(err);
|
|
547
|
+
}
|
|
548
|
+
let errors = self.unwind(&entry);
|
|
549
|
+
self.releasecheck(&entry, errors)?;
|
|
550
|
+
entry.borrow_mut().status = "loaded".to_string();
|
|
551
|
+
self.reconcile();
|
|
552
|
+
Ok(entry)
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
pub fn unload(&self, eref: &Value) -> Result<(), PluginError> {
|
|
556
|
+
self.guard()?;
|
|
557
|
+
let entry = self.need(eref)?;
|
|
558
|
+
let (mut status, myref) = {
|
|
559
|
+
let e = entry.borrow();
|
|
560
|
+
(e.status.clone(), e.eref.clone())
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
if "live" == status || "pending" == status {
|
|
564
|
+
if "live" == status {
|
|
565
|
+
self.held(&myref)?;
|
|
566
|
+
self.cascade(&myref, &mut BTreeSet::new());
|
|
567
|
+
if let Err(err) = self.run(&entry, "deactivate", "deactivate") {
|
|
568
|
+
// §5.2: ANY failure during a transition lands the
|
|
569
|
+
// instance in `failed`, with the scope STILL FULLY
|
|
570
|
+
// UNWOUND - and the instance STAYS REGISTERED, because
|
|
571
|
+
// `failed` is a state an operator has to be able to
|
|
572
|
+
// see.
|
|
573
|
+
self.unwind(&entry);
|
|
574
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
575
|
+
return Err(err);
|
|
576
|
+
}
|
|
577
|
+
let errors = self.unwind(&entry);
|
|
578
|
+
self.releasecheck(&entry, errors)?;
|
|
579
|
+
}
|
|
580
|
+
entry.borrow_mut().status = "loaded".to_string();
|
|
581
|
+
status = "loaded".to_string();
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
if "loaded" == status || "failed" == status {
|
|
585
|
+
let outcome = self.run(&entry, "close", "close");
|
|
586
|
+
self.0.inst.borrow_mut().remove(&myref);
|
|
587
|
+
return outcome;
|
|
588
|
+
}
|
|
589
|
+
self.0.inst.borrow_mut().remove(&myref);
|
|
590
|
+
Ok(())
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/// Runs the whole forward path in one call (§5.1).
|
|
594
|
+
pub fn ready(&self, eref: &Value) -> Result<Rc<RefCell<Entry>>, PluginError> {
|
|
595
|
+
self.guard()?;
|
|
596
|
+
let r = canon_ref(eref)?;
|
|
597
|
+
let known = self.0.inst.borrow().contains_key(&r);
|
|
598
|
+
if !known {
|
|
599
|
+
self.declare(&Value::str(&r), &Value::map())?;
|
|
600
|
+
}
|
|
601
|
+
let declared = "declared" == self.0.inst.borrow()[&r].borrow().status;
|
|
602
|
+
if declared {
|
|
603
|
+
self.load(&Value::str(&r), &Value::map())?;
|
|
604
|
+
}
|
|
605
|
+
self.activate(&Value::str(&r))
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/// Bindings go live only when activation succeeds (§8.1), so the
|
|
609
|
+
/// teardown is the exact inverse: reverse order, always. Returns the
|
|
610
|
+
/// errors the scope raised. §8.3: "A failing release does not stop the
|
|
611
|
+
/// rest. Every entry runs, in reverse order, whatever any of them
|
|
612
|
+
/// does; the errors are collected and raised as one
|
|
613
|
+
/// `plugin_release_failed`."
|
|
614
|
+
///
|
|
615
|
+
/// A selection belongs to ONE activation (§11.4). Leaving `live` by
|
|
616
|
+
/// any door drops it, so the next activation ranks afresh - keeping it
|
|
617
|
+
/// would make a consumer prefer a provider it never actually ran
|
|
618
|
+
/// against.
|
|
619
|
+
fn unwind(&self, entry: &Rc<RefCell<Entry>>) -> Vec<PluginError> {
|
|
620
|
+
// TAKE the scope out under a short borrow: the closures below
|
|
621
|
+
// reach back into this same entry (a foreign release records its
|
|
622
|
+
// index in `state`), and holding the borrow would panic.
|
|
623
|
+
let scope = {
|
|
624
|
+
let mut e = entry.borrow_mut();
|
|
625
|
+
e.selected = BTreeMap::new();
|
|
626
|
+
std::mem::take(&mut e.scope)
|
|
627
|
+
};
|
|
628
|
+
let mut errors = Vec::new();
|
|
629
|
+
for func in scope.iter().rev() {
|
|
630
|
+
if let Err(e) = func() {
|
|
631
|
+
errors.push(e);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
errors
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/// §8.3: "A failed release ends the instance in `failed`, exactly as a
|
|
638
|
+
/// failed callback does (5.2) - a release that raised may have leaked,
|
|
639
|
+
/// and an instance that may be holding resources it cannot account for
|
|
640
|
+
/// must not be reactivated."
|
|
641
|
+
fn releasecheck(
|
|
642
|
+
&self,
|
|
643
|
+
entry: &Rc<RefCell<Entry>>,
|
|
644
|
+
errors: Vec<PluginError>,
|
|
645
|
+
) -> Result<(), PluginError> {
|
|
646
|
+
if errors.is_empty() {
|
|
647
|
+
return Ok(());
|
|
648
|
+
}
|
|
649
|
+
let myref = entry.borrow().eref.clone();
|
|
650
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
651
|
+
let causes: Vec<String> = errors.iter().map(|e| e.message.clone()).collect();
|
|
652
|
+
fail(
|
|
653
|
+
"plugin_release_failed",
|
|
654
|
+
&format!("release failed for {}: {}", myref, causes.join("; ")),
|
|
655
|
+
details(&[
|
|
656
|
+
("ref", Value::str(&myref)),
|
|
657
|
+
(
|
|
658
|
+
"cause",
|
|
659
|
+
Value::List(causes.iter().map(|c| Value::str(c)).collect()),
|
|
660
|
+
),
|
|
661
|
+
]),
|
|
662
|
+
)
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/// A REQUIREMENT IS ON A CAPABILITY, not on a ref (§11.1). A bare
|
|
666
|
+
/// string is shorthand for `{name}`. A ref satisfies too, because a
|
|
667
|
+
/// host that genuinely needs a specific instance should not have to
|
|
668
|
+
/// invent a capability for it.
|
|
669
|
+
fn unmetof(&self, entry: &Rc<RefCell<Entry>>) -> Vec<String> {
|
|
670
|
+
let reqs = requirements(&entry.borrow().options);
|
|
671
|
+
reqs.iter()
|
|
672
|
+
.filter(|r| gatesactivation(r))
|
|
673
|
+
.filter(|r| self.providersof(r).is_empty())
|
|
674
|
+
.map(|r| r.get("name").as_str().unwrap_or("").to_string())
|
|
675
|
+
.collect()
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/// §11.4's always-reluctant selection, and the ONE place a provider is
|
|
679
|
+
/// picked for a live instance. If this instance already selected a
|
|
680
|
+
/// provider for `req` and that provider is STILL a candidate, it keeps
|
|
681
|
+
/// it - a better-ranked newcomer does not take it.
|
|
682
|
+
///
|
|
683
|
+
/// `remember` is false for the questions asked ABOUT an instance
|
|
684
|
+
/// rather than BY it: introspection must not create a binding.
|
|
685
|
+
fn chosen(&self, entry: &Rc<RefCell<Entry>>, req: &Value, remember: bool) -> Option<String> {
|
|
686
|
+
let cands = self.providersof(req);
|
|
687
|
+
if cands.is_empty() {
|
|
688
|
+
return None;
|
|
689
|
+
}
|
|
690
|
+
let name = req.get("name").as_str().unwrap_or("").to_string();
|
|
691
|
+
let held = entry.borrow().selected.get(&name).cloned();
|
|
692
|
+
if let Some(held) = held {
|
|
693
|
+
if cands
|
|
694
|
+
.iter()
|
|
695
|
+
.any(|c| c.get("ref").as_str() == Some(held.as_str()))
|
|
696
|
+
{
|
|
697
|
+
return Some(held);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
let best = cands[0].get("ref").as_str().unwrap_or("").to_string();
|
|
701
|
+
if remember {
|
|
702
|
+
entry.borrow_mut().selected.insert(name, best.clone());
|
|
703
|
+
}
|
|
704
|
+
Some(best)
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
fn boundproviders(&self, entry: &Rc<RefCell<Entry>>) -> Vec<String> {
|
|
708
|
+
let mut out: Vec<String> = Vec::new();
|
|
709
|
+
for req in requirements(&entry.borrow().options).iter() {
|
|
710
|
+
if !restartsonloss(req) {
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
if let Some(r) = self.chosen(entry, req, false) {
|
|
714
|
+
if !out.contains(&r) {
|
|
715
|
+
out.push(r);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
out
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/// Live instances whose selected provider is `eref` and which would be
|
|
723
|
+
/// restarted by losing it.
|
|
724
|
+
fn consumersof(&self, eref: &str) -> Vec<String> {
|
|
725
|
+
let all: Vec<(String, Rc<RefCell<Entry>>)> = self
|
|
726
|
+
.0
|
|
727
|
+
.inst
|
|
728
|
+
.borrow()
|
|
729
|
+
.iter()
|
|
730
|
+
.map(|(k, v)| (k.clone(), v.clone()))
|
|
731
|
+
.collect();
|
|
732
|
+
all.iter()
|
|
733
|
+
.filter(|(r, c)| r != eref && "live" == c.borrow().status)
|
|
734
|
+
.filter(|(_, c)| self.boundproviders(c).iter().any(|p| p == eref))
|
|
735
|
+
.map(|(r, _)| r.clone())
|
|
736
|
+
.collect()
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/// §11.3's `hold` asks a DIFFERENT question from the cascade, and
|
|
740
|
+
/// reading it off `consumersof` answered the cascade's.
|
|
741
|
+
///
|
|
742
|
+
/// The cascade wants the edges that RESTART - mandatory-static and
|
|
743
|
+
/// optional-static - because a restart is what it performs. `hold`
|
|
744
|
+
/// says "deactivating a REQUIRED instance is
|
|
745
|
+
/// `plugin_dependency_held`", and required is cardinality:
|
|
746
|
+
/// `gatesactivation`, not `restartsonloss`. The two sets differ in
|
|
747
|
+
/// both directions and each difference was a real bug.
|
|
748
|
+
fn holdersof(&self, eref: &str) -> Vec<String> {
|
|
749
|
+
let all: Vec<(String, Rc<RefCell<Entry>>)> = self
|
|
750
|
+
.0
|
|
751
|
+
.inst
|
|
752
|
+
.borrow()
|
|
753
|
+
.iter()
|
|
754
|
+
.map(|(k, v)| (k.clone(), v.clone()))
|
|
755
|
+
.collect();
|
|
756
|
+
let mut out = Vec::new();
|
|
757
|
+
for (r, c) in all.iter() {
|
|
758
|
+
if r == eref || "live" != c.borrow().status {
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
for req in requirements(&c.borrow().options).iter() {
|
|
762
|
+
if !gatesactivation(req) {
|
|
763
|
+
continue;
|
|
764
|
+
}
|
|
765
|
+
if self.chosen(c, req, false).as_deref() == Some(eref) {
|
|
766
|
+
out.push(r.clone());
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
out
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
fn providersof(&self, req: &Value) -> Vec<Value> {
|
|
775
|
+
let want = canon(req.get("name").as_str().unwrap_or(""));
|
|
776
|
+
let name = req.get("name");
|
|
777
|
+
let mut cands: Vec<Value> = Vec::new();
|
|
778
|
+
let all: Vec<(String, Rc<RefCell<Entry>>)> = self
|
|
779
|
+
.0
|
|
780
|
+
.inst
|
|
781
|
+
.borrow()
|
|
782
|
+
.iter()
|
|
783
|
+
.map(|(k, v)| (k.clone(), v.clone()))
|
|
784
|
+
.collect();
|
|
785
|
+
for (eref, target) in all.iter() {
|
|
786
|
+
let t = target.borrow();
|
|
787
|
+
if "live" != t.status {
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
// A ref satisfies directly.
|
|
791
|
+
if *eref == want {
|
|
792
|
+
let mut cand = Value::map();
|
|
793
|
+
cand.set("ref", Value::str(eref));
|
|
794
|
+
cand.set("pos", Value::Num(t.pos));
|
|
795
|
+
let mut prov = Value::map();
|
|
796
|
+
prov.set("name", name.clone());
|
|
797
|
+
cand.set("provides", prov);
|
|
798
|
+
cands.push(cand);
|
|
799
|
+
continue;
|
|
800
|
+
}
|
|
801
|
+
for prov in t.provides.iter() {
|
|
802
|
+
if !prov.get("name").same(&name) {
|
|
803
|
+
continue;
|
|
804
|
+
}
|
|
805
|
+
let mut cand = Value::map();
|
|
806
|
+
cand.set("ref", Value::str(eref));
|
|
807
|
+
cand.set("pos", Value::Num(t.pos));
|
|
808
|
+
cand.set("provides", prov.clone());
|
|
809
|
+
cands.push(cand);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
resolve_capability(req, &cands)
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/// CONSUMERS GO DOWN FIRST, NOT AFTERWARDS (§11.3).
|
|
816
|
+
///
|
|
817
|
+
/// The cascade is part of the provider's own deactivation and runs
|
|
818
|
+
/// BEFORE the provider's `deactivate` callback and scope unwind, so a
|
|
819
|
+
/// consumer's teardown can still call the thing it depends on -
|
|
820
|
+
/// flushing a buffer to the store it is about to lose is exactly what
|
|
821
|
+
/// a `deactivate` callback is for, and a cascade that fired after the
|
|
822
|
+
/// provider was already gone would make that impossible.
|
|
823
|
+
fn cascade(&self, provider: &str, seen: &mut BTreeSet<String>) {
|
|
824
|
+
if seen.contains(provider) {
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
seen.insert(provider.to_string());
|
|
828
|
+
|
|
829
|
+
for r in self.consumersof(provider) {
|
|
830
|
+
let consumer = match self.0.inst.borrow().get(&r) {
|
|
831
|
+
Some(c) => c.clone(),
|
|
832
|
+
None => continue,
|
|
833
|
+
};
|
|
834
|
+
if "live" != consumer.borrow().status {
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
self.cascade(&r, seen); // deepest-first
|
|
839
|
+
let bad = self.run(&consumer, "deactivate", "deactivate").is_err();
|
|
840
|
+
let errors = self.unwind(&consumer);
|
|
841
|
+
if bad || !errors.is_empty() {
|
|
842
|
+
// §5.2: ANY failure during a transition lands the instance
|
|
843
|
+
// in `failed`. Marking it `pending` handed it straight
|
|
844
|
+
// back to `reconcile`, which would activate it again the
|
|
845
|
+
// moment the provider returned.
|
|
846
|
+
consumer.borrow_mut().status = "failed".to_string();
|
|
847
|
+
continue;
|
|
848
|
+
}
|
|
849
|
+
let unmet = self.unmetof(&consumer);
|
|
850
|
+
let mut c = consumer.borrow_mut();
|
|
851
|
+
c.status = "pending".to_string();
|
|
852
|
+
c.unmet = unmet;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/// The hold check is A GUARD ON AD-HOC DEACTIVATION, NOT ON
|
|
857
|
+
/// COORDINATED TEARDOWN. In a bulk operation that is removing the
|
|
858
|
+
/// holders too - `close`, or an `apply` plan whose own steps
|
|
859
|
+
/// deactivate them - it is suspended for exactly those holders, and
|
|
860
|
+
/// the teardown still runs consumers before providers.
|
|
861
|
+
fn held(&self, eref: &str) -> Result<(), PluginError> {
|
|
862
|
+
if "hold" != self.0.dependency {
|
|
863
|
+
return Ok(());
|
|
864
|
+
}
|
|
865
|
+
if self.0.coordinated.get() {
|
|
866
|
+
return Ok(());
|
|
867
|
+
}
|
|
868
|
+
let holders = self.holdersof(eref);
|
|
869
|
+
if holders.is_empty() {
|
|
870
|
+
return Ok(());
|
|
871
|
+
}
|
|
872
|
+
fail(
|
|
873
|
+
"plugin_dependency_held",
|
|
874
|
+
&format!("instance is required by live consumers: {}", eref),
|
|
875
|
+
details(&[
|
|
876
|
+
("ref", Value::str(eref)),
|
|
877
|
+
(
|
|
878
|
+
"holders",
|
|
879
|
+
Value::List(holders.iter().map(|h| Value::str(h)).collect()),
|
|
880
|
+
),
|
|
881
|
+
]),
|
|
882
|
+
)
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/// EAGER reconciliation: run to a fixed point rather than scheduling.
|
|
886
|
+
///
|
|
887
|
+
/// Two directions, and both are the reason `pending` exists.
|
|
888
|
+
/// Activation is a STANDING REQUEST, not a one-shot event.
|
|
889
|
+
fn reconcile(&self) {
|
|
890
|
+
let mut moved = true;
|
|
891
|
+
let mut rounds = 0;
|
|
892
|
+
while moved {
|
|
893
|
+
moved = false;
|
|
894
|
+
rounds += 1;
|
|
895
|
+
if 1000 < rounds {
|
|
896
|
+
break;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// Losses first, so a cascade settles in one pass rather than
|
|
900
|
+
// alternating with re-activations.
|
|
901
|
+
let refs: Vec<String> = self.0.inst.borrow().keys().cloned().collect();
|
|
902
|
+
for r in refs.iter() {
|
|
903
|
+
let entry = match self.0.inst.borrow().get(r) {
|
|
904
|
+
Some(e) => e.clone(),
|
|
905
|
+
None => continue,
|
|
906
|
+
};
|
|
907
|
+
if "live" != entry.borrow().status {
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
let reqs = requirements(&entry.borrow().options);
|
|
911
|
+
let lost: Vec<&Value> = reqs
|
|
912
|
+
.iter()
|
|
913
|
+
.filter(|q| gatesactivation(q))
|
|
914
|
+
.filter(|q| self.providersof(q).is_empty())
|
|
915
|
+
.collect();
|
|
916
|
+
if lost.is_empty() {
|
|
917
|
+
continue;
|
|
918
|
+
}
|
|
919
|
+
// POLICY IS PER REQUIREMENT, not per instance (§11.3). A
|
|
920
|
+
// `dynamic` requirement whose provider is gone leaves the
|
|
921
|
+
// consumer LIVE and notified.
|
|
922
|
+
if !lost.iter().any(|q| restartsonloss(q)) {
|
|
923
|
+
continue;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
let bad = self.run(&entry, "deactivate", "deactivate").is_err();
|
|
927
|
+
let errors = self.unwind(&entry);
|
|
928
|
+
if bad || !errors.is_empty() {
|
|
929
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
930
|
+
moved = true;
|
|
931
|
+
continue;
|
|
932
|
+
}
|
|
933
|
+
let unmet = self.unmetof(&entry);
|
|
934
|
+
let mut e = entry.borrow_mut();
|
|
935
|
+
e.status = "pending".to_string();
|
|
936
|
+
e.unmet = unmet;
|
|
937
|
+
moved = true;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
let refs: Vec<String> = self.0.inst.borrow().keys().cloned().collect();
|
|
941
|
+
for r in refs.iter() {
|
|
942
|
+
let entry = match self.0.inst.borrow().get(r) {
|
|
943
|
+
Some(e) => e.clone(),
|
|
944
|
+
None => continue,
|
|
945
|
+
};
|
|
946
|
+
if "pending" != entry.borrow().status {
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
if !self.unmetof(&entry).is_empty() {
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
match self.run(&entry, "activate", "activate") {
|
|
953
|
+
Ok(()) => {
|
|
954
|
+
let mut e = entry.borrow_mut();
|
|
955
|
+
e.status = "live".to_string();
|
|
956
|
+
e.unmet = Vec::new();
|
|
957
|
+
moved = true;
|
|
958
|
+
}
|
|
959
|
+
Err(_) => {
|
|
960
|
+
self.unwind(&entry);
|
|
961
|
+
entry.borrow_mut().status = "failed".to_string();
|
|
962
|
+
moved = true;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
// --- ordering ---------------------------------------------------
|
|
970
|
+
|
|
971
|
+
pub fn order(&self, point: Option<&str>) -> Result<Vec<String>, PluginError> {
|
|
972
|
+
// Sorted by declaration SEQUENCE, which is what makes the §7
|
|
973
|
+
// sort's fall-through deterministic in a language whose maps have
|
|
974
|
+
// no insertion order. §7 breaks ties by `pos`; two instances CAN
|
|
975
|
+
// share one - `declare` defaults `pos` to the registry size, so an
|
|
976
|
+
// unload followed by a fresh declare reuses a surviving
|
|
977
|
+
// instance's - and past that this was falling through to map
|
|
978
|
+
// order. `seq` is that order, made explicit.
|
|
979
|
+
let mut live: Vec<Binding> = Vec::new();
|
|
980
|
+
for entry in self.0.inst.borrow().values() {
|
|
981
|
+
let e = entry.borrow();
|
|
982
|
+
if "live" != e.status {
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
live.push(Binding {
|
|
986
|
+
eref: e.eref.clone(),
|
|
987
|
+
pos: e.pos,
|
|
988
|
+
order: e.order.clone(),
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
let seqof: BTreeMap<String, f64> = self
|
|
992
|
+
.0
|
|
993
|
+
.inst
|
|
994
|
+
.borrow()
|
|
995
|
+
.iter()
|
|
996
|
+
.map(|(k, v)| (k.clone(), v.borrow().seq))
|
|
997
|
+
.collect();
|
|
998
|
+
live.sort_by(|a, b| {
|
|
999
|
+
seqof[&a.eref]
|
|
1000
|
+
.partial_cmp(&seqof[&b.eref])
|
|
1001
|
+
.unwrap_or(std::cmp::Ordering::Equal)
|
|
1002
|
+
});
|
|
1003
|
+
|
|
1004
|
+
let pin = match point {
|
|
1005
|
+
Some(p) => self.0.points.get(p).get("pin"),
|
|
1006
|
+
None => Value::Null,
|
|
1007
|
+
};
|
|
1008
|
+
resolve_order(&live, &pin)
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
// --- points -----------------------------------------------------
|
|
1012
|
+
|
|
1013
|
+
/// Live bindings on a point, in resolved order. Recomputed on any
|
|
1014
|
+
/// change to the live set (§7) rather than cached at startup - the bug
|
|
1015
|
+
/// a host discovers only when something deactivates in production.
|
|
1016
|
+
fn bound(&self, point: &str) -> Result<Vec<Bound>, PluginError> {
|
|
1017
|
+
let mut out = Vec::new();
|
|
1018
|
+
for eref in self.order(Some(point))? {
|
|
1019
|
+
let entry = match self.0.inst.borrow().get(&eref) {
|
|
1020
|
+
Some(e) => e.clone(),
|
|
1021
|
+
None => continue,
|
|
1022
|
+
};
|
|
1023
|
+
let e = entry.borrow();
|
|
1024
|
+
// The band is the INSTANCE's ordering block (§7), stamped by
|
|
1025
|
+
// the host. A plugin passing its own would be ranking itself
|
|
1026
|
+
// above the order its document declared.
|
|
1027
|
+
let band = e.order.get("band").as_int().unwrap_or(0);
|
|
1028
|
+
for b in e.bindings.iter() {
|
|
1029
|
+
if b.point != point {
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
let mut b = b.clone();
|
|
1033
|
+
b.band = band;
|
|
1034
|
+
out.push(b);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
Ok(out)
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
fn pointspec(&self, point: &str, want: &str) -> Result<Value, PluginError> {
|
|
1041
|
+
if !self.0.points.has(point) {
|
|
1042
|
+
return fail(
|
|
1043
|
+
"plugin_point_unknown",
|
|
1044
|
+
&format!("no such point: {}", point),
|
|
1045
|
+
details(&[("point", Value::str(point))]),
|
|
1046
|
+
);
|
|
1047
|
+
}
|
|
1048
|
+
let spec = self.0.points.get(point);
|
|
1049
|
+
let kind = spec.get("kind");
|
|
1050
|
+
if "hook" == want {
|
|
1051
|
+
// A point with no declared kind is a hook, which is what makes
|
|
1052
|
+
// `{}` the minimal point declaration.
|
|
1053
|
+
if !kind.is_null() && kind.as_str() != Some("hook") {
|
|
1054
|
+
return fail(
|
|
1055
|
+
"plugin_point_kind",
|
|
1056
|
+
&format!("point is not a hook: {}", point),
|
|
1057
|
+
details(&[("point", Value::str(point)), ("kind", kind)]),
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
return Ok(spec);
|
|
1061
|
+
}
|
|
1062
|
+
if kind.as_str() != Some(want) {
|
|
1063
|
+
return fail(
|
|
1064
|
+
"plugin_point_kind",
|
|
1065
|
+
&format!("point is not a {}: {}", want, point),
|
|
1066
|
+
details(&[("point", Value::str(point)), ("kind", kind)]),
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
Ok(spec)
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
pub fn emit(&self, point: &str, arg: &Value) -> Result<Value, PluginError> {
|
|
1073
|
+
let spec = self.pointspec(point, "hook")?;
|
|
1074
|
+
let mode = spec.get("mode");
|
|
1075
|
+
let mode = mode.as_str().unwrap_or("emit");
|
|
1076
|
+
point_emit(&self.bound(point)?, mode, arg)
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
pub fn call(&self, point: &str, args: &[Value]) -> Result<Value, PluginError> {
|
|
1080
|
+
let spec = self.pointspec(point, "chain")?;
|
|
1081
|
+
let base: NextFn = match spec.get("base") {
|
|
1082
|
+
Value::Opaque(o) => match o.downcast_ref::<NextFn>() {
|
|
1083
|
+
Some(f) => f.clone(),
|
|
1084
|
+
None => Rc::new(|a: &[Value]| Ok(a.first().cloned().unwrap_or(Value::Null))),
|
|
1085
|
+
},
|
|
1086
|
+
_ => Rc::new(|a: &[Value]| Ok(a.first().cloned().unwrap_or(Value::Null))),
|
|
1087
|
+
};
|
|
1088
|
+
compose(&self.bound(point)?, base)(args)
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
pub fn provider(&self, point: &str, args: &[Value]) -> Result<Value, PluginError> {
|
|
1092
|
+
let spec = self.pointspec(point, "provider")?;
|
|
1093
|
+
let pick = point_provider(&self.bound(point)?, &spec)?;
|
|
1094
|
+
match pick.winner {
|
|
1095
|
+
None => Ok(spec.get("default")),
|
|
1096
|
+
Some(w) => (w.func)(None, args),
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/// The losers are VISIBLE rather than silently ignored (§6.3).
|
|
1101
|
+
pub fn shadowed(&self, point: &str) -> Result<Vec<String>, PluginError> {
|
|
1102
|
+
if !self.0.points.has(point) {
|
|
1103
|
+
return Ok(Vec::new());
|
|
1104
|
+
}
|
|
1105
|
+
let spec = self.0.points.get(point);
|
|
1106
|
+
Ok(point_provider(&self.bound(point)?, &spec)?.shadowed)
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
pub fn exports(&self, spec: &str) -> Result<Value, PluginError> {
|
|
1110
|
+
let mut all: Vec<Exported> = Vec::new();
|
|
1111
|
+
for (eref, entry) in self.0.inst.borrow().iter() {
|
|
1112
|
+
let e = entry.borrow();
|
|
1113
|
+
// Exports of a `loaded` (not live) instance are VISIBLE (§11).
|
|
1114
|
+
if "declared" == e.status || "failed" == e.status {
|
|
1115
|
+
continue;
|
|
1116
|
+
}
|
|
1117
|
+
for (key, value) in e.exports.iter() {
|
|
1118
|
+
all.push(Exported {
|
|
1119
|
+
eref: eref.clone(),
|
|
1120
|
+
key: key.clone(),
|
|
1121
|
+
value: value.clone(),
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
resolve_export(spec, &all)
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/// The live providers of a capability, best-first (§11.1).
|
|
1129
|
+
pub fn capability(&self, name: &str) -> Vec<String> {
|
|
1130
|
+
let mut cands: Vec<Value> = Vec::new();
|
|
1131
|
+
for (eref, entry) in self.0.inst.borrow().iter() {
|
|
1132
|
+
let e = entry.borrow();
|
|
1133
|
+
if "live" != e.status {
|
|
1134
|
+
continue;
|
|
1135
|
+
}
|
|
1136
|
+
for prov in e.provides.iter() {
|
|
1137
|
+
if prov.get("name").as_str() != Some(name) {
|
|
1138
|
+
continue;
|
|
1139
|
+
}
|
|
1140
|
+
let mut cand = Value::map();
|
|
1141
|
+
cand.set("ref", Value::str(eref));
|
|
1142
|
+
cand.set("pos", Value::Num(e.pos));
|
|
1143
|
+
cand.set("provides", prov.clone());
|
|
1144
|
+
cands.push(cand);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
let mut req = Value::map();
|
|
1148
|
+
req.set("name", Value::str(name));
|
|
1149
|
+
resolve_capability(&req, &cands)
|
|
1150
|
+
.iter()
|
|
1151
|
+
.map(|c| c.get("ref").as_str().unwrap_or("").to_string())
|
|
1152
|
+
.collect()
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// --- documents --------------------------------------------------
|
|
1156
|
+
|
|
1157
|
+
/// §9.6: "load what is missing, UNLOAD WHAT IS GONE, patch what
|
|
1158
|
+
/// changed, and move activation state to match", with the stated
|
|
1159
|
+
/// ordering - "deactivations and unloads first (reverse load order),
|
|
1160
|
+
/// then loads, then activations in load order".
|
|
1161
|
+
///
|
|
1162
|
+
/// FOUR PHASES, NOT ONE INTERLEAVED LOOP. An earlier draft walked the
|
|
1163
|
+
/// document once, which never looked at instances the new document had
|
|
1164
|
+
/// DROPPED - so an integration removed from a config reload stayed live
|
|
1165
|
+
/// with its bindings and resources.
|
|
1166
|
+
pub fn apply(&self, doc: &Value, profile: &Value) -> Result<(), PluginError> {
|
|
1167
|
+
self.guard()?;
|
|
1168
|
+
let profile = if profile.is_null() {
|
|
1169
|
+
self.0.opts.get("profile")
|
|
1170
|
+
} else {
|
|
1171
|
+
profile.clone()
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
let mut input = Value::map();
|
|
1175
|
+
input.set("doc", doc.clone());
|
|
1176
|
+
input.set("profile", profile.clone());
|
|
1177
|
+
input.set("keys", self.0.opts.get("keys"));
|
|
1178
|
+
input.set("reserved", self.0.reserved.clone());
|
|
1179
|
+
let norm = normalize_config(&input)?;
|
|
1180
|
+
|
|
1181
|
+
let want: Vec<String> = norm
|
|
1182
|
+
.get("order")
|
|
1183
|
+
.as_list()
|
|
1184
|
+
.cloned()
|
|
1185
|
+
.unwrap_or_default()
|
|
1186
|
+
.iter()
|
|
1187
|
+
.map(|r| r.as_str().unwrap_or("").to_string())
|
|
1188
|
+
.collect();
|
|
1189
|
+
|
|
1190
|
+
let defaults = self.0.opts.get("defaults");
|
|
1191
|
+
let mut optionsof: BTreeMap<String, Value> = BTreeMap::new();
|
|
1192
|
+
for eref in want.iter() {
|
|
1193
|
+
let mut oin = Value::map();
|
|
1194
|
+
oin.set("ref", Value::str(eref));
|
|
1195
|
+
oin.set("doc", doc.clone());
|
|
1196
|
+
oin.set("profile", profile.clone());
|
|
1197
|
+
oin.set("shape", self.shapeof(eref));
|
|
1198
|
+
oin.set("hostdefaults", defaults.get(&refname(eref)));
|
|
1199
|
+
optionsof.insert(eref.clone(), resolve_options(&oin)?);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
// Should this ref be LIVE after the apply? False for a ref the
|
|
1203
|
+
// document declares lazy or inactive AND for one it does not name
|
|
1204
|
+
// at all - which is what makes "unload what is gone" and "unload
|
|
1205
|
+
// what was toggled off" one rule rather than two.
|
|
1206
|
+
let instances = norm.get("instance");
|
|
1207
|
+
let wantlive = |eref: &str| -> bool {
|
|
1208
|
+
let ent = instances.get(eref);
|
|
1209
|
+
!ent.is_null()
|
|
1210
|
+
&& ent.get("active").truthy()
|
|
1211
|
+
&& ent.get("start").as_str() == Some("eager")
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
// --- phase 1: deactivations and unloads, REVERSE load order ----
|
|
1215
|
+
let mut drop: Vec<(String, f64)> = Vec::new();
|
|
1216
|
+
for (eref, entry) in self.0.inst.borrow().iter() {
|
|
1217
|
+
if "declared" == entry.borrow().status || wantlive(eref) {
|
|
1218
|
+
continue;
|
|
1219
|
+
}
|
|
1220
|
+
drop.push((eref.clone(), entry.borrow().pos));
|
|
1221
|
+
}
|
|
1222
|
+
// Highest `pos` first, ref-descending for a tie, so a consumer
|
|
1223
|
+
// declared after its provider goes down first.
|
|
1224
|
+
drop.sort_by(|a, b| {
|
|
1225
|
+
b.1.partial_cmp(&a.1)
|
|
1226
|
+
.unwrap_or(std::cmp::Ordering::Equal)
|
|
1227
|
+
.then(b.0.cmp(&a.0))
|
|
1228
|
+
});
|
|
1229
|
+
for (eref, _) in drop.iter() {
|
|
1230
|
+
self.unload(&Value::str(eref))?;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
// --- phase 2: declare and patch EVERYTHING, in load order ------
|
|
1234
|
+
for eref in want.iter() {
|
|
1235
|
+
let ent = instances.get(eref);
|
|
1236
|
+
let mut spec = Value::map();
|
|
1237
|
+
spec.set("options", optionsof[eref].clone());
|
|
1238
|
+
spec.set("order", ent.get("order"));
|
|
1239
|
+
spec.set("pos", ent.get("pos"));
|
|
1240
|
+
let entry = self.declare(&Value::str(eref), &spec)?;
|
|
1241
|
+
let mut e = entry.borrow_mut();
|
|
1242
|
+
// The bar is REASSERTED ON EVERY APPLY, in both directions - a
|
|
1243
|
+
// document that turns the instance back on clears it, which is
|
|
1244
|
+
// the whole point of a config switch.
|
|
1245
|
+
e.barred = !ent.get("active").truthy();
|
|
1246
|
+
// REPLACE rather than refill: a rust callback holds the `Inst`
|
|
1247
|
+
// and reads `options` back through the entry every time, so
|
|
1248
|
+
// there is no captured map to keep in sync.
|
|
1249
|
+
e.options = optionsof[eref].clone();
|
|
1250
|
+
e.order = ent.get("order");
|
|
1251
|
+
e.pos = ent.get("pos").as_num().unwrap_or(0.0);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
// --- phase 3: loads, in load order -----------------------------
|
|
1255
|
+
// ONLY THE EAGER, ACTIVE ONES: "a document of twenty lazy
|
|
1256
|
+
// instances is twenty map entries and no executed code" (§9.6).
|
|
1257
|
+
for eref in want.iter() {
|
|
1258
|
+
if wantlive(eref) {
|
|
1259
|
+
self.load(&Value::str(eref), &Value::map())?;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
// --- phase 4: activations, in load order -----------------------
|
|
1264
|
+
for eref in want.iter() {
|
|
1265
|
+
if wantlive(eref) {
|
|
1266
|
+
self.activate(&Value::str(eref))?;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
Ok(())
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
fn shapeof(&self, eref: &str) -> Value {
|
|
1273
|
+
match self.0.catalog.borrow().get(&refname(eref)) {
|
|
1274
|
+
Some(d) => d.shape.clone(),
|
|
1275
|
+
None => Value::Null,
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
pub fn options(&self, eref: &Value, patch: &Value) -> Result<(), PluginError> {
|
|
1280
|
+
self.guard()?;
|
|
1281
|
+
let entry = self.need(eref)?;
|
|
1282
|
+
let (myref, previous, status) = {
|
|
1283
|
+
let e = entry.borrow();
|
|
1284
|
+
(e.eref.clone(), e.options.clone(), e.status.clone())
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1287
|
+
let mut merged = previous.clone();
|
|
1288
|
+
for k in patch.keys() {
|
|
1289
|
+
merged.set(&k, patch.get(&k));
|
|
1290
|
+
}
|
|
1291
|
+
let mut input = Value::map();
|
|
1292
|
+
input.set("ref", Value::str(&myref));
|
|
1293
|
+
input.set("shape", self.shapeof(&myref));
|
|
1294
|
+
input.set("doc", Value::map());
|
|
1295
|
+
input.set("patch", merged);
|
|
1296
|
+
let resolved = resolve_options(&input)?;
|
|
1297
|
+
entry.borrow_mut().options = resolved;
|
|
1298
|
+
|
|
1299
|
+
if "live" != status {
|
|
1300
|
+
return Ok(());
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
let reconfigure = entry.borrow().def.reconfigure.clone();
|
|
1304
|
+
match reconfigure {
|
|
1305
|
+
Some(func) => {
|
|
1306
|
+
self.0.transition.set(true);
|
|
1307
|
+
let inst = Inst::new(self.clone(), entry.clone())?;
|
|
1308
|
+
let now = entry.borrow().options.clone();
|
|
1309
|
+
let outcome = func(&inst, &now, &previous);
|
|
1310
|
+
self.0.transition.set(false);
|
|
1311
|
+
outcome
|
|
1312
|
+
}
|
|
1313
|
+
None => {
|
|
1314
|
+
// Always correct and sometimes expensive; `reconfigure`
|
|
1315
|
+
// exists to make the common case cheap (§9.4).
|
|
1316
|
+
self.deactivate(&Value::str(&myref))?;
|
|
1317
|
+
self.activate(&Value::str(&myref))?;
|
|
1318
|
+
Ok(())
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
pub fn close(&self) -> Result<(), PluginError> {
|
|
1324
|
+
// A bulk teardown removing the holders too, so `hold` is suspended
|
|
1325
|
+
// for exactly those holders (§11.3) - while the consumers-first
|
|
1326
|
+
// cascade still runs, which is the half that matters.
|
|
1327
|
+
self.0.coordinated.set(true);
|
|
1328
|
+
let refs: Vec<String> = self.0.inst.borrow().keys().rev().cloned().collect();
|
|
1329
|
+
let mut outcome = Ok(());
|
|
1330
|
+
for eref in refs.iter() {
|
|
1331
|
+
if self.0.inst.borrow().contains_key(eref) {
|
|
1332
|
+
if let Err(e) = self.unload(&Value::str(eref)) {
|
|
1333
|
+
outcome = Err(e);
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
self.0.coordinated.set(false);
|
|
1339
|
+
outcome
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/// The same record §6.6 gives a plugin about itself, reachable from
|
|
1343
|
+
/// outside for the corpus.
|
|
1344
|
+
pub fn positionof(&self, eref: &str, point: Option<&str>) -> Result<Value, PluginError> {
|
|
1345
|
+
let myref = canon(eref);
|
|
1346
|
+
let entry = self.0.inst.borrow().get(&myref).cloned();
|
|
1347
|
+
if entry.is_none() {
|
|
1348
|
+
return fail(
|
|
1349
|
+
"plugin_not_loaded",
|
|
1350
|
+
&format!("no such instance: {}", eref),
|
|
1351
|
+
details(&[("ref", Value::str(eref))]),
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
let ranked = self.order(point)?;
|
|
1355
|
+
let index = ranked.iter().position(|r| *r == myref);
|
|
1356
|
+
let index = index.map(|i| i as i64).unwrap_or(-1);
|
|
1357
|
+
let mut out = Value::map();
|
|
1358
|
+
out.set("index", Value::Num(index as f64));
|
|
1359
|
+
out.set("count", Value::Num(ranked.len() as f64));
|
|
1360
|
+
// §6.2 composes b1(b2(b3(base))) with the FIRST binding OUTERMOST,
|
|
1361
|
+
// so these are not index 0 and index count-1 the other way round.
|
|
1362
|
+
out.set("outermost", Value::Bool(0 == index));
|
|
1363
|
+
out.set(
|
|
1364
|
+
"innermost",
|
|
1365
|
+
Value::Bool(index == ranked.len() as i64 - 1),
|
|
1366
|
+
);
|
|
1367
|
+
Ok(out)
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// ---------------------------------------------------------------------
|
|
1372
|
+
// Inst - what a definition's callbacks see
|
|
1373
|
+
// ---------------------------------------------------------------------
|
|
1374
|
+
//
|
|
1375
|
+
// Deliberately not the internal record: a plugin that could reach `status`
|
|
1376
|
+
// could also write it.
|
|
1377
|
+
|
|
1378
|
+
#[derive(Clone)]
|
|
1379
|
+
pub struct Inst {
|
|
1380
|
+
pub host: Host,
|
|
1381
|
+
pub entry: Rc<RefCell<Entry>>,
|
|
1382
|
+
pub eref: String,
|
|
1383
|
+
pub name: String,
|
|
1384
|
+
pub tag: String,
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
impl Inst {
|
|
1388
|
+
pub fn new(host: Host, entry: Rc<RefCell<Entry>>) -> Result<Inst, PluginError> {
|
|
1389
|
+
let eref = entry.borrow().eref.clone();
|
|
1390
|
+
let parsed = parse_ref(&Value::str(&eref))?;
|
|
1391
|
+
Ok(Inst {
|
|
1392
|
+
host,
|
|
1393
|
+
entry,
|
|
1394
|
+
name: parsed.get("name").as_str().unwrap_or("").to_string(),
|
|
1395
|
+
tag: parsed.get("tag").as_str().unwrap_or("").to_string(),
|
|
1396
|
+
eref,
|
|
1397
|
+
})
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
/// The resolved options, READ FRESH. `apply` and `options` replace the
|
|
1401
|
+
/// map wholesale, so a callback that cached this at `define` would
|
|
1402
|
+
/// hold the values a later document already changed.
|
|
1403
|
+
pub fn options(&self) -> Value {
|
|
1404
|
+
self.entry.borrow().options.clone()
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
pub fn state(&self) -> Value {
|
|
1408
|
+
self.entry.borrow().state.clone()
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
pub fn state_get(&self, key: &str) -> Value {
|
|
1412
|
+
self.entry.borrow().state.get(key)
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
pub fn state_set(&self, key: &str, value: Value) {
|
|
1416
|
+
self.entry.borrow_mut().state.set(key, value);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
/// Foreign resources the host did not hand out are registered
|
|
1420
|
+
/// explicitly (§8.3); host calls are recorded automatically.
|
|
1421
|
+
///
|
|
1422
|
+
/// SYMMETRIC WITH `acquire`, and it has to be: `open` counts the
|
|
1423
|
+
/// resources CURRENTLY HELD, so an entry that is registered and then
|
|
1424
|
+
/// unwound must leave the count where it found it.
|
|
1425
|
+
pub fn release(
|
|
1426
|
+
&self,
|
|
1427
|
+
func: Rc<dyn Fn() -> Result<(), PluginError>>,
|
|
1428
|
+
) -> Result<(), PluginError> {
|
|
1429
|
+
// §8.3: "`inst.release` outside `activate` is
|
|
1430
|
+
// `plugin_release_scope`". A flag saying merely that a transition
|
|
1431
|
+
// is running is true in `define` too, and a scope entry registered
|
|
1432
|
+
// there is never unwound.
|
|
1433
|
+
if "activate" != self.host.phase() {
|
|
1434
|
+
return fail(
|
|
1435
|
+
"plugin_release_scope",
|
|
1436
|
+
"release called outside activate",
|
|
1437
|
+
Value::Null,
|
|
1438
|
+
);
|
|
1439
|
+
}
|
|
1440
|
+
let host = self.host.clone();
|
|
1441
|
+
let done = Cell::new(false);
|
|
1442
|
+
let entry = Rc::new(move || {
|
|
1443
|
+
if done.get() {
|
|
1444
|
+
return Ok(());
|
|
1445
|
+
}
|
|
1446
|
+
done.set(true);
|
|
1447
|
+
host.open_dec();
|
|
1448
|
+
func()
|
|
1449
|
+
});
|
|
1450
|
+
self.entry.borrow_mut().scope.push(entry);
|
|
1451
|
+
self.host.open_inc();
|
|
1452
|
+
Ok(())
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/// The synthetic counter the driver owns, so "what is open" is data
|
|
1456
|
+
/// rather than an assertion each port words differently.
|
|
1457
|
+
///
|
|
1458
|
+
/// Returns its own release, so a plugin can hand one back early. The
|
|
1459
|
+
/// scope still holds the entry and unwinding it twice is a no-op -
|
|
1460
|
+
/// releasing early must not make teardown wrong.
|
|
1461
|
+
pub fn acquire(&self) -> Result<ScopeFn, PluginError> {
|
|
1462
|
+
// §8.1: resources are "acquired during `activate` - the scope's
|
|
1463
|
+
// actual job". Same reason as `release` above.
|
|
1464
|
+
if "activate" != self.host.phase() {
|
|
1465
|
+
return fail(
|
|
1466
|
+
"plugin_release_scope",
|
|
1467
|
+
"acquire called outside activate",
|
|
1468
|
+
Value::Null,
|
|
1469
|
+
);
|
|
1470
|
+
}
|
|
1471
|
+
let host = self.host.clone();
|
|
1472
|
+
let done = Cell::new(false);
|
|
1473
|
+
let rel: ScopeFn = Rc::new(move || {
|
|
1474
|
+
if done.get() {
|
|
1475
|
+
return Ok(());
|
|
1476
|
+
}
|
|
1477
|
+
done.set(true);
|
|
1478
|
+
host.open_dec();
|
|
1479
|
+
Ok(())
|
|
1480
|
+
});
|
|
1481
|
+
self.entry.borrow_mut().scope.push(rel.clone());
|
|
1482
|
+
self.host.open_inc();
|
|
1483
|
+
Ok(rel)
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/// Bind into a host point. Declared in `define`; the host inserts it
|
|
1487
|
+
/// only after `activate` returns successfully (§8.1), which is why a
|
|
1488
|
+
/// failing activate leaves no live binding behind.
|
|
1489
|
+
pub fn bind(
|
|
1490
|
+
&self,
|
|
1491
|
+
point: &str,
|
|
1492
|
+
func: super::point::BindFn,
|
|
1493
|
+
band: &Value,
|
|
1494
|
+
) -> Result<(), PluginError> {
|
|
1495
|
+
// §12 has carried `plugin_bind_scope` - "binding declared outside
|
|
1496
|
+
// `define`" - since before anything raised it. §8.1 puts binding
|
|
1497
|
+
// DECLARATION in `define` and INSERTION at a successful activate,
|
|
1498
|
+
// and the guard was the half nobody wrote.
|
|
1499
|
+
if "define" != self.host.phase() {
|
|
1500
|
+
return fail(
|
|
1501
|
+
"plugin_bind_scope",
|
|
1502
|
+
&format!("bind called outside define: {}", point),
|
|
1503
|
+
details(&[
|
|
1504
|
+
("ref", Value::str(&self.eref)),
|
|
1505
|
+
("point", Value::str(point)),
|
|
1506
|
+
]),
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
if !self.host.haspoint(point) {
|
|
1510
|
+
return fail(
|
|
1511
|
+
"plugin_point_unknown",
|
|
1512
|
+
&format!("no such point: {}", point),
|
|
1513
|
+
details(&[("point", Value::str(point))]),
|
|
1514
|
+
);
|
|
1515
|
+
}
|
|
1516
|
+
self.entry.borrow_mut().bindings.push(Bound {
|
|
1517
|
+
eref: self.eref.clone(),
|
|
1518
|
+
point: point.to_string(),
|
|
1519
|
+
func,
|
|
1520
|
+
band: band.as_int().unwrap_or(0),
|
|
1521
|
+
});
|
|
1522
|
+
Ok(())
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/// Published for other plugins and for the application (§11).
|
|
1526
|
+
pub fn export(&self, key: &str, value: Value) {
|
|
1527
|
+
self.entry
|
|
1528
|
+
.borrow_mut()
|
|
1529
|
+
.exports
|
|
1530
|
+
.insert(key.to_string(), value);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
/// What this instance can do for others (§11.1).
|
|
1534
|
+
pub fn provides(&self, prov: Value) {
|
|
1535
|
+
self.entry.borrow_mut().provides.push(prov);
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
/// Where this binding landed (§6.6) - the plugin-side counterpart to a
|
|
1539
|
+
/// host pin. THE HOST DOES NOT POLICE THIS; it just makes the fact
|
|
1540
|
+
/// available.
|
|
1541
|
+
pub fn position(&self, point: Option<&str>) -> Result<Value, PluginError> {
|
|
1542
|
+
self.host.positionof(&self.eref, point)
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/// AN INSTANCE MAY ITSELF BE A HOST (§6.5), and THE OUTER ONE OWNS THE
|
|
1546
|
+
/// INNER ONE'S LIFETIME. Registering the teardown in the instance
|
|
1547
|
+
/// scope is what makes that true rather than aspirational.
|
|
1548
|
+
pub fn nest(&self, nestopts: &Value) -> Result<Host, PluginError> {
|
|
1549
|
+
if !self.host.intransition() {
|
|
1550
|
+
return fail(
|
|
1551
|
+
"plugin_release_scope",
|
|
1552
|
+
"nest called outside a lifecycle callback",
|
|
1553
|
+
Value::Null,
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
let inner = Host::new(nestopts);
|
|
1557
|
+
let closing = inner.clone();
|
|
1558
|
+
self.entry
|
|
1559
|
+
.borrow_mut()
|
|
1560
|
+
.scope
|
|
1561
|
+
.push(Rc::new(move || closing.close()));
|
|
1562
|
+
self.entry.borrow_mut().inner = Some(inner.clone());
|
|
1563
|
+
Ok(inner)
|
|
1564
|
+
}
|
|
1565
|
+
}
|