blob: ac95375e6c596c224b4816470964e567e3987a02 [file] [log] [blame]
syntax = "proto3";
package bufman.dubbo.apache.org.wasmplugin.v1;
// ExecConfig describes buf specific extensions for a wasm plugin. A ExecConfig may
// be encoded in a custom WASM section named ".bufplugin", see
// (https://webassembly.github.io/spec/core/binary/modules.html#binary-customsec)
// for more info.
message ExecConfig {
// When no ABI is provided, buf will make a best effort guess based on
// the functions the wasm module exports.
WasmABI wasm_abi = 1;
// The arguments that should be passed when running this plugin. Useful
// for interpreted languages where the main wasm bundle is only the
// interpreter.
repeated string args = 2;
// Files that should be made available to the WASI fs when running this
// plugin. Useful for interpreted languages where the main wasm bundle
// is only the interpreter.
repeated File files = 3;
}
// WASM_ABI specifies the abi this module expects buf to provide.
enum WasmABI {
WASM_ABI_UNSPECIFIED = 0;
// Plugins compiled against
// https://github.com/WebAssembly/WASI/releases/tag/snapshot-01.
WASM_ABI_WASI_SNAPSHOT_PREVIEW1 = 1;
// Plugins compiled with `GOOS=js` and `GOARCH=wasm`.
WASM_ABI_GOJS = 2;
}
// File represents a file that must be made available to the wasi plugin.
message File {
// Normalized path with `/` as directory separator.
string path = 1;
bytes contents = 2;
}