crestapps/crestapps.agentskills/crestapps-core-chat-interactions
Claude Code and agent skill by crestapps/crestapps.agentskills
- community
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-interactionsSKILL.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
ChatInteractionandIChatInteractionPromptStoreon the chat interactions builder. - The framework does not ship a mapped hub. Subclass
ChatInteractionHubBase(andAIChatHubCore<TClient>for sessions), map it, and callConfigureChatHubOptions<THub>()for each concrete hub. - The hubs' authorization hooks return
trueby default, exceptAuthorizeSessionAsynconAIChatHubCore<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-chatfor server-side completion code,crestapps-core-signalrfor hub routes and authentication,crestapps-core-realtime-voicefor voice sessions, andcrestapps-core-ag-uifor 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
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.
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)appliesIChatRateLimiterto input that does not pass throughValidatePromptSecurityAsync: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
TemplatePromptprofile sent throughSendMessageneeds thesessionProfileIdof the chat profile the caller is in; both profiles are authorized and the message is rate-limited beforeProcessGeneratedPromptAsyncruns. A missing or unknown session profile gets the same "not authorized" answer. SynthesizeSpeechrefuses text overMaxSpeechTextLength(virtual, 10,000) withGetSpeechTextTooLongMessage()on both hubs;AIChatHubCorealso refuses a profile without text-to-speech playback or Conversation mode (IsSpeechSynthesisEnabledAsync, virtual) withGetTtsNotEnabledMessage().ResolveVisitorIdentity(IServiceProvider)isprotected static, so a derived hub builds the same visitor identity.- Over long polling the hub sets the connection's own
HttpContextonIHttpContextAccessorfor 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:
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):
| Method | Purpose | |
|---|---|---|
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, SynthesizeSpeech | Speech-to-text and text-to-speech conversation mode | |
StartRealtimeConversation, StartRealtimeWebRtc, AddRealtimeIceCandidate, GetRealtimeIceServers, UpdateRealtimeSettings, UpdateRealtimeSpeechSpeed, StopConversation | Realtime 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).
ChatDeploymentNameis the text model;UtilityDeploymentNameruns background work;ConversationDeploymentNamenames 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
filtersetting is validated withIODataValidatorbefore any settings handler runs. An invalid filter rejects the save withReceiveError("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
- SKILL.md in the repositoryCheckingplugins/crestapps-core/skills/crestapps-core-chat-interactions/SKILL.md
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
[](https://verified-skill.com/skills/crestapps/crestapps.agentskills/crestapps-core-chat-interactions)