Expand description
Converts a DataContext into the immutable rhai Map a plugin’s
render(ctx) receives.
Shape lives in docs/specs/plugin-api.md §ctx shape exposed to rhai.
Highlights: enum variants render as snake_case kind tags,
Option<T> becomes rhai (), lazy Arc<Result<T, E>> sources
become #{ kind: "ok", data: ... } | #{ kind: "error", error: ... }
tagged maps, and ctx.git’s nested Option collapses Ok(None)
to #{ kind: "ok", data: () }.
Declared-dep gating: ctx.settings|claude_json|usage|sessions|git
only appear when the plugin’s @data_deps header declared them.
Undeclared accessors return () on the rhai side (not an error).
Functions§
- build_
ctx - Build the
ctxvalue a plugin’srender(ctx)function sees.