@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,202 @@
|
|
|
1
|
+
(* VENDORED: @voxgig/plugin sdk-20260908-1556-0 (ocaml/src/order.ml) *)
|
|
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
|
+
module V = Value
|
|
21
|
+
|
|
22
|
+
let bandof b =
|
|
23
|
+
(* A NUMBER, not a numeric string. `order.band` accepting "1" was a
|
|
24
|
+
surviving mutation in more than one port: the corpus pins the type
|
|
25
|
+
because two ports disagreeing about whether "1" is a band is
|
|
26
|
+
exactly the divergence a shared corpus exists to remove. *)
|
|
27
|
+
let band = V.get (V.get b "order") "band" in
|
|
28
|
+
if V.is_num band then V.as_num band else 0.0
|
|
29
|
+
|
|
30
|
+
let posof b =
|
|
31
|
+
let p = V.get b "pos" in
|
|
32
|
+
if V.is_num p then V.as_num p else 0.0
|
|
33
|
+
|
|
34
|
+
(* Band first (lower runs first), then `pos` — the position the
|
|
35
|
+
DOCUMENT visibly states, not the order instances happened to load
|
|
36
|
+
and not the incarnation `seq`. *)
|
|
37
|
+
let rank a b =
|
|
38
|
+
let ab = bandof a and bb = bandof b in
|
|
39
|
+
if ab <> bb then compare ab bb else compare (posof a) (posof b)
|
|
40
|
+
|
|
41
|
+
(* Was a constraint actually declared? An ABSENT one and an EMPTY LIST
|
|
42
|
+
are both "no constraint"; only a non-empty spelling is an edge. *)
|
|
43
|
+
let declared spec =
|
|
44
|
+
if V.is_list spec then 0 < V.len spec
|
|
45
|
+
else if V.is_str spec then "" <> V.as_str spec
|
|
46
|
+
else false
|
|
47
|
+
|
|
48
|
+
(* Matching is by REF, or by NAME across all of that definition's
|
|
49
|
+
instances (§7) — which is the whole reason the two spellings
|
|
50
|
+
exist. *)
|
|
51
|
+
let targets spec nodes =
|
|
52
|
+
let specs = if V.is_list spec then V.items spec else [ spec ] in
|
|
53
|
+
let hit = ref [] in
|
|
54
|
+
List.iter
|
|
55
|
+
(fun oneval ->
|
|
56
|
+
if V.is_str oneval then begin
|
|
57
|
+
let one = V.as_str oneval in
|
|
58
|
+
List.iter
|
|
59
|
+
(fun node ->
|
|
60
|
+
let r = V.as_str (V.get node "ref") in
|
|
61
|
+
if (not (List.mem r !hit)) && (r = one || Ref.refname r = one) then
|
|
62
|
+
hit := !hit @ [ r ])
|
|
63
|
+
(V.items nodes)
|
|
64
|
+
end)
|
|
65
|
+
specs;
|
|
66
|
+
!hit
|
|
67
|
+
|
|
68
|
+
(* A PIN IS NOT A CONSTRAINT (§7).
|
|
69
|
+
|
|
70
|
+
Constraints and bands are negotiable by definition — they are what
|
|
71
|
+
plugins and documents say they want, and the sort's job is to
|
|
72
|
+
satisfy them all. A pin is the host stating a structural invariant
|
|
73
|
+
of its own architecture, which is a different kind of claim and must
|
|
74
|
+
not lose a tie to a document.
|
|
75
|
+
|
|
76
|
+
So a pin PLACES the binding at the named end, and an ordering that
|
|
77
|
+
would move it away is `plugin_order_pinned` — rejected, not honoured
|
|
78
|
+
into a broken wrap. *)
|
|
79
|
+
let applypin order edges pin =
|
|
80
|
+
if not (V.is_map pin) then order
|
|
81
|
+
else begin
|
|
82
|
+
let out = ref (List.map V.as_str (V.items order)) in
|
|
83
|
+
(* SORTED, not insertion order. A pin map is data — it can arrive
|
|
84
|
+
from a host's own construction options in any order, and two
|
|
85
|
+
names pinned to the same end are order-sensitive. Sorted is the
|
|
86
|
+
one order every language agrees on, and `order/pin#two-names`
|
|
87
|
+
pins it. *)
|
|
88
|
+
List.iter
|
|
89
|
+
(fun name ->
|
|
90
|
+
let want = V.as_str (V.get pin name) in
|
|
91
|
+
match List.find_opt (fun r -> Ref.refname r = name) !out with
|
|
92
|
+
| None -> ()
|
|
93
|
+
| Some r ->
|
|
94
|
+
(* `first`/`outermost` is index 0; `last`/`innermost` is the
|
|
95
|
+
end. §6.2 makes the first chain binding outermost, which
|
|
96
|
+
is why the vocabulary is positional and why the two
|
|
97
|
+
spellings pair this way. *)
|
|
98
|
+
let wantfirst = "first" = want || "outermost" = want in
|
|
99
|
+
let rest = List.filter (fun x -> x <> r) !out in
|
|
100
|
+
out := (if wantfirst then r :: rest else rest @ [ r ]))
|
|
101
|
+
(V.sortedkeys pin);
|
|
102
|
+
|
|
103
|
+
(* Now check that the placement did not break a constraint. This is
|
|
104
|
+
the half that makes a pin a rejection rather than an override:
|
|
105
|
+
the host wins on position, but it does not get to silently
|
|
106
|
+
discard a relationship a plugin declared. *)
|
|
107
|
+
let index = V.vmap () in
|
|
108
|
+
List.iteri (fun i r -> V.set index r (V.vnum (float_of_int i))) !out;
|
|
109
|
+
List.iter
|
|
110
|
+
(fun from ->
|
|
111
|
+
List.iter
|
|
112
|
+
(fun tov ->
|
|
113
|
+
let t = V.as_str tov in
|
|
114
|
+
if V.as_num (V.get index from) > V.as_num (V.get index t) then begin
|
|
115
|
+
let d = V.vmap () in
|
|
116
|
+
V.set d "before" (V.vstr from);
|
|
117
|
+
V.set d "after" (V.vstr t);
|
|
118
|
+
Types.fail "plugin_order_pinned"
|
|
119
|
+
("a pin would move a binding an ordering constrains: " ^ from
|
|
120
|
+
^ " must precede " ^ t)
|
|
121
|
+
~details:d
|
|
122
|
+
end)
|
|
123
|
+
(V.items (V.get edges from)))
|
|
124
|
+
(V.sortedkeys edges);
|
|
125
|
+
|
|
126
|
+
V.oflist (List.map V.vstr !out)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
let resolveorder bindings pin =
|
|
130
|
+
let nodes = V.items bindings in
|
|
131
|
+
let n = List.length nodes in
|
|
132
|
+
|
|
133
|
+
let byref = V.vmap () in
|
|
134
|
+
List.iter (fun b -> V.set byref (V.as_str (V.get b "ref")) b) nodes;
|
|
135
|
+
|
|
136
|
+
(* Constraints are edges. A constraint naming an ABSENT binding is
|
|
137
|
+
satisfied VACUOUSLY (§7) — a plugin ordered `after: 'test'` must
|
|
138
|
+
load in a host with no test plugin. That is sdkgen's __after__
|
|
139
|
+
behaviour, kept. *)
|
|
140
|
+
let edges = V.vmap () in
|
|
141
|
+
List.iter (fun b -> V.set edges (V.as_str (V.get b "ref")) (V.vlist ())) nodes;
|
|
142
|
+
|
|
143
|
+
List.iter
|
|
144
|
+
(fun b ->
|
|
145
|
+
let bref = V.as_str (V.get b "ref") in
|
|
146
|
+
let o = V.get b "order" in
|
|
147
|
+
let after = V.get o "after" and before = V.get o "before" in
|
|
148
|
+
if declared after then
|
|
149
|
+
List.iter (fun t -> V.push (V.get edges t) (V.vstr bref))
|
|
150
|
+
(targets after bindings);
|
|
151
|
+
if declared before then
|
|
152
|
+
List.iter (fun t -> V.push (V.get edges bref) (V.vstr t))
|
|
153
|
+
(targets before bindings))
|
|
154
|
+
nodes;
|
|
155
|
+
|
|
156
|
+
(* Stable topological sort. *)
|
|
157
|
+
let indeg = V.vmap () in
|
|
158
|
+
List.iter (fun b -> V.set indeg (V.as_str (V.get b "ref")) (V.vnum 0.0)) nodes;
|
|
159
|
+
List.iter
|
|
160
|
+
(fun from ->
|
|
161
|
+
List.iter
|
|
162
|
+
(fun tov ->
|
|
163
|
+
let t = V.as_str tov in
|
|
164
|
+
V.set indeg t (V.vnum (V.as_num (V.get indeg t) +. 1.0)))
|
|
165
|
+
(V.items (V.get edges from)))
|
|
166
|
+
(V.keys edges);
|
|
167
|
+
|
|
168
|
+
let ready =
|
|
169
|
+
ref (List.filter
|
|
170
|
+
(fun b -> 0.0 = V.as_num (V.get indeg (V.as_str (V.get b "ref"))))
|
|
171
|
+
nodes)
|
|
172
|
+
in
|
|
173
|
+
let out = ref [] in
|
|
174
|
+
while [] <> !ready do
|
|
175
|
+
let sorted = List.stable_sort rank !ready in
|
|
176
|
+
let next = List.hd sorted in
|
|
177
|
+
ready := List.tl sorted;
|
|
178
|
+
let nref = V.as_str (V.get next "ref") in
|
|
179
|
+
out := !out @ [ nref ];
|
|
180
|
+
List.iter
|
|
181
|
+
(fun tov ->
|
|
182
|
+
let t = V.as_str tov in
|
|
183
|
+
let d = V.as_num (V.get indeg t) -. 1.0 in
|
|
184
|
+
V.set indeg t (V.vnum d);
|
|
185
|
+
if 0.0 = d then ready := !ready @ [ V.get byref t ])
|
|
186
|
+
(V.items (V.get edges nref))
|
|
187
|
+
done;
|
|
188
|
+
|
|
189
|
+
if List.length !out <> n then begin
|
|
190
|
+
let stuck =
|
|
191
|
+
List.filter_map
|
|
192
|
+
(fun b ->
|
|
193
|
+
let r = V.as_str (V.get b "ref") in
|
|
194
|
+
if List.mem r !out then None else Some r)
|
|
195
|
+
nodes
|
|
196
|
+
in
|
|
197
|
+
Types.fail "plugin_order_cycle"
|
|
198
|
+
("before/after constraints cycle: " ^ String.concat " -> " stuck)
|
|
199
|
+
~details:(Types.details1 "cycle" (V.oflist (List.map V.vstr stuck)))
|
|
200
|
+
end;
|
|
201
|
+
|
|
202
|
+
applypin (V.oflist (List.map V.vstr !out)) edges pin
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
(* VENDORED: @voxgig/plugin sdk-20260908-1556-0 (ocaml/src/point.ml) *)
|
|
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). Three kinds, chosen because they are what the
|
|
5
|
+
two existing systems actually needed, and no more.
|
|
6
|
+
|
|
7
|
+
A PLUGIN NEVER MUTATES THE HOST. That inversion is what makes
|
|
8
|
+
deactivation possible: sdkgen's `utility.fetcher = wrapped` is not
|
|
9
|
+
undoable, but "this instance holds slot 3 of the request chain" is
|
|
10
|
+
undoable in O(1). OSGi named it the whiteboard pattern in 2004, in a
|
|
11
|
+
paper called *Listeners Considered Harmful*, and for exactly this
|
|
12
|
+
reason.
|
|
13
|
+
|
|
14
|
+
A CLOSURE IS A CLOSURE, which is the whole difference from the `c`
|
|
15
|
+
port: a chain binding receives its `next` as a function the
|
|
16
|
+
composition built — the same shape the canonical writes — instead of
|
|
17
|
+
c's explicit `Chain *` walked by index. *)
|
|
18
|
+
|
|
19
|
+
module V = Value
|
|
20
|
+
|
|
21
|
+
(* A binding answers with an option: None DECLINES, Some v answers.
|
|
22
|
+
`bail` needs the distinction and c reaches it with a NULL pointer;
|
|
23
|
+
here it is the type. *)
|
|
24
|
+
type hook = V.t -> V.t option
|
|
25
|
+
|
|
26
|
+
(* The remaining composition, as seen by one chain binding. A binding
|
|
27
|
+
may CALL it and must not store it — a plugin that stashes `next` and
|
|
28
|
+
calls it after deactivation is a bug the host cannot prevent, and
|
|
29
|
+
saying so is better than pretending otherwise (§6.2). *)
|
|
30
|
+
type next = V.t -> V.t
|
|
31
|
+
type chainfn = next -> V.t -> V.t
|
|
32
|
+
|
|
33
|
+
type bound = {
|
|
34
|
+
bref : string;
|
|
35
|
+
bpoint : string;
|
|
36
|
+
(* `provider` ranks by HIGHEST band, unlike hook and chain which run
|
|
37
|
+
lowest first. Kept as declared so the two rules stay visibly
|
|
38
|
+
different rather than one being derived from the other by a reader
|
|
39
|
+
who then gets it backwards. *)
|
|
40
|
+
mutable band : float;
|
|
41
|
+
bhook : hook option;
|
|
42
|
+
bchain : chainfn option;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
(* Composition: b1(b2(b3(base))), FIRST BINDING OUTERMOST (§6.2). *)
|
|
46
|
+
let pointcall bindings base arg =
|
|
47
|
+
let rec callat bs a =
|
|
48
|
+
match bs with
|
|
49
|
+
| [] -> (match base with Some f -> f a | None -> a)
|
|
50
|
+
| b :: rest ->
|
|
51
|
+
(match b.bchain with
|
|
52
|
+
| Some c -> c (fun x -> callat rest x) a
|
|
53
|
+
| None -> callat rest a)
|
|
54
|
+
in
|
|
55
|
+
callat bindings arg
|
|
56
|
+
|
|
57
|
+
let callhook b arg = match b.bhook with Some h -> h arg | None -> None
|
|
58
|
+
|
|
59
|
+
(* Fan-out. Return values are ignored except in `bail`.
|
|
60
|
+
|
|
61
|
+
§6.1: "fan-out" is not one answer but four. In a language with
|
|
62
|
+
asynchrony, "call every binding" hides a decision — start them all
|
|
63
|
+
and wait, await each in turn, or do not wait — and a design that
|
|
64
|
+
leaves it unsaid gets four different answers from four ports, in the
|
|
65
|
+
concurrency behaviour of production code no corpus entry happens to
|
|
66
|
+
cover. This port is synchronous, so all four modes are sequential
|
|
67
|
+
here and only the ERROR and RETURN handling distinguishes them.
|
|
68
|
+
|
|
69
|
+
Answers (result, errors). *)
|
|
70
|
+
let pointemit bindings mode arg =
|
|
71
|
+
let errors = V.vlist () in
|
|
72
|
+
if "bail" = mode then begin
|
|
73
|
+
(* Stops at the first binding that RETURNS A VALUE — the "handled,
|
|
74
|
+
stop" case. NONE, AND A JSON NULL, BOTH DECLINE.
|
|
75
|
+
|
|
76
|
+
JavaScript can tell null from undefined and almost nothing else
|
|
77
|
+
in the target set can — Go, Python, Ruby, PHP, Lua, Java and C#
|
|
78
|
+
each have exactly one way to say nothing. Making the distinction
|
|
79
|
+
load-bearing would cost every one of them a wrapper type carried
|
|
80
|
+
through the whole dispatch path, to express a difference their
|
|
81
|
+
plugin authors cannot write. §18's budget settles it (§6.1). *)
|
|
82
|
+
let rec go = function
|
|
83
|
+
| [] -> (None, errors)
|
|
84
|
+
| b :: rest -> (
|
|
85
|
+
match callhook b arg with
|
|
86
|
+
| Some v when not (V.is_null v) -> (Some v, errors)
|
|
87
|
+
| _ -> go rest)
|
|
88
|
+
in
|
|
89
|
+
go bindings
|
|
90
|
+
end
|
|
91
|
+
else begin
|
|
92
|
+
let raising = "emit" = mode in
|
|
93
|
+
List.iter
|
|
94
|
+
(fun b ->
|
|
95
|
+
if raising then ignore (callhook b arg)
|
|
96
|
+
else
|
|
97
|
+
(* `emit` raises synchronously; the collecting modes
|
|
98
|
+
gather. *)
|
|
99
|
+
try ignore (callhook b arg) with
|
|
100
|
+
| Types.Plugin_error e ->
|
|
101
|
+
let rec_ = V.vmap () in
|
|
102
|
+
V.set rec_ "code" (V.vstr e.Types.code);
|
|
103
|
+
V.set rec_ "message" (V.vstr e.Types.message);
|
|
104
|
+
V.push errors rec_)
|
|
105
|
+
bindings;
|
|
106
|
+
(None, errors)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
(* At most one live implementation (§6.3). The winner is the highest
|
|
110
|
+
band, ties broken by ref sort, and THE LOSERS ARE VISIBLE rather
|
|
111
|
+
than silently ignored. Answers (winner, shadowed refs). *)
|
|
112
|
+
let pointprovider bindings exclusive =
|
|
113
|
+
if [] = bindings then (None, V.vlist ())
|
|
114
|
+
else begin
|
|
115
|
+
if exclusive && 1 < List.length bindings then begin
|
|
116
|
+
(* Sorted, so the message names the same pair whatever order the
|
|
117
|
+
bindings arrived in. *)
|
|
118
|
+
let refs = List.sort compare (List.map (fun b -> b.bref) bindings) in
|
|
119
|
+
Types.fail "plugin_point_exclusive"
|
|
120
|
+
("point is exclusive and has "
|
|
121
|
+
^ string_of_int (List.length bindings)
|
|
122
|
+
^ " bindings: " ^ String.concat ", " refs)
|
|
123
|
+
~details:(Types.details1 "refs" (V.oflist (List.map V.vstr refs)))
|
|
124
|
+
end;
|
|
125
|
+
(* HIGHEST band wins, unlike hook and chain; ties break by ref
|
|
126
|
+
sort, which is a TOTAL order. *)
|
|
127
|
+
let ranked =
|
|
128
|
+
List.stable_sort
|
|
129
|
+
(fun a b ->
|
|
130
|
+
if a.band <> b.band then compare b.band a.band
|
|
131
|
+
else compare a.bref b.bref)
|
|
132
|
+
bindings
|
|
133
|
+
in
|
|
134
|
+
let shadowed =
|
|
135
|
+
V.oflist (List.map (fun b -> V.vstr b.bref) (List.tl ranked))
|
|
136
|
+
in
|
|
137
|
+
(Some (List.hd ranked), shadowed)
|
|
138
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
(* VENDORED: @voxgig/plugin sdk-20260908-1556-0 (ocaml/src/ref.ml) *)
|
|
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` (§4).
|
|
5
|
+
|
|
6
|
+
The four pure functions, and the whole of what `ref` pins. They are
|
|
7
|
+
the first thing a new port implements and the first corpus section
|
|
8
|
+
it passes. *)
|
|
9
|
+
|
|
10
|
+
module V = Value
|
|
11
|
+
|
|
12
|
+
let max_ref = 1024
|
|
13
|
+
|
|
14
|
+
let isnamehead c =
|
|
15
|
+
('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || '@' = c
|
|
16
|
+
|
|
17
|
+
let isnamebody c =
|
|
18
|
+
('a' <= c && c <= 'z')
|
|
19
|
+
|| ('A' <= c && c <= 'Z')
|
|
20
|
+
|| ('0' <= c && c <= '9')
|
|
21
|
+
|| '.' = c || '~' = c || '_' = c || '-' = c || '/' = c
|
|
22
|
+
|
|
23
|
+
let istagchar c =
|
|
24
|
+
('a' <= c && c <= 'z')
|
|
25
|
+
|| ('A' <= c && c <= 'Z')
|
|
26
|
+
|| ('0' <= c && c <= '9')
|
|
27
|
+
|| '.' = c || '~' = c || '_' = c || '-' = c
|
|
28
|
+
|
|
29
|
+
let namely name =
|
|
30
|
+
let n = String.length name in
|
|
31
|
+
n > 0 && n <= max_ref
|
|
32
|
+
&& isnamehead name.[0]
|
|
33
|
+
&&
|
|
34
|
+
let ok = ref true in
|
|
35
|
+
String.iteri (fun i c -> if 0 < i && not (isnamebody c) then ok := false) name;
|
|
36
|
+
!ok
|
|
37
|
+
|
|
38
|
+
let tagly tag =
|
|
39
|
+
let n = String.length tag in
|
|
40
|
+
(* The empty tag is an ordinary tag (§4 rule 2). The single-instance
|
|
41
|
+
case writes no tag and never learns tags exist. *)
|
|
42
|
+
if 0 = n then true
|
|
43
|
+
else if n > max_ref then false
|
|
44
|
+
else
|
|
45
|
+
let ok = ref true in
|
|
46
|
+
String.iter (fun c -> if not (istagchar c) then ok := false) tag;
|
|
47
|
+
!ok
|
|
48
|
+
|
|
49
|
+
(* A non-string is not a name. Every port has to answer this the same
|
|
50
|
+
way, and `ref/name` pins it for numbers, nulls and maps alike. *)
|
|
51
|
+
let checkname name = V.is_str name && namely (V.as_str name)
|
|
52
|
+
let checktag tag = V.is_str tag && tagly (V.as_str tag)
|
|
53
|
+
|
|
54
|
+
(* Split on the FIRST `$`. Nothing in the grammar decides this — `$` is
|
|
55
|
+
in neither character class — so the corpus is the arbiter (§4 rule
|
|
56
|
+
5), and it picks the split that blames the part actually at fault:
|
|
57
|
+
`a$b$c` is a good name with a bad tag, not the reverse. *)
|
|
58
|
+
let split s =
|
|
59
|
+
match String.index_opt s '$' with
|
|
60
|
+
| None -> (s, "")
|
|
61
|
+
| Some cut ->
|
|
62
|
+
(String.sub s 0 cut, String.sub s (cut + 1) (String.length s - cut - 1))
|
|
63
|
+
|
|
64
|
+
let parseref str =
|
|
65
|
+
if not (V.is_str str) then Types.fail "plugin_bad_name" "ref must be a string";
|
|
66
|
+
let name, tag = split (V.as_str str) in
|
|
67
|
+
if not (namely name) then
|
|
68
|
+
Types.fail "plugin_bad_name"
|
|
69
|
+
("invalid plugin name: " ^ name)
|
|
70
|
+
~details:(Types.details1 "name" (V.vstr name));
|
|
71
|
+
if not (tagly tag) then
|
|
72
|
+
Types.fail "plugin_bad_tag"
|
|
73
|
+
("invalid plugin tag: " ^ tag)
|
|
74
|
+
~details:(Types.details2 "name" (V.vstr name) "tag" (V.vstr tag));
|
|
75
|
+
let out = V.vmap () in
|
|
76
|
+
V.set out "name" (V.vstr name);
|
|
77
|
+
V.set out "tag" (V.vstr tag);
|
|
78
|
+
out
|
|
79
|
+
|
|
80
|
+
(* An empty tag NEVER writes the separator, which is the half of
|
|
81
|
+
canonicalization formatref owns: parse tolerates `stripe$`, format
|
|
82
|
+
never produces it, so a round trip is idempotent. *)
|
|
83
|
+
let formatref name tag =
|
|
84
|
+
let tagok = V.is_null tag || V.is_str tag in
|
|
85
|
+
let t = if V.is_str tag then V.as_str tag else "" in
|
|
86
|
+
if not (checkname name) then
|
|
87
|
+
Types.fail "plugin_bad_name"
|
|
88
|
+
("invalid plugin name: " ^ (if V.is_str name then V.as_str name else ""))
|
|
89
|
+
~details:
|
|
90
|
+
(Types.details1 "name" (if V.is_null name then V.vnull else name));
|
|
91
|
+
if (not tagok) || not (tagly t) then
|
|
92
|
+
Types.fail "plugin_bad_tag"
|
|
93
|
+
("invalid plugin tag: " ^ t)
|
|
94
|
+
~details:
|
|
95
|
+
(Types.details2 "name" name "tag"
|
|
96
|
+
(if V.is_null tag then V.vstr "" else tag));
|
|
97
|
+
if "" = t then V.as_str name else V.as_str name ^ "$" ^ t
|
|
98
|
+
|
|
99
|
+
let canonref str =
|
|
100
|
+
let r = parseref str in
|
|
101
|
+
formatref (V.get r "name") (V.get r "tag")
|
|
102
|
+
|
|
103
|
+
let canonrefs str = canonref (V.vstr str)
|
|
104
|
+
|
|
105
|
+
(* The canonical ref this string denotes, or None if it denotes none —
|
|
106
|
+
the TOLERANT half of `canonref`, and the one a requirement name
|
|
107
|
+
needs (§11.1). Capability names are free-form, so `2fa` is a good one
|
|
108
|
+
and no ref could be called that; `canonref` RAISES on those, and
|
|
109
|
+
asking it "is this a ref?" made a legal document kill the host.
|
|
110
|
+
|
|
111
|
+
An `option`, so a caller cannot mistake "not a ref" for "the empty
|
|
112
|
+
ref". *)
|
|
113
|
+
let tryref str =
|
|
114
|
+
let name, tag = split str in
|
|
115
|
+
if (not (namely name)) || not (tagly tag) then None
|
|
116
|
+
else Some (if "" = tag then name else name ^ "$" ^ tag)
|
|
117
|
+
|
|
118
|
+
(* `canonref` for internal callers that want the input back unchanged
|
|
119
|
+
when it is not well formed. NEVER use where a bad ref must be
|
|
120
|
+
reported — the corpus pins plugin_bad_name at every public entry. *)
|
|
121
|
+
let canon str = match tryref str with Some r -> r | None -> str
|
|
122
|
+
|
|
123
|
+
(* The name half, for internal callers that only compare. *)
|
|
124
|
+
let refname str =
|
|
125
|
+
let name, _ = split str in
|
|
126
|
+
if namely name then name else str
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
(* VENDORED: @voxgig/plugin sdk-20260908-1556-0 (ocaml/src/resolve.ml) *)
|
|
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 (§10.2) — name to candidate module ids.
|
|
5
|
+
|
|
6
|
+
PURE. It returns the ids a host WOULD try, in order; it does not
|
|
7
|
+
load anything. That separation is what lets the corpus pin
|
|
8
|
+
resolution in every language including those with no dynamic loading
|
|
9
|
+
at all — ocaml among them — and it is why §15.4 puts real module
|
|
10
|
+
loading in per-port integration tests rather than here. *)
|
|
11
|
+
|
|
12
|
+
module V = Value
|
|
13
|
+
|
|
14
|
+
let pushuniq out id =
|
|
15
|
+
if not (List.exists (fun v -> V.as_str v = id) (V.items out)) then
|
|
16
|
+
V.push out (V.vstr id)
|
|
17
|
+
|
|
18
|
+
let default_prefix = [ "@voxgig/plugin-"; "voxgig-plugin-"; "plugin-"; "" ]
|
|
19
|
+
|
|
20
|
+
let resolvecandidates name sources =
|
|
21
|
+
let out = V.vlist () in
|
|
22
|
+
let n = if V.is_str name then V.as_str name else "" in
|
|
23
|
+
(* A SCOPED NAME RESOLVES VERBATIM ONLY (§10.2). `@acme/thing` is
|
|
24
|
+
already a package id; prefixing it produces
|
|
25
|
+
`@voxgig/plugin-@acme/thing`, which is not a thing that can
|
|
26
|
+
exist. *)
|
|
27
|
+
if 0 < String.length n && '@' = n.[0] then (V.push out (V.vstr n); out)
|
|
28
|
+
else if not (V.is_list sources && 0 < V.len sources) then begin
|
|
29
|
+
List.iter (fun p -> pushuniq out (p ^ n)) default_prefix;
|
|
30
|
+
out
|
|
31
|
+
end
|
|
32
|
+
else begin
|
|
33
|
+
List.iter
|
|
34
|
+
(fun src ->
|
|
35
|
+
let kind = V.as_str (V.get src "kind") in
|
|
36
|
+
if "module" = kind then begin
|
|
37
|
+
let prefix = V.get src "prefix" in
|
|
38
|
+
if V.is_list prefix && 0 < V.len prefix then
|
|
39
|
+
List.iter (fun p -> pushuniq out (V.as_str p ^ n)) (V.items prefix)
|
|
40
|
+
else pushuniq out n
|
|
41
|
+
end
|
|
42
|
+
else if "path" = kind then begin
|
|
43
|
+
let dir = V.as_str (V.get src "dir") in
|
|
44
|
+
(* Trailing slashes are trimmed, so `lib/` and `lib` give one
|
|
45
|
+
id rather than two spellings of it. *)
|
|
46
|
+
let e = ref (String.length dir) in
|
|
47
|
+
while 0 < !e && '/' = dir.[!e - 1] do decr e done;
|
|
48
|
+
pushuniq out (String.sub dir 0 !e ^ "/" ^ n)
|
|
49
|
+
end)
|
|
50
|
+
(V.items sources);
|
|
51
|
+
out
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
(* A MODULE PATH IS NOT A NAME (§10.2). The ref grammar starts a name
|
|
55
|
+
with a letter or `@`, so `./local/thing` is not a ref and never
|
|
56
|
+
reaches candidate generation — seneca allows a path where a plugin
|
|
57
|
+
name goes, and this design deliberately does not, because a ref is
|
|
58
|
+
an ADDRESS WITHIN A HOST and a path is a LOCATION ON A DISK.
|
|
59
|
+
|
|
60
|
+
Loading from an explicit location bypasses candidate generation
|
|
61
|
+
entirely: `from` is passed to the resolver verbatim. *)
|
|
62
|
+
let resolvefrom from = V.oflist [ (if V.is_null from then V.vnull else from) ]
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
(* VENDORED: @voxgig/plugin sdk-20260908-1556-0 (ocaml/src/types.ml) *)
|
|
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
|
+
(* Errors, and the raise mechanism (§12).
|
|
5
|
+
|
|
6
|
+
A REAL EXCEPTION. The canonical raises: a failing call abandons the
|
|
7
|
+
rest of the function, and the corpus is full of entries that assert
|
|
8
|
+
exactly what survived a raise mid-sequence (`resource/unwind`,
|
|
9
|
+
`lifecycle/fail`). OCaml has exceptions, so the port uses them —
|
|
10
|
+
unlike `c`, which has to build the same semantics out of
|
|
11
|
+
`setjmp`/`longjmp` and an arena.
|
|
12
|
+
|
|
13
|
+
Ports compare by CODE and never by message: wording is a port's own
|
|
14
|
+
business. The FORMAT is pinned, because a parseable message is what
|
|
15
|
+
makes a log searchable across twenty languages. *)
|
|
16
|
+
|
|
17
|
+
module V = Value
|
|
18
|
+
|
|
19
|
+
type error = {
|
|
20
|
+
code : string;
|
|
21
|
+
text : string;
|
|
22
|
+
details : V.t;
|
|
23
|
+
message : string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exception Plugin_error of error
|
|
27
|
+
|
|
28
|
+
(* §12's detail fields, IN THIS FIXED ORDER. The order is part of the
|
|
29
|
+
contract: an earlier draft named six fields while other sections
|
|
30
|
+
promised diagnostics with nowhere to go, which would have left each
|
|
31
|
+
port inventing its own order and breaking message parity. *)
|
|
32
|
+
let detail_order =
|
|
33
|
+
[ "host"; "ref"; "name"; "tag"; "point"; "key"; "capability";
|
|
34
|
+
"range"; "version"; "match"; "candidates"; "cycle"; "holders";
|
|
35
|
+
"refs"; "path"; "cause" ]
|
|
36
|
+
|
|
37
|
+
let formaterror code text details =
|
|
38
|
+
(* Values render as COMPACT JSON, so a value containing a space or a
|
|
39
|
+
bracket cannot break the parse and a list renders as an array. The
|
|
40
|
+
bracket is absent entirely when no field applies. *)
|
|
41
|
+
let parts =
|
|
42
|
+
List.filter_map
|
|
43
|
+
(fun k ->
|
|
44
|
+
if V.has details k then Some (k ^ "=" ^ V.json (V.get details k))
|
|
45
|
+
else None)
|
|
46
|
+
detail_order
|
|
47
|
+
in
|
|
48
|
+
let head = "plugin/" ^ code ^ ": " ^ text in
|
|
49
|
+
match parts with
|
|
50
|
+
| [] -> head
|
|
51
|
+
| _ -> head ^ " [" ^ String.concat " " parts ^ "]"
|
|
52
|
+
|
|
53
|
+
let fail ?details code text =
|
|
54
|
+
let details = match details with Some d -> d | None -> V.vmap () in
|
|
55
|
+
raise
|
|
56
|
+
(Plugin_error
|
|
57
|
+
{ code; text; details; message = formaterror code text details })
|
|
58
|
+
|
|
59
|
+
let details1 k v =
|
|
60
|
+
let d = V.vmap () in
|
|
61
|
+
V.set d k v;
|
|
62
|
+
d
|
|
63
|
+
|
|
64
|
+
let details2 k1 v1 k2 v2 =
|
|
65
|
+
let d = V.vmap () in
|
|
66
|
+
V.set d k1 v1;
|
|
67
|
+
V.set d k2 v2;
|
|
68
|
+
d
|
|
69
|
+
|
|
70
|
+
(* Deep merge, struct's semantics: maps merge, everything else
|
|
71
|
+
replaces. §16 permits voxgig/struct for this and OCaml has no port
|
|
72
|
+
of it. *)
|
|
73
|
+
let rec mergevalue a b =
|
|
74
|
+
if not (V.is_map a && V.is_map b) then b
|
|
75
|
+
else begin
|
|
76
|
+
let out = V.vmap () in
|
|
77
|
+
List.iter (fun k -> V.set out k (V.get a k)) (V.keys a);
|
|
78
|
+
List.iter
|
|
79
|
+
(fun k ->
|
|
80
|
+
let bv = V.get b k in
|
|
81
|
+
let av = V.get out k in
|
|
82
|
+
if V.is_map av && V.is_map bv then V.set out k (mergevalue av bv)
|
|
83
|
+
else V.set out k bv)
|
|
84
|
+
(V.keys b);
|
|
85
|
+
out
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
(* §11.1's partial match: every leaf in `want` must be present and
|
|
89
|
+
equal in `have`; keys not mentioned are not checked. *)
|
|
90
|
+
let rec matchvalue want have =
|
|
91
|
+
if V.is_null want then true
|
|
92
|
+
else if V.is_map want then
|
|
93
|
+
V.is_map have
|
|
94
|
+
&& List.for_all
|
|
95
|
+
(fun k -> V.has have k && matchvalue (V.get want k) (V.get have k))
|
|
96
|
+
(V.keys want)
|
|
97
|
+
else V.same want have
|