Expand description
TR.2b — the WasmTransientSource adapter (boundary + registry builder).
Turns a transient plugin’s TransientClient bridge into the closure the
TransientSourceRegistry stores.
Everything about the guest ends here: the registry sees a
Fn(&TransientContext) -> TransientBuildFuture and cannot tell a plugin
menu from a native one.
Three things happen at the boundary, and each is a decision:
- The context projects host→guest only (
project_transient_context), thepicker-contextprecedent. A builder reads where the menu was opened from; it never sends one back. - A row’s command crosses as a NAME, resolved against the
CommandRegistryhere. ACommandIdis host-issued and a plugin must not be able to forge one — the same rule theregister_*seams follow. - An unresolvable name drops that row, with a
debug!, and the rest of the menu survives. A plugin whose sixth row references a command it failed to register should still get the other five; refusing the whole menu makes one bad row cost the feature.
Design: docs/dev/architecture/plugin-transients.md §5–6.
Functions§
- project_
transient_ context - Project a live
TransientContextinto its owned WIT mirror. Host→guest only. - spec_
from_ wit - Convert a guest-built spec into the native one, resolving each action row’s
command name against
registry. - transient_
builder - The registry builder for a transient plugin: projects the open context
synchronously, then awaits the guest’s
buildon the plugin’s own actor task and converts the result.