Nao.Runtime.Orleans.Grains Namespace
| Type/Module | Description |
|
Built-in executor for "agent" tasks: drives a dedicated sub-session conversation. The sub-session is a real `ISessionGrain` (key = the task's "userId/sessionId/taskId"), so it gets the full harness, transcript, and history machinery. It inherits the parent session's workspace, tools, and runtime, and is marked `Kind = "task"` so it runs the (otherwise async) agent inline instead of recursively spawning another task. |
|
|
A named conversation context within a session |
|
|
Render recent conversation transcript for a spawned async agent. An async agent runs in a brand-new sub-session that shares none of the parent conversation's history, so without this a follow-up like "convert it to html" arrives with no idea what "it" is. We surface the recent turns (and any attachment names, which are usually the subject of the follow-up) so the agent can resolve the reference. |
|
|
Mapping between Orleans serializable records and domain types |
|
|
Per-user session directory. Grain key = userId. Tracks which sessions exist so they can be enumerated after restart. |
|
|
Orleans grain interface for a user session. Grain key format: "userId/sessionId" The grain resolves agents/tools from the workspace registry. |
|
|
Grain that owns and runs a single async task. Key = "userId/sessionId/taskId" — the same string key as the sub-session `SessionGrain` it may drive (a different grain type). |
|
|
Pluggable executor for one task `Kind`. Implementations are registered in DI and selected by kind. Work is kept behind a serializable params bag (not an in-process closure) so a task can be replayed by its grain after a silo restart. |
|
|
Serializable record for a memory entry |
|
|
Serializable record for a conversation message |
|
|
A resource-access grant the user approved for the lifetime of this session. Stored in the session grain's own state (Orleans-persisted) so each session tracks its own permissions and never re-prompts for something it already approved. |
|
|
A lightweight entry tracking a session in the directory |
|
|
Per-user session directory grain implementation |
|
|
Persistent state for the session directory grain |
|
|
|
|
|
Self-contained session grain. Resolves workspaces from IWorkspaceRegistry, manages multiple conversation contexts and memory through Orleans persistence. Dependencies (injected via Orleans DI at silo startup): - IWorkspaceRegistry: multi-tenant workspace registry (multiple workspaces per silo) - ILlmProvider: the LLM backend used to power agents On each ProcessAsync call: 1. Resolves the workspace from registry by stored key 2. Finds the agent definition + tools from that workspace 3. Builds a fresh agent instance (no prior state) 4. Runs the agent through the full ETCLOVG harness (governance, verification, etc.) 5. Persists the updated conversation in the active context |
|
|
Persistent state for a session grain |
|
|
Metadata about a session |
|
|
Options for starting or reconfiguring a session |
|
Grain that owns and runs a single async task. Key = "userId/sessionId/taskId".
Lifecycle:
1. `StartAsync` persists the spec, marks the task running, and fire-and-forget
dispatches `RunAsync` on this same grain (so the caller is never blocked).
2. `RunAsync` resolves an `ITaskExecutor` by kind and runs the work, pushing progress
and the terminal status back to the parent session grain.
3. On activation, an interrupted (`running`/`pending`) task is re-dispatched to resume.
The work is kept behind a serializable params bag (`ParamsJson`) rather than an
in-process closure, which is what makes resume-after-restart possible.
|
|
|
Persistent state for a single async task grain. |
|
|
Context handed to a task executor. These run in-process on the silo, so this type is not Orleans-serialized. `Report progress message` pushes progress (0..1) updates. |
|
|
Outcome returned by a task executor. |
|
|
Lightweight snapshot of an async task, tracked in the parent session's grain state and returned to clients. The authoritative copy lives in the owning `ISessionTaskGrain`. |
|
|
Arguments to start a task on its grain. |
|
|
Built-in executor for "tool" tasks: runs an asynchronous executable tool in the background. An async executable tool (declared `is_async`) returns a tracking token immediately when invoked inside a harness; the real work runs here on the task's own grain. The tool is resolved from the parent session's workspace and executed inline (the inline builder ignores the async flag) so it does not recursively spawn another task. |
Nao