[package]
name = "diaryx_plugin_sdk"
version = "0.3.4"
edition = "2024"
rust-version = "1.91"
description = "SDK for building Diaryx Extism WASM plugins"
license = "MIT"
repository = "https://github.com/diaryx-org/plugin-sdk"
publish = true

[lib]
crate-type = ["rlib"]

[features]
default = ["core"]

# Core host functions: file I/O, storage, logging, timestamps.
# Always needed — this is the baseline for any plugin.
core = []

# HTTP request support (requires `http` permission).
http = []

# Secret store for credentials (requires `secrets` permission).
secrets = []

# WebSocket bridge for real-time communication (requires `ws` permission).
ws = []

# Event emission to the host application.
events = []

# Inter-plugin command execution (requires `plugin_command` permission).
plugins = []

# Runtime context from the host.
context = []

# WASI module execution inside the plugin sandbox.
wasi = []

# User-provided file requests.
files = []

# Namespace object operations (upload, delete, list, sync audience).
namespaces = []

# Server proxy requests (AI, external APIs via managed credentials).
proxy = ["http"]

# Custom getrandom implementation for WASM plugins.
getrandom-shim = ["dep:getrandom_03"]

# Enable all features.
full = ["core", "http", "secrets", "ws", "events", "plugins", "context", "wasi", "files", "namespaces", "proxy", "getrandom-shim"]

[dependencies]
extism-pdk = "1.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
base64 = "0.22"

getrandom_03 = { package = "getrandom", version = "0.3", optional = true, default-features = false }

[profile.release]
lto = "fat"
codegen-units = 1
