@voxgig/sdkgen 4.10.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +330 -0
- package/project/.sdk/model/target/c.aon +15 -2
- package/project/.sdk/model/target/cpp.aon +18 -0
- package/project/.sdk/model/target/lua.aon +17 -0
- package/project/.sdk/model/target/ocaml.aon +48 -5
- package/project/.sdk/model/target/zig.aon +30 -4
- package/project/.sdk/src/cmp/c/Config_c.ts +338 -1
- package/project/.sdk/src/cmp/c/Main_c.ts +57 -2
- package/project/.sdk/src/cmp/c/Package_c.ts +12 -2
- package/project/.sdk/src/cmp/cpp/Config_cpp.ts +324 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +2 -0
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +62 -4
- package/project/.sdk/src/cmp/cpp/Package_cpp.ts +10 -0
- package/project/.sdk/src/cmp/lua/Config_lua.ts +88 -0
- package/project/.sdk/src/cmp/lua/Gitignore_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +93 -3
- package/project/.sdk/src/cmp/lua/Package_lua.ts +60 -0
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +10 -0
- package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +183 -5
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +160 -3
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +25 -1
- package/project/.sdk/src/cmp/zig/Config_zig.ts +130 -9
- package/project/.sdk/src/cmp/zig/Main_zig.ts +208 -4
- package/project/.sdk/{tm/zig/build.zig → src/cmp/zig/fragment/Build.fragment.zig} +7 -0
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +25 -0
- package/project/.sdk/{tm/zig/root.zig → src/cmp/zig/fragment/Root.fragment.zig} +9 -0
- package/project/.sdk/tm/c/Makefile +58 -9
- package/project/.sdk/tm/c/core/sdk.h +10 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.c +133 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.h +39 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.c +83 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.h +48 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/config.c +413 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/config.h +24 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.c +264 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.h +29 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/env.c +220 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/env.h +19 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/export.c +97 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/export.h +19 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.c +237 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.h +17 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/host.c +1494 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/host.h +135 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/order.c +288 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/order.h +18 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/point.c +141 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/point.h +80 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.c +170 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.h +52 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.c +98 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.h +18 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/types.c +150 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/types.h +104 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/value.c +649 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/value.h +135 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/version.c +151 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/version.h +34 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/aws.c +281 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/azuresecrets.c +207 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/boru.c +164 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/clock.c +75 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/doppler.c +141 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/encode.c +144 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/gcpsecrets.c +177 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/hashicorp.c +239 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/httpjson.c +599 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/infisical.c +165 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/onepassword.c +194 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/proc.c +233 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/secretspec.c +125 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sekretoplugins.h +125 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sha256.c +270 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sigv4.c +382 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/support.h +153 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/tls.c +420 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/internal.h +86 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +721 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/providers.c +813 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.c +944 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.h +490 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/util.c +442 -0
- package/project/.sdk/tm/c/feature/secrets.c +797 -0
- package/project/.sdk/tm/c/feature/secrets.h +46 -0
- package/project/.sdk/tm/c/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/c/tests/feature/secrets/secrets_test.c +802 -0
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +38 -11
- package/project/.sdk/tm/clojure/test/sdk/test/feature/secrets.clj +40 -6
- package/project/.sdk/tm/cpp/Makefile +48 -4
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.cpp +121 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.hpp +41 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.cpp +60 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.hpp +66 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.cpp +376 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.hpp +29 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.cpp +230 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.hpp +31 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.cpp +205 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.hpp +25 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.cpp +84 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.hpp +24 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.cpp +222 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.hpp +21 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.cpp +1200 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.hpp +250 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.cpp +250 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.hpp +22 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.cpp +110 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.hpp +79 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.cpp +136 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.hpp +60 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.cpp +82 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.hpp +25 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.cpp +90 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.hpp +65 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.cpp +491 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.hpp +120 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.cpp +143 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.hpp +36 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.cpp +248 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.hpp +30 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.cpp +149 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.cpp +117 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.hpp +27 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.cpp +180 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.hpp +52 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.cpp +87 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.cpp +121 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.cpp +153 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.cpp +666 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.hpp +160 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.cpp +123 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.cpp +125 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.cpp +223 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.hpp +47 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.cpp +104 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.hpp +27 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.cpp +242 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.hpp +58 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.cpp +260 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.hpp +47 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.cpp +476 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.hpp +89 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.cpp +312 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.hpp +263 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.cpp +354 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.hpp +111 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.cpp +613 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.hpp +227 -0
- package/project/.sdk/tm/cpp/feature/secrets.hpp +745 -0
- package/project/.sdk/tm/cpp/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/test/feature/secrets/secrets_test.cpp +808 -0
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +34 -8
- package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +85 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +17 -2
- package/project/.sdk/tm/elixir/test/feature/secrets/secrets_test.exs +41 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +32 -10
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +116 -0
- package/project/.sdk/tm/java/feature/SecretsFeature.java +33 -8
- package/project/.sdk/tm/java/test/feature/secrets/SecretsFeatureTest.java +64 -0
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +34 -11
- package/project/.sdk/tm/js/test/feature/secrets/Secrets.test.js +73 -0
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +32 -7
- package/project/.sdk/tm/kotlin/test/feature/secrets/SecretsTest.kt +69 -0
- package/project/.sdk/tm/lua/Makefile +15 -4
- package/project/.sdk/tm/lua/feature/secrets/native/sekretonet.c +806 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/capability.lua +135 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/catalog.lua +63 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/config.lua +361 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/depend.lua +232 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/env.lua +168 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/export.lua +66 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/graph.lua +194 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/host.lua +1190 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/json.lua +169 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/order.lua +207 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/point.lua +106 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/ref.lua +115 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/resolve.lua +78 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/types.lua +275 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/version.lua +131 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin.lua +76 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/addr.lua +124 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/err.lua +47 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/name.lua +315 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/aws.lua +228 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/azuresecrets.lua +137 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/boru.lua +124 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/crypto.lua +212 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/doppler.lua +89 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/gcpsecrets.lua +129 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/hashicorp.lua +154 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/httpjson.lua +248 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/infisical.lua +113 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/json.lua +449 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/net.lua +198 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/onepassword.lua +126 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/secretspec.lua +93 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/sigv4.lua +269 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/support.lua +146 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/providers.lua +346 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto.lua +479 -0
- package/project/.sdk/tm/lua/feature/secrets_feature.lua +690 -0
- package/project/.sdk/tm/lua/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/lua/test/extend_test.lua +105 -0
- package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +862 -0
- package/project/.sdk/tm/ocaml/Makefile +52 -8
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/capability.ml +106 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/catalog.ml +43 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/config.ml +349 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/defs.ml +143 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/depend.ml +217 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/env.ml +197 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/export.ml +89 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/graph.ml +227 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/host.ml +1112 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/order.ml +202 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/point.ml +138 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/ref.ml +126 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/resolve.ml +62 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/types.ml +97 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/value.ml +387 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/version.ml +139 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/aws.ml +171 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/azuresecrets.ml +116 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/boru.ml +95 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/crypto.ml +149 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/doppler.ml +61 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/gcpsecrets.ml +93 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/hashicorp.ml +120 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/http.ml +421 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/httpjson.ml +66 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/infisical.ml +85 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/onepassword.ml +112 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/runcmd.ml +97 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/secretspec.ml +68 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/sigv4.ml +259 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls.ml +44 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls_stubs.c +358 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/json.ml +376 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/provider.ml +647 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/secret.ml +299 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/sekreto.ml +347 -0
- package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +453 -0
- package/project/.sdk/tm/ocaml/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +670 -0
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +33 -12
- package/project/.sdk/tm/perl/t/feature/secrets/secrets.t +47 -0
- package/project/.sdk/tm/php/feature/SecretsFeature.php +30 -6
- package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +98 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +28 -6
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +114 -0
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +28 -6
- package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +93 -0
- package/project/.sdk/tm/rust/feature/secrets.rs +33 -10
- package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +96 -0
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +29 -7
- package/project/.sdk/tm/scala/sdktest/feature/secrets/SecretsTestMain.scala +71 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +35 -12
- package/project/.sdk/tm/ts/test/feature/secrets/Secrets.test.ts +73 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/capability.zig +137 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/catalog.zig +90 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/config.zig +346 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/depend.zig +244 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/env.zig +201 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/export.zig +83 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/graph.zig +212 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/host.zig +1224 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/inst.zig +126 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/order.zig +228 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/plugin.zig +34 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/point.zig +166 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/ref.zig +147 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/resolve.zig +74 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/types.zig +140 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/value.zig +662 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/version.zig +139 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/aws.zig +294 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/azuresecrets.zig +222 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/boru.zig +188 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/doppler.zig +135 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/gcpsecrets.zig +170 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/hashicorp.zig +242 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/httpjson.zig +535 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/infisical.zig +167 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/onepassword.zig +202 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/secretspec.zig +160 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/sigv4.zig +336 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/addr.zig +148 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/builtins.zig +259 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/provider.zig +440 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/sekreto.zig +944 -0
- package/project/.sdk/tm/zig/feature/secrets.zig +854 -0
- package/project/.sdk/tm/zig/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +891 -0
- package/project/sdkgen-package.json +1 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/host.hpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* The host: the lifecycle state machine (§5), extension points (§6),
|
|
5
|
+
* and 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,
|
|
10
|
+
* never interleaved; a transition triggered from inside a lifecycle
|
|
11
|
+
* callback is `plugin_reentrant`. A hard rule, because it is the only
|
|
12
|
+
* way the semantics can be identical in Go, in Ruby and in
|
|
13
|
+
* single-threaded JavaScript — and in C++, which has no event loop to
|
|
14
|
+
* hide behind.
|
|
15
|
+
*
|
|
16
|
+
* Reconciliation is EAGER (§18's portability budget). A transition
|
|
17
|
+
* settles by running the state machine to a fixed point, not by
|
|
18
|
+
* suspending on a future. */
|
|
19
|
+
|
|
20
|
+
#ifndef VOXGIG_PLUGIN_HOST_HPP
|
|
21
|
+
#define VOXGIG_PLUGIN_HOST_HPP
|
|
22
|
+
|
|
23
|
+
#include <functional>
|
|
24
|
+
#include <map>
|
|
25
|
+
#include <memory>
|
|
26
|
+
#include <string>
|
|
27
|
+
#include <vector>
|
|
28
|
+
|
|
29
|
+
#include "catalog.hpp"
|
|
30
|
+
#include "point.hpp"
|
|
31
|
+
#include "types.hpp"
|
|
32
|
+
#include "value.hpp"
|
|
33
|
+
|
|
34
|
+
namespace plugin {
|
|
35
|
+
|
|
36
|
+
class Host;
|
|
37
|
+
using HostPtr = std::shared_ptr<Host>;
|
|
38
|
+
|
|
39
|
+
/* A scope release: a closure, so an instance's teardown captures
|
|
40
|
+
* whatever it needs rather than being handed a void* the way c must. */
|
|
41
|
+
using Release = std::function<void()>;
|
|
42
|
+
|
|
43
|
+
struct HostOptions {
|
|
44
|
+
CatalogPtr catalog;
|
|
45
|
+
V reserved; /* list of names */
|
|
46
|
+
V keys; /* {instance, default} */
|
|
47
|
+
V defaults; /* {name -> options} */
|
|
48
|
+
V profile;
|
|
49
|
+
/* {point -> {kind, mode, exclusive, default, pin}}; the chain base is
|
|
50
|
+
* a function, so it rides alongside rather than inside the map. */
|
|
51
|
+
V points;
|
|
52
|
+
std::map<std::string, Hook> bases;
|
|
53
|
+
/* §11.3. `restart` (the default) treats provider replacement as an
|
|
54
|
+
* ordinary runtime operation. `hold` is the strict reading —
|
|
55
|
+
* deactivating a required instance is `plugin_dependency_held`. NOT
|
|
56
|
+
* the default, because a station that cannot swap a provider without
|
|
57
|
+
* a restart has lost the argument for having a plugin system. */
|
|
58
|
+
std::string dependency;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
struct DeclareSpec {
|
|
62
|
+
std::string definition;
|
|
63
|
+
V options;
|
|
64
|
+
V order;
|
|
65
|
+
bool haspos = false;
|
|
66
|
+
double pos = 0;
|
|
67
|
+
std::string tag;
|
|
68
|
+
/* §9.1: set ONLY by `hostdeclare` — "the host declares those
|
|
69
|
+
* instances itself, after the user merge, and always wins". */
|
|
70
|
+
bool hostowned = false;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/* A scope entry. `acquire` hands back a shared_ptr to one so a plugin
|
|
74
|
+
* can release early; the scope keeps the entry, and unwinding it twice
|
|
75
|
+
* is a no-op. */
|
|
76
|
+
struct ScopeEntry {
|
|
77
|
+
Release fn;
|
|
78
|
+
bool done = false;
|
|
79
|
+
/* `acquire` and `release` both count toward `open`; a nested host's
|
|
80
|
+
* teardown does NOT — a teardown is not an acquisition, and the inner
|
|
81
|
+
* host keeps its own counter (`nest/open`). */
|
|
82
|
+
bool counts = true;
|
|
83
|
+
};
|
|
84
|
+
using AcquireHandle = std::shared_ptr<ScopeEntry>;
|
|
85
|
+
|
|
86
|
+
class Inst {
|
|
87
|
+
public:
|
|
88
|
+
/* --- identity and configuration, as callbacks see it -------------- */
|
|
89
|
+
const std::string& ref() const { return ref_; }
|
|
90
|
+
std::string name() const;
|
|
91
|
+
std::string tag() const;
|
|
92
|
+
const V& options() const { return options_; }
|
|
93
|
+
const V& state() const { return state_; }
|
|
94
|
+
Host& host() const { return *owner_; }
|
|
95
|
+
|
|
96
|
+
/* --- what a definition declares ----------------------------------- */
|
|
97
|
+
void bind(const std::string& point, Hook hook, ChainFn chain, const V& band);
|
|
98
|
+
void bindhook(const std::string& point, Hook hook, const V& band);
|
|
99
|
+
void bindchain(const std::string& point, ChainFn chain, const V& band);
|
|
100
|
+
void exportvalue(const std::string& key, const V& value);
|
|
101
|
+
void provides(const V& p);
|
|
102
|
+
/* Returns a handle a plugin can hand back early. The scope still
|
|
103
|
+
* holds the entry and unwinding it twice is a no-op — releasing early
|
|
104
|
+
* must not make teardown wrong. */
|
|
105
|
+
AcquireHandle acquire();
|
|
106
|
+
void giveback(const AcquireHandle& handle);
|
|
107
|
+
void release(Release fn);
|
|
108
|
+
V position(const std::string& point) const;
|
|
109
|
+
HostPtr nest(const HostOptions& opts);
|
|
110
|
+
|
|
111
|
+
/* --- observation --------------------------------------------------- */
|
|
112
|
+
const std::string& status() const { return status_; }
|
|
113
|
+
double seq() const { return seq_; }
|
|
114
|
+
double pos() const { return pos_; }
|
|
115
|
+
HostPtr inner() const { return inner_; }
|
|
116
|
+
|
|
117
|
+
private:
|
|
118
|
+
friend class Host;
|
|
119
|
+
|
|
120
|
+
std::string ref_;
|
|
121
|
+
DefinitionPtr def_;
|
|
122
|
+
std::string status_ = "declared";
|
|
123
|
+
double pos_ = 0;
|
|
124
|
+
double seq_ = 0;
|
|
125
|
+
V options_ = vmap();
|
|
126
|
+
V state_ = vmap();
|
|
127
|
+
V order_;
|
|
128
|
+
/* §11.4's ALWAYS-RELUCTANT rebinding, made concrete: the provider ref
|
|
129
|
+
* this instance's activation actually selected, per requirement name.
|
|
130
|
+
* Recomputing the best candidate on every question silently re-points
|
|
131
|
+
* a live consumer at any better-ranked newcomer, and then losing the
|
|
132
|
+
* provider it was really using does not restart it. */
|
|
133
|
+
V selected_ = vmap();
|
|
134
|
+
/* §9.6's `active: false`. THE BAR OUTLIVES THE APPLY THAT SET IT: a
|
|
135
|
+
* flag consulted only while `apply` ran let a later direct `ready`
|
|
136
|
+
* bring the instance live, which is the config switch it exists to be
|
|
137
|
+
* silently ignored. */
|
|
138
|
+
bool barred_ = false;
|
|
139
|
+
V unmet_ = vlist();
|
|
140
|
+
std::vector<AcquireHandle> scope_;
|
|
141
|
+
/* Declared in `define`, inserted only when activation SUCCEEDS
|
|
142
|
+
* (§8.1). Holding them until then is what makes a failed activate
|
|
143
|
+
* leave nothing behind. */
|
|
144
|
+
std::vector<Bound> bindings_;
|
|
145
|
+
HostPtr inner_;
|
|
146
|
+
/* Declared in `define`, and VISIBLE while merely `loaded` (§11): they
|
|
147
|
+
* are data, and hiding them would make the loaded state useless for
|
|
148
|
+
* introspection. */
|
|
149
|
+
V exports_ = vmap();
|
|
150
|
+
V provides_ = vlist();
|
|
151
|
+
Host* owner_ = nullptr;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
using InstPtr = std::shared_ptr<Inst>;
|
|
155
|
+
|
|
156
|
+
class Host {
|
|
157
|
+
public:
|
|
158
|
+
explicit Host(const HostOptions& opts);
|
|
159
|
+
|
|
160
|
+
Catalog& catalog() { return *catalog_; }
|
|
161
|
+
CatalogPtr catalogptr() { return catalog_; }
|
|
162
|
+
void define(const DefinitionPtr& def) { catalog_->add(def); }
|
|
163
|
+
|
|
164
|
+
/* --- the state machine -------------------------------------------- */
|
|
165
|
+
InstPtr declare(const std::string& ref, const DeclareSpec& spec);
|
|
166
|
+
InstPtr load(const std::string& ref, const DeclareSpec& spec);
|
|
167
|
+
InstPtr activate(const std::string& ref);
|
|
168
|
+
InstPtr deactivate(const std::string& ref);
|
|
169
|
+
void unload(const std::string& ref);
|
|
170
|
+
InstPtr ready(const std::string& ref);
|
|
171
|
+
void close();
|
|
172
|
+
void apply(const V& doc, const V& profile);
|
|
173
|
+
void setoptions(const std::string& ref, const V& patch);
|
|
174
|
+
std::string autotag(const std::string& name) const;
|
|
175
|
+
|
|
176
|
+
/* --- observation --------------------------------------------------- */
|
|
177
|
+
/* Introspection NEVER advances the state (§5.2). A status page must
|
|
178
|
+
* not be a way to accidentally import twenty packages. */
|
|
179
|
+
V list() const;
|
|
180
|
+
InstPtr instance(const std::string& ref) const;
|
|
181
|
+
V observable(const V& result, bool hasresult) const;
|
|
182
|
+
/* A COPY, not the live list: the canonical is `trace: () => events.slice()`, and `observable` already copies the log. Returning the live list lets a caller append to or delete from the host's own event record — application observation code fabricating or erasing lifecycle history. */
|
|
183
|
+
V trace() const;
|
|
184
|
+
V order(const std::string& point) const;
|
|
185
|
+
V positionof(const std::string& ref, const std::string& point) const;
|
|
186
|
+
|
|
187
|
+
/* --- points --------------------------------------------------------- */
|
|
188
|
+
V emit(const std::string& point, const V& arg);
|
|
189
|
+
V call(const std::string& point, const V& arg);
|
|
190
|
+
V provider(const std::string& point, const V& arg);
|
|
191
|
+
V shadowed(const std::string& point) const;
|
|
192
|
+
V exports(const std::string& spec) const;
|
|
193
|
+
V capability(const std::string& name) const;
|
|
194
|
+
|
|
195
|
+
private:
|
|
196
|
+
friend class Inst;
|
|
197
|
+
|
|
198
|
+
InstPtr find(const std::string& ref) const;
|
|
199
|
+
std::vector<std::string> sortedrefs() const;
|
|
200
|
+
void guard() const;
|
|
201
|
+
InstPtr need(const std::string& ref) const;
|
|
202
|
+
void checkreserved(const std::string& ref) const;
|
|
203
|
+
void run(const InstPtr& e, const std::string& at);
|
|
204
|
+
V unwind(const InstPtr& e);
|
|
205
|
+
void releasecheck(const InstPtr& e, const V& errors);
|
|
206
|
+
V providersof(const V& req) const;
|
|
207
|
+
V unmetof(const InstPtr& e) const;
|
|
208
|
+
std::string chosen(const InstPtr& e, const V& req, bool remember) const;
|
|
209
|
+
V boundproviders(const InstPtr& e) const;
|
|
210
|
+
V consumersof(const std::string& ref) const;
|
|
211
|
+
V holdersof(const std::string& ref) const;
|
|
212
|
+
void held(const InstPtr& e) const;
|
|
213
|
+
V graphnodes() const;
|
|
214
|
+
std::vector<Bound> boundon(const std::string& point) const;
|
|
215
|
+
V pointspec(const std::string& point) const;
|
|
216
|
+
void cascade(const InstPtr& provider, const V& seen);
|
|
217
|
+
void reconcile();
|
|
218
|
+
V shapeof(const std::string& ref) const;
|
|
219
|
+
|
|
220
|
+
CatalogPtr catalog_;
|
|
221
|
+
V reserved_;
|
|
222
|
+
V keys_;
|
|
223
|
+
V defaults_;
|
|
224
|
+
V profile_;
|
|
225
|
+
V points_;
|
|
226
|
+
std::map<std::string, Hook> bases_;
|
|
227
|
+
std::string dependency_ = "restart";
|
|
228
|
+
/* Set for the duration of a bulk teardown, so `held` knows this is a
|
|
229
|
+
* coordinated operation rather than an ad-hoc deactivation. */
|
|
230
|
+
bool coordinated_ = false;
|
|
231
|
+
|
|
232
|
+
std::vector<InstPtr> instances_;
|
|
233
|
+
V log_ = vlist();
|
|
234
|
+
V events_ = vlist();
|
|
235
|
+
double seqn_ = 0;
|
|
236
|
+
double open_ = 0;
|
|
237
|
+
bool intransition_ = false;
|
|
238
|
+
/* WHICH callback is running, not merely that one is. §8.1 puts
|
|
239
|
+
* resource capture in `activate` and §8.3 says `release` outside
|
|
240
|
+
* `activate` is `plugin_release_scope` — and a boolean alone cannot
|
|
241
|
+
* tell `activate` from `define`, so it admitted an acquire in
|
|
242
|
+
* `define` whose scope `unload` would never unwind. */
|
|
243
|
+
std::string phase_;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
HostPtr makehost(const HostOptions& opts);
|
|
247
|
+
|
|
248
|
+
} // namespace plugin
|
|
249
|
+
|
|
250
|
+
#endif
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/order.cpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Ordering (§7) — one rule, one place.
|
|
5
|
+
*
|
|
6
|
+
* sdkgen grew two special cases in `makeOptions` (`test`, then
|
|
7
|
+
* `station`) and the third was not far off. This sort is the whole
|
|
8
|
+
* replacement, and the tiers are in this order for a reason:
|
|
9
|
+
*
|
|
10
|
+
* 1 constraints before/after edges, by ref or by name
|
|
11
|
+
* 2 bands integer, lower first, default 0
|
|
12
|
+
* 3 declaration ties break by `pos`
|
|
13
|
+
*
|
|
14
|
+
* CONSTRAINTS BEAT BANDS precisely so the correct tool wins when both
|
|
15
|
+
* are present. A band expresses a genuine cross-cutting layer; a
|
|
16
|
+
* constraint expresses a relationship between two specific things; and
|
|
17
|
+
* a band chosen by trial and error to fix an ordering bug is a bug
|
|
18
|
+
* wearing a number. */
|
|
19
|
+
|
|
20
|
+
#include "order.hpp"
|
|
21
|
+
|
|
22
|
+
#include <algorithm>
|
|
23
|
+
|
|
24
|
+
#include "ref.hpp"
|
|
25
|
+
|
|
26
|
+
namespace plugin {
|
|
27
|
+
|
|
28
|
+
static double bandof(const V& b) {
|
|
29
|
+
/* A NUMBER, not a numeric string. `order.band` accepting "1" was a
|
|
30
|
+
* surviving mutation in more than one port: the corpus pins the type
|
|
31
|
+
* because two ports disagreeing about whether "1" is a band is
|
|
32
|
+
* exactly the divergence a shared corpus exists to remove. */
|
|
33
|
+
V band = get(get(b, "order"), "band");
|
|
34
|
+
return isnum(band) ? asnum(band) : 0.0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static double posof(const V& b) {
|
|
38
|
+
V p = get(b, "pos");
|
|
39
|
+
return isnum(p) ? asnum(p) : 0.0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Band first (lower runs first), then `pos` — the position the DOCUMENT
|
|
43
|
+
* visibly states, not the order instances happened to load and not the
|
|
44
|
+
* incarnation `seq`. */
|
|
45
|
+
struct Ready {
|
|
46
|
+
V binding;
|
|
47
|
+
size_t seq;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/* THE RANK IS TOTAL, and the third key is why. Band and pos can both
|
|
51
|
+
tie — `declare` defaults `pos` to the registry size, so an unload
|
|
52
|
+
followed by a fresh declare reuses a surviving instance's — and
|
|
53
|
+
`std::sort` is not stable, so the topological order would differ from
|
|
54
|
+
every other port's. The DECLARATION SEQUENCE (the index `order` fed
|
|
55
|
+
them in) breaks the last tie, which is what the stable-sort ports get
|
|
56
|
+
for free. */
|
|
57
|
+
static bool ranks(const Ready& x, const Ready& y) {
|
|
58
|
+
double ab = bandof(x.binding), bb = bandof(y.binding);
|
|
59
|
+
if (ab != bb) return ab < bb;
|
|
60
|
+
double ap = posof(x.binding), bp = posof(y.binding);
|
|
61
|
+
if (ap != bp) return ap < bp;
|
|
62
|
+
return x.seq < y.seq;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Was a constraint actually declared? An ABSENT one and an EMPTY LIST
|
|
66
|
+
* are both "no constraint"; only a non-empty spelling is an edge. */
|
|
67
|
+
static bool declared(const V& spec) {
|
|
68
|
+
if (islist(spec)) return 0 < len(spec);
|
|
69
|
+
if (isstr(spec)) return !asstr(spec).empty();
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Matching is by REF, or by NAME across all of that definition's
|
|
74
|
+
* instances (§7) — which is the whole reason the two spellings exist. */
|
|
75
|
+
static std::vector<std::string> targets(const V& spec, const V& nodes) {
|
|
76
|
+
std::vector<std::string> hit;
|
|
77
|
+
size_t sn = islist(spec) ? len(spec) : 1;
|
|
78
|
+
for (size_t si = 0; si < sn; si++) {
|
|
79
|
+
V oneval = islist(spec) ? at(spec, si) : spec;
|
|
80
|
+
if (!isstr(oneval)) continue;
|
|
81
|
+
const std::string one = asstr(oneval);
|
|
82
|
+
for (size_t i = 0; i < len(nodes); i++) {
|
|
83
|
+
const std::string ref = asstr(get(at(nodes, i), "ref"));
|
|
84
|
+
if (hit.end() != std::find(hit.begin(), hit.end(), ref)) continue;
|
|
85
|
+
if (ref == one || refname(ref) == one) hit.push_back(ref);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return hit;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* A PIN IS NOT A CONSTRAINT (§7).
|
|
92
|
+
*
|
|
93
|
+
* Constraints and bands are negotiable by definition — they are what
|
|
94
|
+
* plugins and documents say they want, and the sort's job is to satisfy
|
|
95
|
+
* them all. A pin is the host stating a structural invariant of its own
|
|
96
|
+
* architecture, which is a different kind of claim and must not lose a
|
|
97
|
+
* tie to a document.
|
|
98
|
+
*
|
|
99
|
+
* So a pin PLACES the binding at the named end, and an ordering that
|
|
100
|
+
* would move it away is `plugin_order_pinned` — rejected, not honoured
|
|
101
|
+
* into a broken wrap. */
|
|
102
|
+
static V applypin(const V& order, const V& edges, const V& pin) {
|
|
103
|
+
if (!ismap(pin)) return order;
|
|
104
|
+
|
|
105
|
+
std::vector<std::string> out;
|
|
106
|
+
for (size_t i = 0; i < len(order); i++) out.push_back(asstr(at(order, i)));
|
|
107
|
+
|
|
108
|
+
/* SORTED, not insertion order. A pin map is data — it can arrive from
|
|
109
|
+
* a host's own construction options in any order, and two names
|
|
110
|
+
* pinned to the same end are order-sensitive. Sorted is the one order
|
|
111
|
+
* every language agrees on, and `order/pin#two-names` pins it. */
|
|
112
|
+
for (const auto& name : sortedkeys(pin)) {
|
|
113
|
+
const std::string want = asstr(get(pin, name));
|
|
114
|
+
size_t idx = out.size();
|
|
115
|
+
for (size_t j = 0; j < out.size(); j++) {
|
|
116
|
+
if (refname(out[j]) == name) { idx = j; break; }
|
|
117
|
+
}
|
|
118
|
+
if (out.size() == idx) continue;
|
|
119
|
+
|
|
120
|
+
/* `first`/`outermost` is index 0; `last`/`innermost` is the end.
|
|
121
|
+
* §6.2 makes the first chain binding outermost, which is why the
|
|
122
|
+
* vocabulary is positional and why the two spellings pair this
|
|
123
|
+
* way. */
|
|
124
|
+
bool wantfirst = "first" == want || "outermost" == want;
|
|
125
|
+
std::string ref = out[idx];
|
|
126
|
+
out.erase(out.begin() + static_cast<long>(idx));
|
|
127
|
+
if (wantfirst) out.insert(out.begin(), ref);
|
|
128
|
+
else out.push_back(ref);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Now check that the placement did not break a constraint. This is
|
|
132
|
+
* the half that makes a pin a rejection rather than an override: the
|
|
133
|
+
* host wins on position, but it does not get to silently discard a
|
|
134
|
+
* relationship a plugin declared. */
|
|
135
|
+
V index = vmap();
|
|
136
|
+
for (size_t i = 0; i < out.size(); i++) {
|
|
137
|
+
set(index, out[i], vnum(static_cast<double>(i)));
|
|
138
|
+
}
|
|
139
|
+
for (const auto& from : sortedkeys(edges)) {
|
|
140
|
+
V tos = get(edges, from);
|
|
141
|
+
for (size_t j = 0; j < len(tos); j++) {
|
|
142
|
+
const std::string to = asstr(at(tos, j));
|
|
143
|
+
if (asnum(get(index, from)) > asnum(get(index, to))) {
|
|
144
|
+
V d = vmap();
|
|
145
|
+
set(d, "before", vstr(from));
|
|
146
|
+
set(d, "after", vstr(to));
|
|
147
|
+
fail("plugin_order_pinned",
|
|
148
|
+
"a pin would move a binding an ordering constrains: " + from +
|
|
149
|
+
" must precede " + to,
|
|
150
|
+
d);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
V result = vlist();
|
|
156
|
+
for (const auto& r : out) push(result, vstr(r));
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
V resolveorder(const V& bindings, const V& pin) {
|
|
161
|
+
const size_t n = len(bindings);
|
|
162
|
+
|
|
163
|
+
V byref = vmap();
|
|
164
|
+
for (size_t i = 0; i < n; i++) {
|
|
165
|
+
set(byref, asstr(get(at(bindings, i), "ref")), at(bindings, i));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Constraints are edges. A constraint naming an ABSENT binding is
|
|
169
|
+
* satisfied VACUOUSLY (§7) — a plugin ordered `after: 'test'` must
|
|
170
|
+
* load in a host with no test plugin. That is sdkgen's __after__
|
|
171
|
+
* behaviour, kept. */
|
|
172
|
+
V edges = vmap();
|
|
173
|
+
for (size_t i = 0; i < n; i++) {
|
|
174
|
+
set(edges, asstr(get(at(bindings, i), "ref")), vlist());
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
for (size_t i = 0; i < n; i++) {
|
|
178
|
+
V b = at(bindings, i);
|
|
179
|
+
const std::string bref = asstr(get(b, "ref"));
|
|
180
|
+
V o = get(b, "order");
|
|
181
|
+
V after = get(o, "after");
|
|
182
|
+
V before = get(o, "before");
|
|
183
|
+
if (declared(after)) {
|
|
184
|
+
for (const auto& t : targets(after, bindings)) push(get(edges, t), vstr(bref));
|
|
185
|
+
}
|
|
186
|
+
if (declared(before)) {
|
|
187
|
+
for (const auto& t : targets(before, bindings)) push(get(edges, bref), vstr(t));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Stable topological sort. */
|
|
192
|
+
V indeg = vmap();
|
|
193
|
+
for (size_t i = 0; i < n; i++) {
|
|
194
|
+
set(indeg, asstr(get(at(bindings, i), "ref")), vnum(0));
|
|
195
|
+
}
|
|
196
|
+
for (const auto& from : keys(edges)) {
|
|
197
|
+
V tos = get(edges, from);
|
|
198
|
+
for (size_t j = 0; j < len(tos); j++) {
|
|
199
|
+
const std::string to = asstr(at(tos, j));
|
|
200
|
+
set(indeg, to, vnum(asnum(get(indeg, to)) + 1));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* `seq` is the index the binding arrived at, and it never repeats: a
|
|
205
|
+
binding enters `ready` exactly once, either up front or when its
|
|
206
|
+
last edge clears. */
|
|
207
|
+
std::vector<Ready> ready;
|
|
208
|
+
size_t seq = 0;
|
|
209
|
+
for (size_t i = 0; i < n; i++) {
|
|
210
|
+
V b = at(bindings, i);
|
|
211
|
+
if (0 == asnum(get(indeg, asstr(get(b, "ref"))))) ready.push_back({b, seq++});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
std::vector<std::string> out;
|
|
215
|
+
while (!ready.empty()) {
|
|
216
|
+
std::sort(ready.begin(), ready.end(), ranks);
|
|
217
|
+
V next = ready.front().binding;
|
|
218
|
+
ready.erase(ready.begin());
|
|
219
|
+
|
|
220
|
+
const std::string nref = asstr(get(next, "ref"));
|
|
221
|
+
out.push_back(nref);
|
|
222
|
+
V tos = get(edges, nref);
|
|
223
|
+
for (size_t j = 0; j < len(tos); j++) {
|
|
224
|
+
const std::string to = asstr(at(tos, j));
|
|
225
|
+
double d = asnum(get(indeg, to)) - 1;
|
|
226
|
+
set(indeg, to, vnum(d));
|
|
227
|
+
if (0 == d) ready.push_back({get(byref, to), seq++});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (out.size() != n) {
|
|
232
|
+
V stuck = vlist();
|
|
233
|
+
std::string names;
|
|
234
|
+
for (size_t i = 0; i < n; i++) {
|
|
235
|
+
const std::string ref = asstr(get(at(bindings, i), "ref"));
|
|
236
|
+
if (out.end() != std::find(out.begin(), out.end(), ref)) continue;
|
|
237
|
+
if (0 < len(stuck)) names += " -> ";
|
|
238
|
+
names += ref;
|
|
239
|
+
push(stuck, vstr(ref));
|
|
240
|
+
}
|
|
241
|
+
fail("plugin_order_cycle", "before/after constraints cycle: " + names,
|
|
242
|
+
details1("cycle", stuck));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
V ordered = vlist();
|
|
246
|
+
for (const auto& r : out) push(ordered, vstr(r));
|
|
247
|
+
return applypin(ordered, edges, pin);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
} // namespace plugin
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/order.hpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Ordering (§7) — constraints, then bands, then declaration position.
|
|
5
|
+
* CONSTRAINTS BEAT BANDS so the correct tool wins when both are
|
|
6
|
+
* present; a band chosen by trial and error to fix an ordering bug is a
|
|
7
|
+
* bug wearing a number. See order.cpp. */
|
|
8
|
+
|
|
9
|
+
#ifndef VOXGIG_PLUGIN_ORDER_HPP
|
|
10
|
+
#define VOXGIG_PLUGIN_ORDER_HPP
|
|
11
|
+
|
|
12
|
+
#include "types.hpp"
|
|
13
|
+
#include "value.hpp"
|
|
14
|
+
|
|
15
|
+
namespace plugin {
|
|
16
|
+
|
|
17
|
+
/* [{ref, pos, order?}] plus an optional host pin -> [ref] */
|
|
18
|
+
V resolveorder(const V& bindings, const V& pin);
|
|
19
|
+
|
|
20
|
+
} // namespace plugin
|
|
21
|
+
|
|
22
|
+
#endif
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/point.cpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Extension points (§6). See point.hpp for the closure representation. */
|
|
5
|
+
|
|
6
|
+
#include "point.hpp"
|
|
7
|
+
|
|
8
|
+
#include <algorithm>
|
|
9
|
+
|
|
10
|
+
namespace plugin {
|
|
11
|
+
|
|
12
|
+
/* The composition, built as nested closures rather than walked by
|
|
13
|
+
* index: `next` is a real callable, so a binding writes `next(arg)` the
|
|
14
|
+
* way the canonical does. Identical to `b1(b2(b3(base)))`. */
|
|
15
|
+
static V callat(const std::vector<Bound>& bs, size_t i, const Hook& base,
|
|
16
|
+
const V& arg) {
|
|
17
|
+
if (i >= bs.size()) return base ? base(arg) : arg;
|
|
18
|
+
Next next = [&bs, i, &base](const V& a) { return callat(bs, i + 1, base, a); };
|
|
19
|
+
return bs[i].chain(next, arg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
V pointcall(const std::vector<Bound>& bindings, const Hook& base, const V& arg) {
|
|
23
|
+
return callat(bindings, 0, base, arg);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
V pointemit(const std::vector<Bound>& bindings, const std::string& mode,
|
|
27
|
+
const V& arg, V& errors) {
|
|
28
|
+
errors = vlist();
|
|
29
|
+
|
|
30
|
+
if ("bail" == mode) {
|
|
31
|
+
/* Stops at the first binding that RETURNS A VALUE — the "handled,
|
|
32
|
+
* stop" case. A NULLPTR OR A NULL DECLINES.
|
|
33
|
+
*
|
|
34
|
+
* JavaScript can tell null from undefined and almost nothing else
|
|
35
|
+
* in the target set can — Go, Python, Ruby, PHP, Lua, Java and C#
|
|
36
|
+
* each have exactly one way to say nothing, and C++ has one too.
|
|
37
|
+
* Making the distinction load-bearing would cost every one of them
|
|
38
|
+
* a wrapper type carried through the whole dispatch path, to
|
|
39
|
+
* express a difference their plugin authors cannot write. §18's
|
|
40
|
+
* budget settles it (§6.1). */
|
|
41
|
+
for (const auto& b : bindings) {
|
|
42
|
+
V v = b.hook(arg);
|
|
43
|
+
if (!isnull(v)) return v;
|
|
44
|
+
}
|
|
45
|
+
return nullptr;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
bool raising = "emit" == mode;
|
|
49
|
+
for (const auto& b : bindings) {
|
|
50
|
+
if (raising) {
|
|
51
|
+
/* `emit` raises synchronously; the collecting modes gather. */
|
|
52
|
+
b.hook(arg);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
b.hook(arg);
|
|
57
|
+
}
|
|
58
|
+
catch (const PluginError& e) {
|
|
59
|
+
V rec = vmap();
|
|
60
|
+
set(rec, "code", vstr(e.code));
|
|
61
|
+
set(rec, "message", vstr(e.message));
|
|
62
|
+
push(errors, rec);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return nullptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
long pointprovider(const std::vector<Bound>& bindings, bool exclusive,
|
|
69
|
+
V& shadowed) {
|
|
70
|
+
shadowed = vlist();
|
|
71
|
+
if (bindings.empty()) return -1;
|
|
72
|
+
|
|
73
|
+
std::vector<size_t> ranked(bindings.size());
|
|
74
|
+
for (size_t i = 0; i < bindings.size(); i++) ranked[i] = i;
|
|
75
|
+
|
|
76
|
+
if (exclusive && 1 < bindings.size()) {
|
|
77
|
+
std::vector<std::string> refs;
|
|
78
|
+
for (const auto& b : bindings) refs.push_back(b.ref);
|
|
79
|
+
/* Sorted, so the message names the same pair whatever order the
|
|
80
|
+
* bindings arrived in. */
|
|
81
|
+
std::sort(refs.begin(), refs.end());
|
|
82
|
+
V list = vlist();
|
|
83
|
+
std::string names;
|
|
84
|
+
for (size_t i = 0; i < refs.size(); i++) {
|
|
85
|
+
if (0 < i) names += ", ";
|
|
86
|
+
names += refs[i];
|
|
87
|
+
push(list, vstr(refs[i]));
|
|
88
|
+
}
|
|
89
|
+
fail("plugin_point_exclusive",
|
|
90
|
+
"point is exclusive and has " + std::to_string(bindings.size()) +
|
|
91
|
+
" bindings: " + names,
|
|
92
|
+
details1("refs", list));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* HIGHEST band wins, unlike hook and chain; ties break by ref sort,
|
|
96
|
+
* which is a TOTAL order, so the unstable sort cannot show. */
|
|
97
|
+
std::sort(ranked.begin(), ranked.end(), [&bindings](size_t a, size_t b) {
|
|
98
|
+
if (bindings[a].band != bindings[b].band) {
|
|
99
|
+
return bindings[a].band > bindings[b].band;
|
|
100
|
+
}
|
|
101
|
+
return bindings[a].ref < bindings[b].ref;
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
for (size_t i = 1; i < ranked.size(); i++) {
|
|
105
|
+
push(shadowed, vstr(bindings[ranked[i]].ref));
|
|
106
|
+
}
|
|
107
|
+
return static_cast<long>(ranked[0]);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
} // namespace plugin
|