Alpha Gather context from all registered providers.
Calls getContext() on each provider and collects the results.
Providers that return null (indicating no context available) and
providers that throw errors are skipped (errors log a warning).
Each contribution is enriched with the component's LimeWebComponentContext
if the provider was registered with an element reference.
An array of enriched context contributions, one from each provider that returned a non-null contribution.
Get all registered providers.
Useful for debugging or introspection.
Array of all registered providers.
Register a context provider.
The provider will be called when context is gathered via gatherContext().
Multiple providers with the same contextType can coexist - each registration
gets a unique internal key.
A function to unregister the provider. Call this when the component is disconnected or the context is no longer relevant.
const unregister = registry.register({
contextType: 'deal-card',
getContext: () => ({
purpose: 'Shows full details of a deal record. ' +
'Users can edit fields and manage related records.',
data: {
limetype: 'deal',
id: this.dealId,
descriptive: this.deal.descriptive
}
})
}, this.host);
// Later, when component is disconnected:
unregister();
The provider to register.
Optional element: HTMLElement & LimeWebComponentOptional host element of the component registering this provider. When provided, enables the registry to:
LimeWebComponentContext to enrich contributionsRegister a context provider.
The provider will be called when context is gathered via gatherContext().
Multiple providers with the same contextType can coexist - each registration
gets a unique internal key.
A function to unregister the provider. Call this when the component is disconnected or the context is no longer relevant.
const unregister = registry.register({
contextType: 'deal-card',
getContext: () => ({
purpose: 'Shows full details of a deal record. ' +
'Users can edit fields and manage related records.',
data: {
limetype: 'deal',
id: this.dealId,
descriptive: this.deal.descriptive
}
})
}, this.host);
// Later, when component is disconnected:
unregister();
Registry for AI context providers.
The AIContextRegistry manages context providers that contribute information to the AI chat. Components register providers to share their state, and the AI chat gathers context from all providers when needed.
Example
Gathering context for an AI request
See