Skip to content

Component: SmrtChat

Canonical source: SmrtApps/CSApps/SmrtChat/README.md (mirrored below)


SmrtChat

Overview & responsibilities

SmrtChat is a focused WinUI 3 shell application for general-purpose chat.

Current scope (vNext):

  • Supports metadata-only chat session creation and listing via Smrt.Chat.Core.
  • Does not persist or log prompts/responses (no transcript storage).
  • Reuses shared provider configuration managed via Settings Host.
  • Uses shared UI surfaces from Smrt.Chat.UI.WinUI3.

Public surface (entry points, CLI commands, UI)

SmrtChat is primarily launched as a WinUI app, but accepts action verbs via a single --action argument.

Entry points

  • Primary: SmrtChat.exe
  • Delegated from HubWindow for general chat actions: SmrtChat.exe --action "<verb>?kind=general"

CLI / commands

  • --action "create-chat-session?kind=general" (metadata-only)
  • --action "list-chat-sessions?kind=general" (metadata-only; copies results to clipboard)
  • --action "validate-shared-runtime" (UI)
  • --action "validate-shared-runtime-headless" (logs only)

UI

  • Minimal window surface used to execute the requested action and report status.
  • The window hosts Smrt.Chat.UI.WinUI3.Controls.ChatView (shared, embeddable UI surface).

Key files and folders

  • SmrtChat.csproj — WinUI 3 app project (x64 only; RID win-x64).
  • App.xaml / App.xaml.cs — Startup, logging initialization, theming, and single-instance IPC.
  • MainWindow.xaml / MainWindow.xaml.cs — Hosts the shared ChatView control and wires metadata-only actions.
  • Services/SingleInstanceIpc.cs — Per-user named pipe IPC to forward action verbs to the primary instance.
  • Resources/SmrtChatOverrides.xaml — Reserved for app-specific theme overrides.

Dependencies / integrations

  • Smrt.Chat.Core: chat session metadata storage and listing.
  • Smrt.Chat.UI.WinUI3: shared WinUI 3 chat UI surfaces.
  • Smrt.Config: canonical config/state/log paths (component slug: smrt-chat).
  • Smrt.Logging: structured component logging.
  • Smrt.CloudProviders + SettingsHost: provider configuration/state shared across apps.
  • Windows Credential Manager: secrets storage (read-only usage; secrets are not logged).

Configuration, logs, paths, and operational data

  • Canonical config/state paths: via Smrt.Config using component slug smrt-chat.
  • Chat session metadata paths: via Smrt.Chat.Core canonical paths (chat slug).
  • Logs: written under the SmrtHub operational data locations (see Operational Data Policy).

Common paths (as-built on Windows):

  • Staged app (Debug): Apps/Debug/win-x64/SmrtChat/SmrtChat.exe
  • Logs (LocalAppData):
    • %LocalAppData%/SmrtHub/Logs/smrt-chat/smrt-chat-logYYYYMMDD.txt
    • %LocalAppData%/SmrtHub/Logs/smrt-chat/smrt-chat-logYYYYMMDD.json
  • Chat metadata state (Roaming AppData, owned by Smrt.Chat.Core):
    • %AppData%/SmrtHub/Config/chat/chat-state.json

See: README.Files/System/Policies/SmrtHub-Operational-Data-Policy-v1.0.README.md.

Observability (logging, diagnostics)

  • Logging uses Smrt.Logging with component slug smrt-chat.
  • Privacy: never log or persist chat transcripts; clipboard output is user-triggered and not logged.

Testing & validation expectations

Validation actions:

  • Shared config/state + Credential Manager check: SmrtChat.exe --action "validate-shared-runtime" (UI)
  • Headless variant (logs only): SmrtChat.exe --action "validate-shared-runtime-headless"

Unit tests:

  • dotnet test SmrtApps/tests/SmrtChat.Tests/SmrtChat.Tests.csproj -c Debug -r win-x64

Support bundle / Support Bundle

SmrtChat does not currently contribute custom attachments beyond standard operational data (logs/config/state). When Support Bundle integration is added, this README is the place to document:

  • Which log files and configuration/state snapshots are included
  • Any redaction rules (especially around provider secrets)
  • How to reproduce common failures
  • vNext checklist: README.Files/SmrtHub-vNext-Architecture/Plans/SmrtChat.plan.md
  • Logging guide: README.Files/Reference-Guides/SmrtHub.Logging.README.md
  • Operational Data Policy: README.Files/System/Policies/SmrtHub-Operational-Data-Policy-v1.0.README.md
  • Privacy & Security Policy: README.Files/System/Policies/SmrtHub-Privacy-and-Security-Policy.README.md