pub async fn instantiate_component(
engine: &Engine,
component: &Component,
linker: &Linker<HostState>,
preopens: &[Preopen],
grant_policy: &GrantPolicy,
info: &ComponentInfo,
max_memory: Option<usize>,
prompter: Arc<dyn ConsentPrompter>,
cache: Arc<DecisionCache>,
credentials: Option<Arc<CredentialHost>>,
audit: &AuditContext,
) -> Result<(ToolProvider, Option<SessionProvider>, Store<HostState>)>Expand description
Instantiate the component. Returns the tool-provider guest, an optional
SessionProvider (present iff the component exports
act:sessions/session-provider), and the store.
act-world declares both tool-provider and session-provider as
exports, but the latter is opt-in. Rather than ActWorldIndices::new
(which requires every declared export and would reject stateless
components), each interface is bound through its own per-interface
GuestIndices: tool-provider is mandatory, session-provider is looked up
with .ok() so its absence yields None.
Component info is read from custom sections (no instantiation needed for that).