@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,169 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/json.lua)
|
|
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 JSON parser, and the only one this port has.
|
|
5
|
+
--
|
|
6
|
+
-- NO LUAROCKS, NO DKJSON, NO CJSON (section 16). The library is allowed
|
|
7
|
+
-- exactly one runtime dependency, `voxgig/struct`, which has no lua port;
|
|
8
|
+
-- everything else is the standard library. Parsing the corpus is a hundred
|
|
9
|
+
-- and fifty lines, and a hundred and fifty lines is cheaper than a rock
|
|
10
|
+
-- every embedding host has to install.
|
|
11
|
+
--
|
|
12
|
+
-- EVERY TABLE IT BUILDS IS TAGGED (types.map / types.list) and every JSON
|
|
13
|
+
-- null becomes `types.NULL`. That is what lets this port tell `{}` from
|
|
14
|
+
-- `[]` and an absent key from a null one - two distinctions the corpus
|
|
15
|
+
-- draws and a plain lua table cannot.
|
|
16
|
+
|
|
17
|
+
local T = require 'feature.secrets.plugin.types'
|
|
18
|
+
|
|
19
|
+
local M = {}
|
|
20
|
+
|
|
21
|
+
local function skipws(s, at)
|
|
22
|
+
while at <= #s do
|
|
23
|
+
local c = s:sub(at, at)
|
|
24
|
+
if ' ' ~= c and '\t' ~= c and '\n' ~= c and '\r' ~= c then break end
|
|
25
|
+
at = at + 1
|
|
26
|
+
end
|
|
27
|
+
return at
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
local parsevalue
|
|
31
|
+
|
|
32
|
+
local function parsestring(s, at)
|
|
33
|
+
if '"' ~= s:sub(at, at) then
|
|
34
|
+
error('expected a string at ' .. at, 0)
|
|
35
|
+
end
|
|
36
|
+
at = at + 1
|
|
37
|
+
local out = {}
|
|
38
|
+
while at <= #s do
|
|
39
|
+
local c = s:sub(at, at)
|
|
40
|
+
at = at + 1
|
|
41
|
+
if '"' == c then
|
|
42
|
+
return table.concat(out), at
|
|
43
|
+
end
|
|
44
|
+
if '\\' == c then
|
|
45
|
+
local e = s:sub(at, at)
|
|
46
|
+
at = at + 1
|
|
47
|
+
if '"' == e then out[#out + 1] = '"'
|
|
48
|
+
elseif '\\' == e then out[#out + 1] = '\\'
|
|
49
|
+
elseif '/' == e then out[#out + 1] = '/'
|
|
50
|
+
elseif 'b' == e then out[#out + 1] = '\b'
|
|
51
|
+
elseif 'f' == e then out[#out + 1] = '\f'
|
|
52
|
+
elseif 'n' == e then out[#out + 1] = '\n'
|
|
53
|
+
elseif 'r' == e then out[#out + 1] = '\r'
|
|
54
|
+
elseif 't' == e then out[#out + 1] = '\t'
|
|
55
|
+
elseif 'u' == e then
|
|
56
|
+
local hex = s:sub(at, at + 3)
|
|
57
|
+
at = at + 4
|
|
58
|
+
local code = tonumber(hex, 16)
|
|
59
|
+
if nil == code then error('bad \\u escape at ' .. at, 0) end
|
|
60
|
+
-- A surrogate PAIR is two escapes; lua 5.4's utf8.char takes the
|
|
61
|
+
-- joined code point, so the pair is joined here.
|
|
62
|
+
if 0xD800 <= code and code < 0xDC00 and '\\u' == s:sub(at, at + 1) then
|
|
63
|
+
local low = tonumber(s:sub(at + 2, at + 5), 16)
|
|
64
|
+
if nil ~= low and 0xDC00 <= low and low < 0xE000 then
|
|
65
|
+
at = at + 6
|
|
66
|
+
code = 0x10000 + (code - 0xD800) * 0x400 + (low - 0xDC00)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
out[#out + 1] = utf8.char(code)
|
|
70
|
+
else
|
|
71
|
+
error('bad escape at ' .. at, 0)
|
|
72
|
+
end
|
|
73
|
+
else
|
|
74
|
+
out[#out + 1] = c
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
error('unterminated string', 0)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
local function parsemap(s, at)
|
|
81
|
+
local out = {}
|
|
82
|
+
at = skipws(s, at + 1)
|
|
83
|
+
if '}' == s:sub(at, at) then
|
|
84
|
+
return T.map(out), at + 1
|
|
85
|
+
end
|
|
86
|
+
while true do
|
|
87
|
+
at = skipws(s, at)
|
|
88
|
+
local key
|
|
89
|
+
key, at = parsestring(s, at)
|
|
90
|
+
at = skipws(s, at)
|
|
91
|
+
if ':' ~= s:sub(at, at) then error("expected ':' at " .. at, 0) end
|
|
92
|
+
at = skipws(s, at + 1)
|
|
93
|
+
local value
|
|
94
|
+
value, at = parsevalue(s, at)
|
|
95
|
+
out[key] = value
|
|
96
|
+
at = skipws(s, at)
|
|
97
|
+
local c = s:sub(at, at)
|
|
98
|
+
if ',' == c then
|
|
99
|
+
at = at + 1
|
|
100
|
+
elseif '}' == c then
|
|
101
|
+
return T.map(out), at + 1
|
|
102
|
+
else
|
|
103
|
+
error("expected ',' or '}' at " .. at, 0)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
local function parselist(s, at)
|
|
109
|
+
local out = {}
|
|
110
|
+
at = skipws(s, at + 1)
|
|
111
|
+
if ']' == s:sub(at, at) then
|
|
112
|
+
return T.list(out), at + 1
|
|
113
|
+
end
|
|
114
|
+
while true do
|
|
115
|
+
at = skipws(s, at)
|
|
116
|
+
local value
|
|
117
|
+
value, at = parsevalue(s, at)
|
|
118
|
+
out[#out + 1] = value
|
|
119
|
+
at = skipws(s, at)
|
|
120
|
+
local c = s:sub(at, at)
|
|
121
|
+
if ',' == c then
|
|
122
|
+
at = at + 1
|
|
123
|
+
elseif ']' == c then
|
|
124
|
+
return T.list(out), at + 1
|
|
125
|
+
else
|
|
126
|
+
error("expected ',' or ']' at " .. at, 0)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
local function literal(s, at, word, value)
|
|
132
|
+
if word ~= s:sub(at, at + #word - 1) then
|
|
133
|
+
error('bad literal at ' .. at, 0)
|
|
134
|
+
end
|
|
135
|
+
return value, at + #word
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
parsevalue = function(s, at)
|
|
139
|
+
local c = s:sub(at, at)
|
|
140
|
+
if '{' == c then return parsemap(s, at) end
|
|
141
|
+
if '[' == c then return parselist(s, at) end
|
|
142
|
+
if '"' == c then return parsestring(s, at) end
|
|
143
|
+
if 't' == c then return literal(s, at, 'true', true) end
|
|
144
|
+
if 'f' == c then return literal(s, at, 'false', false) end
|
|
145
|
+
if 'n' == c then return literal(s, at, 'null', T.NULL) end
|
|
146
|
+
|
|
147
|
+
local body = s:match('^%-?%d+%.?%d*[eE]?[-+]?%d*', at)
|
|
148
|
+
if nil == body or '' == body then
|
|
149
|
+
error('unexpected input at ' .. at, 0)
|
|
150
|
+
end
|
|
151
|
+
local n = tonumber(body)
|
|
152
|
+
if nil == n then error('bad number at ' .. at, 0) end
|
|
153
|
+
return n, at + #body
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
function M.parse(text)
|
|
157
|
+
local at = skipws(text, 1)
|
|
158
|
+
local value
|
|
159
|
+
value, at = parsevalue(text, at)
|
|
160
|
+
at = skipws(text, at)
|
|
161
|
+
if at <= #text then
|
|
162
|
+
error('trailing input at ' .. at, 0)
|
|
163
|
+
end
|
|
164
|
+
return value
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
M.encode = T.encode
|
|
168
|
+
|
|
169
|
+
return M
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/order.lua)
|
|
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 (section 7) - one rule, one place.
|
|
5
|
+
--
|
|
6
|
+
-- sdkgen grew two special cases in `makeOptions` (`test`, then `station`)
|
|
7
|
+
-- and the third was not far off. This sort is the whole replacement, and
|
|
8
|
+
-- 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 are
|
|
15
|
+
-- present. A band expresses a genuine cross-cutting layer; a constraint
|
|
16
|
+
-- expresses a relationship between two specific things; and a band chosen
|
|
17
|
+
-- by trial and error to fix an ordering bug is a bug wearing a number.
|
|
18
|
+
|
|
19
|
+
local T = require 'feature.secrets.plugin.types'
|
|
20
|
+
local R = require 'feature.secrets.plugin.ref'
|
|
21
|
+
|
|
22
|
+
local M = {}
|
|
23
|
+
|
|
24
|
+
-- An integer, and only an integer: `true` and `'2'` are not bands, and lua
|
|
25
|
+
-- would coerce the string in a comparison.
|
|
26
|
+
function M.order_band(binding)
|
|
27
|
+
local block = binding.order
|
|
28
|
+
if not T.ismap(block) then return 0 end
|
|
29
|
+
local value = T.getv(block, 'band')
|
|
30
|
+
if 'integer' == math.type(value) then return value end
|
|
31
|
+
return 0
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
-- Was a constraint stated? An absent value and an EMPTY LIST are both
|
|
35
|
+
-- no-constraint - and an empty list is TRUTHY in lua as in ruby, which is
|
|
36
|
+
-- exactly how this class of bug survives a reading.
|
|
37
|
+
function M.order_declared(spec)
|
|
38
|
+
if nil == spec or T.NULL == spec then return false end
|
|
39
|
+
if T.islist(spec) then
|
|
40
|
+
for i = 1, #spec do
|
|
41
|
+
if '' ~= spec[i] then return true end
|
|
42
|
+
end
|
|
43
|
+
return false
|
|
44
|
+
end
|
|
45
|
+
return '' ~= spec
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
-- One spelling or a LIST of them. A list fans out to the UNION of what
|
|
49
|
+
-- each names, so after: ['a','b'] means after BOTH, and the same instance
|
|
50
|
+
-- named twice - once by name, once by ref - is one edge.
|
|
51
|
+
function M.order_targets(spec, nodes)
|
|
52
|
+
local specs = T.islist(spec) and spec or { spec }
|
|
53
|
+
local hit = {}
|
|
54
|
+
local seen = {}
|
|
55
|
+
for i = 1, #specs do
|
|
56
|
+
local one = specs[i]
|
|
57
|
+
for _, b in ipairs(nodes) do
|
|
58
|
+
if not seen[b.ref] and (b.ref == one or R.refname(b.ref) == one) then
|
|
59
|
+
seen[b.ref] = true
|
|
60
|
+
hit[#hit + 1] = b.ref
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
return hit
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
-- A PIN IS NOT A CONSTRAINT (section 7).
|
|
68
|
+
--
|
|
69
|
+
-- Constraints and bands are negotiable by definition - they are what
|
|
70
|
+
-- plugins and documents say they want, and the sort's job is to satisfy
|
|
71
|
+
-- them all. A pin is the host stating a structural invariant of its own
|
|
72
|
+
-- architecture, which is a different kind of claim and must not lose a tie
|
|
73
|
+
-- to a document.
|
|
74
|
+
--
|
|
75
|
+
-- So a pin PLACES the binding at the named end, and an ordering that would
|
|
76
|
+
-- move it away is `plugin_order_pinned` - rejected, not honoured into a
|
|
77
|
+
-- broken wrap.
|
|
78
|
+
local function applypin(order, edges, edgekeys, pin)
|
|
79
|
+
if nil == pin or T.NULL == pin then return order end
|
|
80
|
+
|
|
81
|
+
local out = {}
|
|
82
|
+
for i = 1, #order do out[i] = order[i] end
|
|
83
|
+
|
|
84
|
+
-- SORTED, not insertion order. A pin map is data - it can arrive from a
|
|
85
|
+
-- host's own construction options in any order, and two names pinned to
|
|
86
|
+
-- the same end are order-sensitive. A lua table has no order at all,
|
|
87
|
+
-- which makes leaving it unstated worse here than anywhere else.
|
|
88
|
+
for _, name in ipairs(T.keys(pin)) do
|
|
89
|
+
local want = pin[name]
|
|
90
|
+
local idx
|
|
91
|
+
for i = 1, #out do
|
|
92
|
+
if R.refname(out[i]) == name then idx = i break end
|
|
93
|
+
end
|
|
94
|
+
if nil ~= idx then
|
|
95
|
+
-- `first`/`outermost` is index 1; `last`/`innermost` is the end.
|
|
96
|
+
-- Section 6.2 makes the first chain binding outermost, which is why
|
|
97
|
+
-- the vocabulary is positional and why the two spellings pair this
|
|
98
|
+
-- way.
|
|
99
|
+
local wantfirst = 'first' == want or 'outermost' == want
|
|
100
|
+
local ref = table.remove(out, idx)
|
|
101
|
+
if wantfirst then
|
|
102
|
+
table.insert(out, 1, ref)
|
|
103
|
+
else
|
|
104
|
+
out[#out + 1] = ref
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
-- Now check that the placement did not break a constraint. This is the
|
|
110
|
+
-- half that makes a pin a rejection rather than an override: the host
|
|
111
|
+
-- wins on position, but it does not get to silently discard a
|
|
112
|
+
-- relationship a plugin declared.
|
|
113
|
+
local at = {}
|
|
114
|
+
for i = 1, #out do at[out[i]] = i end
|
|
115
|
+
for _, from in ipairs(edgekeys) do
|
|
116
|
+
for _, to in ipairs(edges[from]) do
|
|
117
|
+
if at[from] > at[to] then
|
|
118
|
+
T.fail('plugin_order_pinned',
|
|
119
|
+
'a pin would move a binding an ordering constrains: '
|
|
120
|
+
.. from .. ' must precede ' .. to,
|
|
121
|
+
T.map { before = from, after = to })
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
return out
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
-- `bindings` is a plain lua array of {ref=, pos=, order=} records: an
|
|
130
|
+
-- internal shape, never a corpus value, so it is not tagged.
|
|
131
|
+
function M.resolve_order(bindings, pin)
|
|
132
|
+
local byref = {}
|
|
133
|
+
local edges = {}
|
|
134
|
+
local edgekeys = {}
|
|
135
|
+
local indeg = {}
|
|
136
|
+
for _, b in ipairs(bindings) do
|
|
137
|
+
byref[b.ref] = b
|
|
138
|
+
edges[b.ref] = {}
|
|
139
|
+
edgekeys[#edgekeys + 1] = b.ref
|
|
140
|
+
indeg[b.ref] = 0
|
|
141
|
+
end
|
|
142
|
+
table.sort(edgekeys)
|
|
143
|
+
|
|
144
|
+
-- Constraints are edges. A constraint naming an ABSENT binding is
|
|
145
|
+
-- satisfied VACUOUSLY (section 7) - a plugin ordered `after: 'test'`
|
|
146
|
+
-- must load in a host with no test plugin. That is sdkgen's __after__
|
|
147
|
+
-- behaviour, kept.
|
|
148
|
+
for _, b in ipairs(bindings) do
|
|
149
|
+
local block = T.ismap(b.order) and b.order or T.map {}
|
|
150
|
+
-- An ABSENT constraint and an EMPTY LIST are both "no constraint".
|
|
151
|
+
if M.order_declared(T.getv(block, 'after')) then
|
|
152
|
+
for _, t in ipairs(M.order_targets(T.getv(block, 'after'), bindings)) do
|
|
153
|
+
table.insert(edges[t], b.ref)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
if M.order_declared(T.getv(block, 'before')) then
|
|
157
|
+
for _, t in ipairs(M.order_targets(T.getv(block, 'before'), bindings)) do
|
|
158
|
+
table.insert(edges[b.ref], t)
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
for _, from in ipairs(edgekeys) do
|
|
164
|
+
for _, to in ipairs(edges[from]) do
|
|
165
|
+
indeg[to] = indeg[to] + 1
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
-- Stable topological sort. Among ready nodes, band first (lower runs
|
|
170
|
+
-- first), then `pos` - the position the DOCUMENT visibly states, not the
|
|
171
|
+
-- order instances happened to load and not the incarnation `seq`.
|
|
172
|
+
local out = {}
|
|
173
|
+
local ready = {}
|
|
174
|
+
for _, b in ipairs(bindings) do
|
|
175
|
+
if 0 == indeg[b.ref] then ready[#ready + 1] = b end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
while 0 < #ready do
|
|
179
|
+
ready = T.stable_sort(ready, function(a, b)
|
|
180
|
+
local ba, bb = M.order_band(a), M.order_band(b)
|
|
181
|
+
if ba ~= bb then return ba < bb end
|
|
182
|
+
return (a.pos or 0) < (b.pos or 0)
|
|
183
|
+
end)
|
|
184
|
+
local nxt = table.remove(ready, 1)
|
|
185
|
+
out[#out + 1] = nxt.ref
|
|
186
|
+
for _, to in ipairs(edges[nxt.ref]) do
|
|
187
|
+
indeg[to] = indeg[to] - 1
|
|
188
|
+
if 0 == indeg[to] then ready[#ready + 1] = byref[to] end
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if #out ~= #bindings then
|
|
193
|
+
local placed = {}
|
|
194
|
+
for _, r in ipairs(out) do placed[r] = true end
|
|
195
|
+
local stuck = {}
|
|
196
|
+
for _, b in ipairs(bindings) do
|
|
197
|
+
if not placed[b.ref] then stuck[#stuck + 1] = b.ref end
|
|
198
|
+
end
|
|
199
|
+
T.fail('plugin_order_cycle',
|
|
200
|
+
'before/after constraints cycle: ' .. table.concat(stuck, ' -> '),
|
|
201
|
+
T.map { cycle = T.list(stuck) })
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
return applypin(out, edges, edgekeys, pin)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
return M
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/point.lua)
|
|
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 (section 6). Three kinds, chosen because they are what
|
|
5
|
+
-- the two existing systems actually needed, and no more.
|
|
6
|
+
--
|
|
7
|
+
-- A PLUGIN NEVER MUTATES THE HOST. That inversion is what makes
|
|
8
|
+
-- deactivation possible: sdkgen's `utility.fetcher = wrapped` is not
|
|
9
|
+
-- undoable, but "this instance holds slot 3 of the request chain" is
|
|
10
|
+
-- undoable in O(1). OSGi named it the whiteboard pattern in 2004, in a
|
|
11
|
+
-- paper called *Listeners Considered Harmful*, and for exactly this
|
|
12
|
+
-- reason.
|
|
13
|
+
|
|
14
|
+
local T = require 'feature.secrets.plugin.types'
|
|
15
|
+
|
|
16
|
+
local M = {}
|
|
17
|
+
|
|
18
|
+
-- Section 6.1: "fan-out" is not one answer but four. In a language with
|
|
19
|
+
-- asynchrony, "call every binding" hides a decision - start them all and
|
|
20
|
+
-- wait, await each in turn, or do not wait - and a design that leaves it
|
|
21
|
+
-- unsaid gets four different answers from four ports, in the concurrency
|
|
22
|
+
-- behaviour of production code no corpus entry happens to cover.
|
|
23
|
+
M.MODES = { 'emit', 'parallel', 'serial', 'bail' }
|
|
24
|
+
|
|
25
|
+
-- Fan-out. Return values are ignored except in `bail`.
|
|
26
|
+
function M.point_emit(bindings, mode, arg)
|
|
27
|
+
if 'bail' == mode then
|
|
28
|
+
-- Stops at the first binding that RETURNS A VALUE - the "handled,
|
|
29
|
+
-- stop" case. A `nil` RETURN DECLINES (section 6.1): lua has one way
|
|
30
|
+
-- to say nothing, and the model's rule is written to that rather than
|
|
31
|
+
-- to JavaScript's null/undefined pair. Not truthiness - `false` is a
|
|
32
|
+
-- value.
|
|
33
|
+
for _, b in ipairs(bindings) do
|
|
34
|
+
local v = b.fn(nil, arg)
|
|
35
|
+
-- BOTH SPELLINGS OF NOTHING DECLINE. A lua callback returns `nil`,
|
|
36
|
+
-- and a callback handing back a JSON null returns `T.NULL` - the
|
|
37
|
+
-- sentinel this port uses because a table cannot store a nil. The
|
|
38
|
+
-- model's rule is that NULL declines (`point/bail#null-declines`
|
|
39
|
+
-- pins a provider configured with `value: null` letting the next one
|
|
40
|
+
-- answer), so a port that stopped on the sentinel would answer null
|
|
41
|
+
-- where every other port answers "B".
|
|
42
|
+
if nil ~= v and T.NULL ~= v then return v end
|
|
43
|
+
end
|
|
44
|
+
return nil
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
local errors = {}
|
|
48
|
+
for _, b in ipairs(bindings) do
|
|
49
|
+
local ok, err = pcall(b.fn, nil, arg)
|
|
50
|
+
if not ok then
|
|
51
|
+
-- `emit` raises synchronously; the collecting modes gather.
|
|
52
|
+
if 'emit' == mode then error(err, 0) end
|
|
53
|
+
errors[#errors + 1] = T.message(err)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
if 'emit' == mode then return nil end
|
|
57
|
+
return T.list(errors)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
-- Composition: b1(b2(b3(base))), FIRST BINDING OUTERMOST (section 6.2).
|
|
61
|
+
--
|
|
62
|
+
-- Recomputed by the host whenever the live set changes, and cached between
|
|
63
|
+
-- changes. Plugins receive `next` as an argument; they never see or store
|
|
64
|
+
-- the previous value of anything. A plugin that stashes `next` and calls
|
|
65
|
+
-- it after deactivation is a bug the host cannot prevent, and this says so
|
|
66
|
+
-- rather than pretending otherwise.
|
|
67
|
+
function M.compose(bindings, base)
|
|
68
|
+
local nxt = base
|
|
69
|
+
for i = #bindings, 1, -1 do
|
|
70
|
+
-- Fresh locals per iteration, so each layer closes over its own pair -
|
|
71
|
+
-- lua gives that for free where ruby's blocks do not.
|
|
72
|
+
local fn = bindings[i].fn
|
|
73
|
+
local inner = nxt
|
|
74
|
+
nxt = function(...) return fn(inner, ...) end
|
|
75
|
+
end
|
|
76
|
+
return nxt
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
-- At most one live implementation (section 6.3). The winner is the highest
|
|
80
|
+
-- band, ties broken by ref sort, and THE LOSERS ARE VISIBLE rather than
|
|
81
|
+
-- silently ignored.
|
|
82
|
+
function M.point_provider(bindings, spec)
|
|
83
|
+
if 0 == #bindings then
|
|
84
|
+
return { winner = nil, shadowed = T.list {} }
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if T.truthy(T.getv(spec, 'exclusive')) and 1 < #bindings then
|
|
88
|
+
local refs = {}
|
|
89
|
+
for _, b in ipairs(bindings) do refs[#refs + 1] = b.ref end
|
|
90
|
+
table.sort(refs)
|
|
91
|
+
T.fail('plugin_point_exclusive',
|
|
92
|
+
'point is exclusive and has ' .. #bindings .. ' bindings: '
|
|
93
|
+
.. table.concat(refs, ', '),
|
|
94
|
+
T.map { refs = T.list(refs) })
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
local ranked = T.stable_sort(bindings, function(a, b)
|
|
98
|
+
if a.band ~= b.band then return a.band > b.band end
|
|
99
|
+
return a.ref < b.ref
|
|
100
|
+
end)
|
|
101
|
+
local shadowed = {}
|
|
102
|
+
for i = 2, #ranked do shadowed[#shadowed + 1] = ranked[i].ref end
|
|
103
|
+
return { winner = ranked[1], shadowed = T.list(shadowed) }
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
return M
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/ref.lua)
|
|
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
|
+
-- Identity: name+tag, written `name$tag` (section 4).
|
|
5
|
+
--
|
|
6
|
+
-- The four pure functions, and the whole of what `ref` pins. They are the
|
|
7
|
+
-- first thing a new port implements and the first corpus section it
|
|
8
|
+
-- passes.
|
|
9
|
+
--
|
|
10
|
+
-- LUA'S `$` IS A TRUE END ANCHOR. A lua pattern has no multiline mode and
|
|
11
|
+
-- `$` matches only at the end of the subject, so `^...$` here cannot admit
|
|
12
|
+
-- the trailing newline that ruby, python, perl and php each had to write
|
|
13
|
+
-- `\A`/`\z` (or a character walk) to exclude. The four
|
|
14
|
+
-- `#trailing-newline` entries pass this port without it having to know
|
|
15
|
+
-- they exist.
|
|
16
|
+
|
|
17
|
+
local T = require 'feature.secrets.plugin.types'
|
|
18
|
+
|
|
19
|
+
local M = {}
|
|
20
|
+
|
|
21
|
+
-- Section 4: `^[a-zA-Z@][a-zA-Z0-9.~_\-/]*$`, max 1024.
|
|
22
|
+
M.NAME_PAT = '^[a-zA-Z@][a-zA-Z0-9.~_/%-]*$'
|
|
23
|
+
|
|
24
|
+
-- Section 4: `^[a-zA-Z0-9.~_-]+$`, max 1024, or empty.
|
|
25
|
+
--
|
|
26
|
+
-- The asymmetry with a name is deliberate: a tag MAY start with a digit
|
|
27
|
+
-- because auto-tagging assigns integer tags (`stripe$1`), and a tag admits
|
|
28
|
+
-- neither `@` nor `/` because a name is a package specifier and a tag is
|
|
29
|
+
-- not.
|
|
30
|
+
M.TAG_PAT = '^[a-zA-Z0-9.~_%-]+$'
|
|
31
|
+
|
|
32
|
+
M.REF_MAX = 1024
|
|
33
|
+
|
|
34
|
+
function M.check_name(name)
|
|
35
|
+
if 'string' ~= type(name) then return false end
|
|
36
|
+
if '' == name or M.REF_MAX < #name then return false end
|
|
37
|
+
return nil ~= name:match(M.NAME_PAT)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
function M.check_tag(tag)
|
|
41
|
+
if 'string' ~= type(tag) then return false end
|
|
42
|
+
-- The empty tag is an ordinary tag (section 4 rule 2). The
|
|
43
|
+
-- single-instance case writes no tag and never learns tags exist.
|
|
44
|
+
if '' == tag then return true end
|
|
45
|
+
if M.REF_MAX < #tag then return false end
|
|
46
|
+
return nil ~= tag:match(M.TAG_PAT)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
-- `name$tag` -> the pair. Canonicalizing: `stripe$` and `stripe` both give
|
|
50
|
+
-- tag ''.
|
|
51
|
+
function M.parse_ref(str)
|
|
52
|
+
if 'string' ~= type(str) then
|
|
53
|
+
T.fail('plugin_bad_name', 'ref must be a string', nil)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
-- Split on the FIRST `$`. Nothing in the grammar decides this - `$` is
|
|
57
|
+
-- in neither character class - so the corpus is the arbiter (section 4
|
|
58
|
+
-- rule 5), and it picks the split that blames the part actually at
|
|
59
|
+
-- fault: `a$b$c` is a good name with a bad tag, not the reverse.
|
|
60
|
+
local cut = str:find('$', 1, true)
|
|
61
|
+
local name = nil == cut and str or str:sub(1, cut - 1)
|
|
62
|
+
local tag = nil == cut and '' or str:sub(cut + 1)
|
|
63
|
+
|
|
64
|
+
if not M.check_name(name) then
|
|
65
|
+
T.fail('plugin_bad_name', 'invalid plugin name: ' .. name,
|
|
66
|
+
T.map { name = name })
|
|
67
|
+
end
|
|
68
|
+
if not M.check_tag(tag) then
|
|
69
|
+
T.fail('plugin_bad_tag', 'invalid plugin tag: ' .. tag,
|
|
70
|
+
T.map { name = name, tag = tag })
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
return T.map { name = name, tag = tag }
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
-- The pair -> `name$tag`. An empty tag NEVER writes the separator, which
|
|
77
|
+
-- is the half of canonicalization format_ref owns: parse tolerates
|
|
78
|
+
-- `stripe$`, format never produces it, so a round trip is idempotent.
|
|
79
|
+
function M.format_ref(name, tag)
|
|
80
|
+
if nil == tag or T.NULL == tag then tag = '' end
|
|
81
|
+
if not M.check_name(name) then
|
|
82
|
+
T.fail('plugin_bad_name', 'invalid plugin name: ' .. T.encode(name),
|
|
83
|
+
T.map { name = name })
|
|
84
|
+
end
|
|
85
|
+
if not M.check_tag(tag) then
|
|
86
|
+
T.fail('plugin_bad_tag', 'invalid plugin tag: ' .. T.encode(tag),
|
|
87
|
+
T.map { name = name, tag = tag })
|
|
88
|
+
end
|
|
89
|
+
if '' == tag then return name end
|
|
90
|
+
return name .. '$' .. tag
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
-- The canonical spelling of a ref. Section 4 rule 5: ports must
|
|
94
|
+
-- canonicalize before comparison.
|
|
95
|
+
function M.canon_ref(str)
|
|
96
|
+
local parsed = M.parse_ref(str)
|
|
97
|
+
return M.format_ref(parsed.name, parsed.tag)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
-- canon_ref for the internal callers that want the input back unchanged
|
|
101
|
+
-- when it is not well formed. NEVER use it where a bad ref must be
|
|
102
|
+
-- reported - the corpus pins plugin_bad_name at every public entry.
|
|
103
|
+
function M.canon(str)
|
|
104
|
+
local ok, out = pcall(M.canon_ref, str)
|
|
105
|
+
if ok then return out end
|
|
106
|
+
return str
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
function M.refname(str)
|
|
110
|
+
local ok, out = pcall(function() return M.parse_ref(str).name end)
|
|
111
|
+
if ok then return out end
|
|
112
|
+
return str
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
return M
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/resolve.lua)
|
|
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
|
+
-- Dynamic resolution (section 10.2) - name to candidate module ids.
|
|
5
|
+
--
|
|
6
|
+
-- PURE. It returns the ids a host WOULD try, in order; it does not load
|
|
7
|
+
-- anything. That separation is what lets the corpus pin resolution in
|
|
8
|
+
-- every language including those with no dynamic loading at all, and it is
|
|
9
|
+
-- why section 15.4 puts real module loading in per-port integration tests
|
|
10
|
+
-- rather than here.
|
|
11
|
+
|
|
12
|
+
local T = require 'feature.secrets.plugin.types'
|
|
13
|
+
|
|
14
|
+
local M = {}
|
|
15
|
+
|
|
16
|
+
function M.default_sources()
|
|
17
|
+
return T.list {
|
|
18
|
+
T.map {
|
|
19
|
+
kind = 'module',
|
|
20
|
+
prefix = T.list { '@voxgig/plugin-', 'voxgig-plugin-', 'plugin-', '' },
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
function M.resolve_candidates(name, sources)
|
|
26
|
+
local out = {}
|
|
27
|
+
local seen = {}
|
|
28
|
+
|
|
29
|
+
-- A SCOPED NAME RESOLVES VERBATIM ONLY (section 10.2). `@acme/thing` is
|
|
30
|
+
-- already a package id; prefixing it produces
|
|
31
|
+
-- `@voxgig/plugin-@acme/thing`, which is not a thing that can exist.
|
|
32
|
+
if '@' == name:sub(1, 1) then
|
|
33
|
+
return T.list { name }
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
local list = sources
|
|
37
|
+
if not T.islist(list) or 0 == #list then
|
|
38
|
+
list = M.default_sources()
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
for i = 1, #list do
|
|
42
|
+
local src = list[i]
|
|
43
|
+
local kind = T.getv(src, 'kind')
|
|
44
|
+
if 'module' == kind then
|
|
45
|
+
local prefixes = T.getv(src, 'prefix')
|
|
46
|
+
if not T.islist(prefixes) or 0 == #prefixes then
|
|
47
|
+
prefixes = T.list { '' }
|
|
48
|
+
end
|
|
49
|
+
for j = 1, #prefixes do
|
|
50
|
+
local id = prefixes[j] .. name
|
|
51
|
+
if not seen[id] then
|
|
52
|
+
seen[id] = true
|
|
53
|
+
out[#out + 1] = id
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
elseif 'path' == kind then
|
|
57
|
+
local dir = (T.getv(src, 'dir') or ''):gsub('/+$', '')
|
|
58
|
+
local id = dir .. '/' .. name
|
|
59
|
+
if not seen[id] then
|
|
60
|
+
seen[id] = true
|
|
61
|
+
out[#out + 1] = id
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
return T.list(out)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
-- A MODULE PATH IS NOT A NAME (section 10.2). The ref grammar starts a
|
|
70
|
+
-- name with a letter or `@`, so `./local/thing` is not a ref and never
|
|
71
|
+
-- reaches candidate generation - seneca allows a path where a plugin name
|
|
72
|
+
-- goes, and this design deliberately does not, because a ref is an ADDRESS
|
|
73
|
+
-- WITHIN A HOST and a path is a LOCATION ON A DISK.
|
|
74
|
+
function M.resolve_from(from)
|
|
75
|
+
return T.list { from }
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
return M
|