Skip to main content

Module transient_source

Module transient_source 

Source
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), the picker-context precedent. 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 CommandRegistry here. A CommandId is host-issued and a plugin must not be able to forge one — the same rule the register_* 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 TransientContext into 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 build on the plugin’s own actor task and converts the result.