Co-authored-by: Danny Kim <temeddix@gmail.com> Co-committed-by: Danny Kim <temeddix@gmail.com>
Memona WebDAV plugin
Opens a WebDAV server as a folder inside Memona, so agents and the file manager work in it like any local directory. The plugin is a WASI component: it speaks no sockets of its own and makes every request through the host's HTTP interface, under the connection's permissions.
It registers one provider, webdav, for the webdav and davs schemes.
This package requires a Memona version that supports plugin manifest schema 2.
Connecting
| Field | Meaning |
|---|---|
| Server address | The folder's address, for example https://dav.example.com/files/ |
| Username | Optional account name for HTTP basic authentication |
| Password | Optional password, stored as a secret |
With the compatible schema 2 Memona version required above, public, LAN, VPN, link-local and localhost addresses work directly from the server address; that API has no separate connection network grant.
Listing, reading, writing, creating directories, renaming and deleting are
supported. Reads and writes stream in pieces of at most 1 MiB, so a file of any
size moves without either side holding it whole. Conditional writes use
If-Match and If-None-Match, which servers that return etags honour. Change
polling is not supported, a rename never replaces an existing target, and
deleting takes one file or an empty directory: a folder with contents is
refused rather than removed whole.
Building
rustup target add wasm32-wasip2
cargo build --locked --release --target wasm32-wasip2
The component lands at
target/wasm32-wasip2/release/memona_plugin_webdav.wasm.
wit/filesystem.wit is a copy of the canonical Memona filesystem contract, and
src/sdk.rs generates the guest bindings from it, so this repository builds
without a Memona checkout. Refresh the copy from plugin_system/sdk/wit in the
Memona repository when the contract
moves, and keep apiVersion in manifest.json in step.
Packaging for the plugin store
A .memona-plugin package is a ZIP archive with the files at its root, never
inside a directory:
cargo build --locked --release --target wasm32-wasip2
cp target/wasm32-wasip2/release/memona_plugin_webdav.wasm plugin.wasm
zip memona-plugin-webdav.memona-plugin \
manifest.json plugin.wasm README.md LICENSE
manifest.json and plugin.wasm are required; README.md becomes the guide on
the plugin's public page and LICENSE is shown beside it.