| 109 | } |
| 110 | |
| 111 | func newPrototypePluginManager() (*prototypePluginManager, error) { |
| 112 | |
| 113 | cc, err := wazero.NewCompilationCacheWithDir(helmpath.CachePath("wazero-build")) |
| 114 | if err != nil { |
| 115 | return nil, fmt.Errorf("failed to create wazero compilation cache: %w", err) |
| 116 | } |
| 117 | |
| 118 | return &prototypePluginManager{ |
| 119 | runtimes: map[string]Runtime{ |
| 120 | "subprocess": &RuntimeSubprocess{}, |
| 121 | "extism/v1": &RuntimeExtismV1{ |
| 122 | HostFunctions: map[string]extism.HostFunction{}, |
| 123 | CompilationCache: cc, |
| 124 | }, |
| 125 | }, |
| 126 | }, nil |
| 127 | } |
| 128 | |
| 129 | func (pm *prototypePluginManager) RegisterRuntime(runtimeName string, runtime Runtime) { |
| 130 | pm.runtimes[runtimeName] = runtime |