Documentation Index
Fetch the complete documentation index at: https://docs.ixo.world/llms.txt
Use this file to discover all available pages before exploring further.
getSharedState() returns a flat map of key → (state, runCtx) => value. Consumers read those values on ctx.shared.<key>.
Keep the value somewhere the plugin owns
Shared state is read-only by design. The owner plugin writes; consumers only read. A per-session Canonical source: weather.plugin.ts.
Map is the simplest store.Expose it via getSharedState()
Each entry is a function See
(state, runCtx) => unknown. The key becomes the field on ctx.shared. Keep accessors cheap — they’re called every time a consumer reads.getSharedState in weather.plugin.ts.Consume it from another plugin via ctx.shared
Any tool handler can read Pair shared state with
rtCtx.shared.<key>. Treat the value as possibly undefined because the producing plugin may not be loaded.softDependsOn so the dependency is explicit and discoverable.What to know before shipping
- The key namespace is flat. Two plugins registering the same key fail boot. Rename one.
- Accessors run on every read — memoise expensive computations inside the producer (e.g. by
session.id). - Shared state cannot be mutated by the consumer. To update the value, mutate via the owner’s tool or middleware.
- A consumer that runs without the producer loaded gets
undefined. Guard withif (lastQuery)orctx.availablePlugins.has('weather'). - Don’t expose large blobs. Either compute lazily in the accessor or split into smaller derived keys.
Where to read next
Declare dependencies
Pair shared state with
softDependsOn.RuntimeContext reference
The
ctx.shared field on every tool handler.