crestapps/crestapps.agentskills/crestapps-core-chat-interactions

Claude Code and agent skill by crestapps/crestapps.agentskills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Skill for Chat Interactions and the shared chat hubs and chat UI in CrestApps.Core 2.0. Covers AddChatInteractions with AddEntityCoreStores or AddYesSqlStores, ConfigureVisitorIdentity, ConfigureChatRateLimiting and ConfigureChatHubOptions, subclassing ChatInteractionHubBase and AIChatHubCore with AuthorizeAsync, AuthorizeProfileAsync and the other override hooks, the ChatInteraction model with chat, utility and conversation deployment names, IChatInteractionSettingsHandler, SaveSettings filter…

Install

npx vskill@latest install crestapps/crestapps.agentskills/crestapps-core-chat-interactions

SKILL.md

The same SKILL.md was published earlier as crestapps/crestapps.agentskills/crestapps-core-chat-interactions.

CrestApps.Core Chat Interactions

A Chat Interaction is an operator-controlled conversation that needs no AI Profile: the interaction itself stores its deployments, system message, sampling, tools, agents, MCP connections, data source and documents. It is the fastest way to validate a provider and deployment. AI Chat sessions (AIChatSession) are the profile-based equivalent used by end-user chat pages and widgets. Both ship in CrestApps.Core.AI.Chat and share the same chat UI scripts.

Guidelines

  • Start with Chat Interactions to validate a connection and deployment, then move reusable behavior into an AI Profile (crestapps-core-ai-profiles).
  • Register stores for ChatInteraction and IChatInteractionPromptStore on the chat interactions builder.
  • The framework does not ship a mapped hub. Subclass ChatInteractionHubBase (and AIChatHubCore<TClient> for sessions), map it, and call ConfigureChatHubOptions<THub>() for each concrete hub.
  • The hubs' authorization hooks return true by default, except AuthorizeSessionAsync on AIChatHubCore<TClient>, which only lets a session's owner in. Override them or put [Authorize] on the hub.
  • Chat Interactions do not get the AI Profile prompt-security preamble or injection blocking (the operator controls the prompt), but they do get input-boundary delimiters and a per-user tool access check at send time.
  • Use crestapps-core-chat for server-side completion code, crestapps-core-signalr for hub routes and authentication, crestapps-core-realtime-voice for voice sessions, and crestapps-core-ag-ui for the AG-UI runs (RunAgent, tool cards, approvals, shared state) the session chat uses by default.
  • Cookie-authenticated hosts put the antiforgery token on the chat page, or document uploads and removals answer 400.

Registration

csharp
using CrestApps.Core.AI.Chat;
using CrestApps.Core.AI.OpenAI;
using CrestApps.Core.AI.Security;
using CrestApps.Core.Data.EntityCore;
using CrestApps.Core.SignalR;
using MyApp.Hubs;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddEntityCoreStores()
.AddOpenAI()
.AddSignalR(addStoreCommitterFilter: true)
.AddChatInteractions(chatInteractions => chatInteractions
.AddEntityCoreStores()
.ConfigureChatHubOptions<ChatInteractionHub>()
.ConfigureVisitorIdentity(options =>
{
options.RemoteAddressMode = AIVisitorRemoteAddressMode.Hashed;
})
.ConfigureChatRateLimiting(options =>
{
options.AnonymousSessionStartPartitions =
ChatRateLimitPartition.Visitor |
ChatRateLimitPartition.NetworkAddress;
})
)
)
.AddEntityCoreSqliteDataStore("Data Source=app.db")
);
// HubOptions<THub> is per concrete hub type; configure every chat hub you map.
builder.Services.ConfigureCrestAppsChatHubOptions<AIChatHub>();
var app = builder.Build();
app.MapHub<ChatInteractionHub>("/hubs/chat-interaction");
app.MapHub<AIChatHub>("/hubs/ai-chat");

Use .AddYesSqlStores() instead of .AddEntityCoreStores() for YesSql; YesSql hosts create the index tables with CreateChatInteractionIndexSchemaAsync and CreateChatInteractionPromptIndexSchemaAsync (see crestapps-core-yessql-stores).

AddCoreAIChatInteractions() (called by AddChatInteractions) registers visitor identity, chat notifications, the session-processing pipeline (AddCoreAIChatSessionProcessing: data extraction, post-session processing, the AIChatSessionCloseBackgroundService that closes inactive sessions every 5 minutes), CitationReferenceCollector, CompositeAIReferenceLinkResolver, ChatInteractionCompletionContextBuilderHandler, the built-in settings handlers (data source, prompt template, persona), and OptionsRealtimeIceServerProvider.

ConfigureChatHubOptions<THub>() uses AddHubOptions<THub> (a plain services.Configure<HubOptions<THub>> is silently ignored by SignalR) and sets a 10-minute client timeout, 15-second keep-alive, 10 MB maximum message size, 8 parallel invocations per client, and a stream buffer of 64.

Host the Hub

ChatInteractionHub and AIChatHub above are host classes. The interaction hub looks like this; the session hub is in chat-interactions-examples.md.

csharp
using CrestApps.Core.AI.Chat.Hubs;
using CrestApps.Core.AI.Models;
using Microsoft.AspNetCore.Authorization;
namespace MyApp.Hubs;
[Authorize]
public sealed class ChatInteractionHub : ChatInteractionHubBase
{
public ChatInteractionHub(
IServiceProvider services,
TimeProvider timeProvider,
ILogger<ChatInteractionHub> logger)
: base(services, timeProvider, logger)
{
}
protected override Task<bool> AuthorizeAsync(IServiceProvider services, ChatInteraction interaction)
=> Task.FromResult(string.Equals(interaction.OwnerId, Context.UserIdentifier, StringComparison.Ordinal));
protected override Task<ChatMode> GetChatModeAsync(IServiceProvider services)
=> Task.FromResult(ChatMode.Conversation);
}

Other virtual hooks include GetDeploymentSettingsAsync (returns the DefaultAIDeploymentSettings used for slot defaults), IsTextToSpeechPlaybackEnabledAsync, CollectStreamingReferences (merge citations with CitationReferenceCollector), OnAssistantPromptCreatedAsync, ValidateSettings, and the localizable message methods (GetNotAuthorizedMessage, GetSettingsValidationMessage, GetNoRealtimeDeploymentMessage, GetConversationDeploymentNotRealtimeMessage, and others). AIChatHubCore<TClient> exposes AuthorizeProfileAsync(IServiceProvider, AIProfile) and GetRateLimitedMessage(PromptSecurityResult), which returns a "slow down" message with the retry delay when the message rate limit is hit.

  • EvaluateMessageRateLimitAsync(services, profile, sessionId, cancellationToken) applies IChatRateLimiter to input that does not pass through ValidatePromptSecurityAsync: SendAudioStream, SynthesizeSpeech, StartConversation, StartRealtimeConversation, StartRealtimeWebRtc, template prompts, blank messages, and resuming or continuing an AG-UI run. It runs after the profile is authorized and before a provider is called.
  • A TemplatePrompt profile sent through SendMessage needs the sessionProfileId of the chat profile the caller is in; both profiles are authorized and the message is rate-limited before ProcessGeneratedPromptAsync runs. A missing or unknown session profile gets the same "not authorized" answer.
  • SynthesizeSpeech refuses text over MaxSpeechTextLength (virtual, 10,000) with GetSpeechTextTooLongMessage() on both hubs; AIChatHubCore also refuses a profile without text-to-speech playback or Conversation mode (IsSpeechSynthesisEnabledAsync, virtual) with GetTtsNotEnabledMessage().
  • ResolveVisitorIdentity(IServiceProvider) is protected static, so a derived hub builds the same visitor identity.
  • Over long polling the hub sets the connection's own HttpContext on IHttpContextAccessor for the invocation, so visitor identity and rate-limit keys work on every transport.

AIChatHubCore<TClient> also exposes AuthorizeSessionAsync(IServiceProvider, AIChatSession) and ValidateOutputAsync(...) (the output security filter, then the profile's guardrails; returns the replacement text for a blocked reply or null).

Session Ownership

Loading, continuing, rating and acting on a session all call AuthorizeSessionAsync first. By default it allows only the signed-in user whose id (ClaimTypes.NameIdentifier, else the name) equals AIChatSession.UserId, or, for a visitor session, the same ClientId from IAIVisitorIdentityResolver. A session with neither is refused. A refused id is answered with GetSessionNotFoundMessage(), and a message sent to it starts a new session for the caller. Let staff open other users' conversations by widening it:

csharp
protected override async Task<bool> AuthorizeSessionAsync(IServiceProvider services, AIChatSession chatSession)
{
if (await base.AuthorizeSessionAsync(services, chatSession))
{
return true;
}
var authorizationService = services.GetRequiredService<IAuthorizationService>();
return (await authorizationService.AuthorizeAsync(Context.User, "Admin")).Succeeded;
}
Stop After Streaming

When the user presses Stop after the answer has streamed, the hubs still validate, save and finish the turn: the remaining work ignores the cancelled token, and SendMessage runs in a child scope the hub owns because SignalR disposes the invocation scope on cancel. A host that overrides ExecuteInScopeAsync with its own scope keeps that scope.

Hub methods called by the client (interaction hub; the session hub takes profileId and sessionId instead of itemId):

MethodPurpose
SendMessage(itemId, prompt)Streams CompletionPartialMessage items through a ChannelReader
RunAgent(input)Session hub only: an AG-UI run that streams AG-UI events (see crestapps-core-ag-ui)
LoadInteraction(itemId) / SaveSettings(itemId, settings) / ClearHistory(itemId)Load, update and reset an interaction
StartConversation, SendAudioStream, SynthesizeSpeechSpeech-to-text and text-to-speech conversation mode
StartRealtimeConversation, StartRealtimeWebRtc, AddRealtimeIceCandidate, GetRealtimeIceServers, UpdateRealtimeSettings, UpdateRealtimeSpeechSpeed, StopConversationRealtime voice (see crestapps-core-realtime-voice)
HandleNotificationAction(sessionId, notificationType, actionName)Chat notification buttons
SetPageTools(tools) / ClearPageTools()Session hub only: the WebMCP tools the tab exposes (see crestapps-core-webmcp)

IChatInteractionHubClient callbacks: ReceiveError, LoadInteraction, SettingsSaved, HistoryCleared, ReceiveTranscript, ReceiveAudioChunk, ReceiveAudioComplete, ReceiveRealtimeAnswer, ReceiveRealtimeIceCandidate, ReceiveRealtimeEvent, ReceiveConversationUserMessage, ReceiveConversationAssistantToken, ReceiveConversationAssistantComplete, ReceiveNotification, UpdateNotification, RemoveNotification.

The Interaction and Its Settings

SaveSettings reads camelCase keys from the settings JSON: title, orchestratorName, connectionName, deploymentName (stored as ChatDeploymentName), utilityDeploymentName, conversationDeploymentName, realtimeVoiceName, systemMessage, temperature, topP, frequencyPenalty, presencePenalty, maxTokens, pastMessagesCount, toolNames, agentNames, mcpConnectionIds, plus whatever the registered IChatInteractionSettingsHandler implementations read (for example filter, personaId).

  • ChatDeploymentName is the text model; UtilityDeploymentName runs background work; ConversationDeploymentName names the realtime model and, because a chat interaction has no chat mode of its own, naming it is the opt-in to speaking. A conversation deployment that is not realtime-capable is reported with the deployment name rather than silently replaced.
  • The filter setting is validated with IODataValidator before any settings handler runs. An invalid filter rejects the save with ReceiveError ("Invalid filter value. It must be a valid OData filter.") and the interaction keeps its settings.
  • Add your own settings with a handler; see chat-interactions-examples.md.

Security Behavior

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
13
Repository forks
4
7-day trend score
5

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/crestapps/crestapps.agentskills/crestapps-core-chat-interactions/badge)](https://verified-skill.com/skills/crestapps/crestapps.agentskills/crestapps-core-chat-interactions)

Something wrong with this skill or its page? Tell us.