# WasmMentorStateService class

> The WasmMentorStateService class of Novior.MentorAgent.Blazor.Services: WASM implementation of IMentorStateService. Subscribes to the SignalR hub callbacks…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentorstateservice
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Blazor

WASM implementation of [`IMentorStateService`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentorstateservice). Subscribes to the SignalR hub callbacks from [`MentorHubClient`](https://docs.mentoragent.net/api/novior-mentoragent-blazor-hub/mentorhubclient) and raises the corresponding events so [`ChatWidget`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-components/chatwidget) works identically to Blazor Server.

## Definition

Namespace: `Novior.MentorAgent.Blazor.Services`. Package: `Novior.MentorAgent.Blazor`.

`public sealed class WasmMentorStateService : IAsyncDisposable, IMentorStateService`

Implements [`IMentorStateService`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentorstateservice).

```shell
dotnet add package Novior.MentorAgent.Blazor
```

## Constructors

`public WasmMentorStateService(MentorHubClient hub, WasmMentorPageContext pageContext, ILogger<WasmMentorStateService> logger, HttpClient http, MentorAgentBlazorOptions? options = null)`

## Methods

### `Cancel`

`public void Cancel(Guid actionId)`

### `ConfirmAsync`

`public Task ConfirmAsync(Guid actionId)`

### `DisposeAsync`

`public ValueTask DisposeAsync()`

### `NotifyActionCompleted`

`public void NotifyActionCompleted(string toolName)`

### `NotifyActionExecuting`

`public void NotifyActionExecuting(string toolName, string? displayName = null)`

### `NotifyActionFailed`

`public void NotifyActionFailed(string toolName, string error)`

### `NotifyBusyChanged`

`public void NotifyBusyChanged(bool isBusy)`

### `NotifyCardsReady`

`public void NotifyCardsReady(IReadOnlyList<MentorCard> cards)`

### `NotifyConfirmationRequired`

`public void NotifyConfirmationRequired(ConfirmationRequest req)`

### `NotifyError`

`public void NotifyError(string message)`

### `NotifyGeneratedImages`

`public void NotifyGeneratedImages(IReadOnlyList<string> imageSources)`

### `NotifyHostedToolsDeclared`

`public void NotifyHostedToolsDeclared(MentorHostedTools tools)`

### `NotifyMcpServerStatusChanged`

`public void NotifyMcpServerStatusChanged(string name, bool connected)`

### `NotifyNavigationRequested`

`public void NotifyNavigationRequested(string url)`

### `NotifyRagSourcesReady`

`public void NotifyRagSourcesReady(IReadOnlyList<MentorRagResult> sources)`

### `NotifyStreamingChunk`

`public void NotifyStreamingChunk(string chunk)`

### `NotifyStreamingCompleted`

`public void NotifyStreamingCompleted()`

### `NotifyTeamMemberSpeaking`

`public void NotifyTeamMemberSpeaking(string team, string member)`

### `NotifyUIActionCompleted`

`public void NotifyUIActionCompleted(string actionName)`

### `NotifyUIActionExecuting`

`public void NotifyUIActionExecuting(string actionName)`

## Events

### `OnActionCompleted`

`public event Action<string>? OnActionCompleted`

### `OnActionExecuting`

`public event Action<string>? OnActionExecuting`

### `OnActionFailed`

`public event Action<string>? OnActionFailed`

### `OnApprovalResponse`

`public event Action<ConfirmationRequest, bool>? OnApprovalResponse`

### `OnBusyChanged`

`public event Action<bool>? OnBusyChanged`

### `OnCardsReady`

`public event Action<IReadOnlyList<MentorCard>>? OnCardsReady`

### `OnConfirmationRequired`

`public event Action<ConfirmationRequest>? OnConfirmationRequired`

### `OnError`

`public event Action<string>? OnError`

### `OnGeneratedImages`

`public event Action<IReadOnlyList<string>>? OnGeneratedImages`

### `OnHostedToolsDeclared`

`public event Action<MentorHostedTools>? OnHostedToolsDeclared`

### `OnMcpServerStatusChanged`

`public event Action<string, bool>? OnMcpServerStatusChanged`

### `OnNavigationRequested`

`public event Action<string>? OnNavigationRequested`

### `OnRagSourcesReady`

`public event Action<IReadOnlyList<MentorRagResult>>? OnRagSourcesReady`

### `OnStreamingChunk`

`public event Action<string>? OnStreamingChunk`

### `OnStreamingCompleted`

`public event Action? OnStreamingCompleted`

### `OnTeamMemberSpeaking`

`public event Action<string, string>? OnTeamMemberSpeaking`

### `OnUIActionCompleted`

`public event Action<string>? OnUIActionCompleted`

### `OnUIActionExecuting`

`public event Action<string>? OnUIActionExecuting`

---

- Previous: [WasmMentorPageContext class](https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentorpagecontext.md)
- Next: [MentorDeclarativeOptions class](https://docs.mentoragent.net/api/novior-mentoragent-declarative/mentordeclarativeoptions.md)
