Header menu logo Nao

ISessionGrain Type

Orleans grain interface for a user session. Grain key format: "userId/sessionId" The grain resolves agents/tools from the workspace registry.

Instance members

Instance member Description

this.ClearHistoryAsync

Full Usage: this.ClearHistoryAsync

Returns: Task
Modifiers: abstract

Clear the current conversation context

Returns: Task

this.ClearMemoriesAsync

Full Usage: this.ClearMemoriesAsync

Returns: Task
Modifiers: abstract

Clear all memories

Returns: Task

this.DestroyAsync

Full Usage: this.DestroyAsync

Returns: Task
Modifiers: abstract

Permanently destroy the session and all its data

Returns: Task

this.GetHistoryAsync

Full Usage: this.GetHistoryAsync

Returns: Task<MessageRecord array>
Modifiers: abstract

Get the current conversation history

Returns: Task<MessageRecord array>

this.GetInfoAsync

Full Usage: this.GetInfoAsync

Returns: Task<SessionInfo>
Modifiers: abstract

Get the session metadata

Returns: Task<SessionInfo>

this.GetLastTurnIdAsync

Full Usage: this.GetLastTurnIdAsync

Returns: Task<string>
Modifiers: abstract

Id of the most recently processed turn (empty if none). Use to attach feedback.

Returns: Task<string>

this.GetLiveStepsAsync

Full Usage: this.GetLiveStepsAsync

Returns: Task<TurnStepRecord[]>
Modifiers: abstract

Snapshot of the steps of the turn currently being processed, for live progress UIs. Returns an empty array when no turn is running. Marked reentrant (`AlwaysInterleave`) so it can be polled while a turn is still in flight.

Returns: Task<TurnStepRecord[]>

this.ListConversationsAsync

Full Usage: this.ListConversationsAsync

Returns: Task<string array>
Modifiers: abstract

List all conversation contexts in this session

Returns: Task<string array>

this.ListTasksAsync

Full Usage: this.ListTasksAsync

Returns: Task<TaskRef array>
Modifiers: abstract

List all async tasks tracked by this session (newest first). Reentrant so a live UI can poll it while a turn is still running.

Returns: Task<TaskRef array>

this.PauseAsync

Full Usage: this.PauseAsync

Returns: Task
Modifiers: abstract

Pause the session (marks inactive, keeps state)

Returns: Task

this.ProcessAsync

Full Usage: this.ProcessAsync

Parameters:
    input : string

Returns: Task<string>
Modifiers: abstract

Process user input — grain resolves workspace, builds agent, runs ETCLOVG harness.

input : string
Returns: Task<string>

this.ProcessWithContextAsync

Full Usage: this.ProcessWithContextAsync

Parameters:
    llmInput : string
    displayText : string
    attachmentNames : string[]

Returns: Task<string>
Modifiers: abstract

Process user input where the LLM prompt and the persisted/display text differ: `llmInput` (with embedded attachment content) is what the agent sees, while only `displayText` plus `attachmentNames` are stored in the transcript.

llmInput : string
displayText : string
attachmentNames : string[]
Returns: Task<string>

this.RecallMemoryAsync

Full Usage: this.RecallMemoryAsync

Parameters:
    key : string

Returns: Task<MemoryEntry array>
Modifiers: abstract

Recall memories by key prefix

key : string
Returns: Task<MemoryEntry array>

this.ResumeAsync

Full Usage: this.ResumeAsync

Returns: Task
Modifiers: abstract

Resume a paused session

Returns: Task

this.SaveMemoryAsync

Full Usage: this.SaveMemoryAsync

Parameters:
    key : string
    value : string

Returns: Task
Modifiers: abstract

Save a key-value memory entry within this session

key : string
value : string
Returns: Task

this.StartAsync

Full Usage: this.StartAsync

Parameters:
Returns: Task<bool>
Modifiers: abstract

Initialize the session with a specific agent, workspace, and optional tool overrides.

options : SessionStartOptions
Returns: Task<bool>

this.SubmitFeedbackAsync

Full Usage: this.SubmitFeedbackAsync

Parameters:
    sentiment : string
    comment : string

Returns: Task<string array>
Modifiers: abstract

Submit feedback for the most recently processed turn. `sentiment` is "positive" / "negative" / "neutral". Returns the rationales of any tool adjustments that were proposed and stored.

sentiment : string
comment : string
Returns: Task<string array>

this.SwitchAgentAsync

Full Usage: this.SwitchAgentAsync

Parameters:
    agentName : string

Returns: Task<bool>
Modifiers: abstract

Switch to a different agent within the current workspace

agentName : string
Returns: Task<bool>

this.SwitchConversationAsync

Full Usage: this.SwitchConversationAsync

Parameters:
    conversationName : string

Returns: Task
Modifiers: abstract

Create or switch to a named conversation context

conversationName : string
Returns: Task

this.SwitchWorkspaceAsync

Full Usage: this.SwitchWorkspaceAsync

Parameters:
    workspaceKey : string

Returns: Task<bool>
Modifiers: abstract

Switch to a different workspace (re-validates agent exists in new workspace)

workspaceKey : string
Returns: Task<bool>

this.UpdateTaskStatusAsync

Full Usage: this.UpdateTaskStatusAsync

Parameters:
Returns: Task
Modifiers: abstract

Upsert an async-task snapshot into this session's tracked task list. Called by the owning task grain on each status transition (push model).

task : TaskRef
Returns: Task

Type something to start searching.