Configures SignalR for CrestApps.Core 2.0 with tenant path prefixes, store-committer hub filters, global hub defaults (camelCase JSON, 8 parallel invocations, 64 stream buffer), per-hub chat options, HubRouteManager for path/URL generation, authorization for AIChatHubCore and ChatInteractionHubBase, access tokens, and Redis/Azure SignalR scale-out.
Ships in crestapps-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The CrestApps.Core.SignalR package registers SignalR with CrestApps defaults and a HubRouteManager that builds hub paths and absolute URLs (with an optional tenant prefix). The chat hubs themselves (AIChatHubCore<TClient>, ChatInteractionHubBase) live in CrestApps.Core.AI.Chat; see crestapps-core-chat-interactions.
Through the AI suite builder, optionally with the store-committer hub filter so staged store writes are committed after each hub invocation:
using CrestApps.Core.SignalR;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddSignalR(pathPrefix: "", addStoreCommitterFilter: true)
)
);
Without the builder, AddCoreSignalR(pathPrefix) returns the ISignalRServerBuilder:
builder.Services.AddCoreSignalR("/tenant-a")
.AddCrestAppsStoreCommitterFilter();
AddCoreSignalR registers HubRouteManager as a singleton and sets host-wide defaults:
| Setting | Value | Why |
|---|---|---|
| JSON protocol naming | camelCase | Matches the bundled chat scripts |
MaximumParallelInvocationsPerClient | 8 | StartRealtimeWebRtc holds its invocation open while trickled AddRealtimeIceCandidate calls arrive; with SignalR's default of one, ICE never completes on a remote host |
StreamBufferCapacity | 64 | Realtime audio is uploaded as a stream of small frames; the default of 10 blocks the dispatch loop while the provider session opens |
The chat hubs need more than that (10-minute client timeout, 15-second keep-alive, 10 MB messages). Configure each concrete hub type:
using CrestApps.Core.AI.Chat;
builder.Services.ConfigureCrestAppsChatHubOptions<AIChatHub>();
builder.Services.ConfigureCrestAppsChatHubOptions<ChatInteractionHub>();
ConfigureCrestAppsChatHubOptions<THub>() uses AddHubOptions<THub>. Setting services.Configure<HubOptions<THub>>(...) directly is silently ignored by SignalR, and a hub mapped without per-hub options runs on the global defaults.
Use the registered HubRouteManager instance so the configured prefix is applied:
using CrestApps.Core.SignalR.Services;
var app = builder.Build();
var hubRouteManager = app.Services.GetRequiredService<HubRouteManager>();
app.MapHub<ChatInteractionHub>(hubRouteManager.GetPathByHub<ChatInteractionHub>());
app.MapHub<AIChatHub>(hubRouteManager.GetPathByHub<AIChatHub>());
The default path is /Communication/Hub/{HubTypeName}, prefixed when a path prefix is configured (/tenant-a/Communication/Hub/AIChatHub). The static HubRouteManager.MapHub<T>(routes) maps the default path without any prefix and is meant for module startups that are already tenant-scoped. A host may also map a literal path (the sample hosts use /hubs/ai-chat and /hubs/chat-interaction) as long as the client is given the same URL.
using CrestApps.Core.SignalR.Services;
namespace MyApp.Services;
public sealed class ChatHubUrlProvider
{
private readonly HubRouteManager _hubRouteManager;
public ChatHubUrlProvider(HubRouteManager hubRouteManager)
{
_hubRouteManager = hubRouteManager;
}
public string GetChatHubUrl(HttpContext httpContext)
=> _hubRouteManager.GetUriByHub<AIChatHub>(httpContext);
}
| Method | Returns |
|---|---|
GetPathByHub<T>() | Prefixed relative path for MapHub |
GetPathByRoute(pattern) | Prefixed relative path for a custom pattern |
GetUriByHub<T>(httpContext) | Absolute URL from the current request scheme and host |
GetUriByRoute(httpContext, pattern) | Absolute URL for a custom pattern |
A HubRouteManager constructed with a siteBaseUrlResolver builds absolute URLs from that base URL instead of the request, which helps behind reverse proxies. AddCoreSignalR registers one without a resolver; register your own instance to supply one.
AddCoreSignalR() does not configure authentication; app.UseAuthentication() and app.UseAuthorization() must run before endpoints.
[Authorize] on the hub class to reject the negotiate request.AuthorizeProfileAsync(IServiceProvider, AIProfile) on AIChatHubCore<TClient> and AuthorizeAsync(IServiceProvider, ChatInteraction) on ChatInteractionHubBase. A false result sends ReceiveError with GetNotAuthorizedMessage() and keeps the connection open.AIChatHubCore<TClient>.AuthorizeSessionAsync(IServiceProvider, AIChatSession) lets only the session's owner (matching UserId, or the visitor's ClientId) load, continue or rate it, and reports any other id as not found. Override it to let administrators review conversations (see crestapps-core-chat-interactions).Headless clients send a bearer token as the access_token query parameter during the WebSocket handshake. Accept it only on hub paths:
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Events = new JwtBearerEvents
{
OnMessageReceived = context =>
{
var accessToken = context.Request.Query["access_token"];
if (!string.IsNullOrEmpty(accessToken) &&
context.HttpContext.Request.Path.StartsWithSegments("/Communication/Hub"))
{
context.Token = accessToken;
}
return Task.CompletedTask;
},
};
});
Inside a hub use Context.User and Context.GetHttpContext(), never IHttpContextAccessor, which is unreliable during hub invocations. Services that need the caller should take the principal as a parameter or use IUserAccessor; the built-in chat hubs publish the connection's principal to it for every invocation. When the transport left IHttpContextAccessor.HttpContext empty (long polling), AIChatHubCore sets the connection's own HttpContext on it for the invocation and clears it afterwards, so visitor identity and rate-limit keys resolve on every transport. Besides SendMessage, the AI chat hub has RunAgent, which streams AG-UI events (see crestapps-core-ag-ui). Do not attach a policy that lists schemes to a hub that must also accept anonymous connections; a failed policy replaces HttpContext.User with an empty principal.
Pin the SignalR browser client and check its bytes, as the sample hosts do:
<script src="https://cdn.jsdelivr.net/npm/@microsoft/[email protected]/dist/browser/signalr.min.js"
integrity="sha384-N+pL/4qXZHZcvsa6hVMd5/7cdF3lC59ZMNHeQyRo5q9jmC7yw0hcJILPjUDSU7ZS"
crossorigin="anonymous"></script>
A floating @latest URL cannot carry an integrity hash.
SignalR keeps connection state in memory. Behind a load balancer with several instances, add a backplane (Redis via AddStackExchangeRedis(...) on the ISignalRServerBuilder, or Azure SignalR Service). A realtime voice session is bound to one server for its whole life, so use sticky sessions when WebSockets are not guaranteed.
AddCoreSignalR and call ConfigureCrestAppsChatHubOptions<THub>() for that hub.HubRouteManager, not hard-coded strings.AddCoreSignalR now sets MaximumParallelInvocationsPerClient = 8 and StreamBufferCapacity = 64 for every hub, and the chat hub options are configured per hub type with AddHubOptions<THub>. Remove any services.Configure<HubOptions<THub>> workarounds.@microsoft/[email protected] with an integrity hash instead of @latest.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-core:crestapps-core-signalrfrom crestapps-core
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-core51 skills in this plugin
/crestapps-core-a2aSkill for Agent-to-Agent (A2A) protocol support in CrestApps.Core on the A2A 1.0 SDK. Covers AddA2AClient and AddCoreAIA2AClient with Entity Framework Core or YesSql connection stores, A2AConnection and A2AConnectionMetadata authentication, AIProfileA2AMetadata, the agent card cache and A2AToolRegistryProvider, the listAvailableAgents, findAgentForTask and findToolsForTask tools, building an A2A host with IAgentHandler, A2AServer, ITaskStore and MapA2A, A2A 1.0 agent cards with supportedInterfaces published at /.well-known/agent-card.json, A2AHostOptions authentication and ExposeAgentsAsSkill, system agents exposed through the host, and upgrading from the 0.3 SDK./crestapps-core-ag-uiSkill for running the CrestApps.Core 2.0 AI chat as an AG-UI agent. Covers the CrestApps.Core.AI.AGUI package (AGUIRunEventWriter, AGUIRunRequest, AGUIJson), AIChatHubCore.RunAgent over SignalR and MapAGUIChat with Server-Sent Events, the RunAgentInput members and streamed events, tool approvals with RequireApproval or an approval tool kind, ApprovalRequiredAIFunction, interrupts and resume, approvals inside agents, page context with crestAppsAGUI.registerContextProvider, shared state with registerStateProvider and update_shared_state, frontend tools, stored tool calls (ChatTurnToolActivity), runs that continue on the next page, AGUIChatOptions.DisconnectedRunTimeout, the protocol and sendPageContext chat options, and the AICompletionContextKeys and ChatResponseHandlerContext members. Use it when showing tool calls in the chat, asking a person before a tool runs, sharing page state with the agent, connecting CopilotKit or another AG-UI client, or troubleshooting approvals and continued runs./crestapps-core-ai-agentsSkill for AI agents in CrestApps.Core 2.0, specialized AIProfile records of type Agent that the primary model invokes as tools. Covers creating agent profiles with AgentMetadata availability (OnDemand or AlwaysAvailable), linking them with AgentInvocationMetadata, how AgentProxyTool runs an agent with tools disabled or through the orchestrator when AllowToolInvocation is set, the AgentInvocationDepth recursion guard, never offering an agent to itself (RunningAgentName), tools of an agent that require an approval and pause the agent, deployment inheritance and the chat slot, code-defined and system agents through IAIProfileProvider including the Tabular Data, PDF, Presentation and Word agents, chat-specific agents that read AIInvocationScope, exposing agents to MCP clients with McpServerOptions Agents and ExposeAllAgents, and SubAgent usage labels. Use it when delegating work to sub-agents, adding a framework-managed agent, publishing an agent over MCP, or troubleshooting an agent the model does not call./crestapps-core-ai-markdownSkill for Markdig-backed Markdown normalization in CrestApps.Core 2.0 AI document, data source and RAG flows. Covers the CrestApps.Core.AI.Markdown package, AddMarkdown on the AI suite builder and AddCoreAIMarkdown on IServiceCollection, MarkdownAITextNormalizer replacing the default IAITextNormalizer, RagTextNormalizer content, chunk and title normalization with HTML stripping and Microsoft.Extensions.DataIngestion.Markdig parsing, the gpt-4o tokenizer chunker with 500 tokens per chunk and 50 tokens of overlap, the plain-text fallback for unsupported inline types, where the normalizer is used (data source indexing, preemptive retrieval, reference titles), and pairing it with document processing. Use it when indexing Markdown-heavy content for retrieval, replacing the text normalizer, or troubleshooting chunk sizes and leftover markup in retrieved text./crestapps-core-ai-memorySkill for AI memory in CrestApps.Core. Covers AddAIMemory, AddCoreAIMemory and AddCoreAIMemoryIndexing, Entity Framework Core and YesSql memory stores, the AIMemory index profile on the Elasticsearch, Azure AI Search and PostgreSQL backends, AIMemoryOptions, the store fallback when no index is usable, background memory indexing, the three kinds of memory (session memory with AIConversationMemory summaries and search_conversation, past conversations with search_past_conversations and list_recent_conversations, durable user memory) switched by MemoryMetadata and ChatInteractionMemoryOptions, preemptive memory retrieval and RunsWhenPreemptiveRagIsDisabled, owner-only chat sessions, the user memory tools, IAIMemorySafetyService validation, and custom IMemoryVectorSearchService implementations./crestapps-core-ai-model-capabilitiesSkill for metadata-driven deployment capabilities in CrestApps.Core 2.0. Covers trained model features such as textGeneration, toolCalling, streaming, reasoning, realtime, textEmbedding, speechToText and textToSpeech, model parameters such as reasoningEffort, declaring them with AIDeploymentMetadata or the Features and Parameters configuration shorthand for Azure App Service settings, registering custom features, parameters and slots with AddAIDeploymentFeature, AddAIDeploymentParameter, AddAIDeploymentSlot and AIDeploymentCapabilityOptions, IAIDeploymentCapabilityService, deployment slots and their resolution chain, AIDeploymentParametersMetadata chat and utility values, IAIDeploymentParameterBinder, UseModelParameters, capability enforcement, the ChatApi Responses routing for reasoning with tools, capability-aware chat UIs, and migrating from AIDeploymentPurpose. Use it when declaring what a model supports, adding a new knob, or fixing stripped tools, missing pickers, or reasoning-effort errors.Other plugins' skills for the same job