feat(embedded-assistant): add a C# example using WPF - #13
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new C# WPF + WebView2 embedded-assistant example that hosts @corti/embedded-web, authenticates via Corti auth, creates an interaction, and navigates into a session.
Changes:
- Introduces a Vite-built WebAssets shell (HTML + TS bootstrap) for hosting the embedded assistant inside WebView2.
- Adds WPF app wiring (WebView2 initialization, host ↔ web messaging, permissions) plus Corti settings/auth services driven by a local
.env. - Adds build plumbing to copy
WebAssets/distinto the app output and documents setup/run steps.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| embedded-assistant/c#-wpf/WebAssets/vite.config.js | Vite build output configuration for producing dist/ assets. |
| embedded-assistant/c#-wpf/WebAssets/tsconfig.json | TypeScript compiler settings for the WebAssets bootstrap. |
| embedded-assistant/c#-wpf/WebAssets/src/main.ts | Web bootstrap that initializes/authenticates the embedded assistant and posts events/errors to the host. |
| embedded-assistant/c#-wpf/WebAssets/package.json | WebAssets package metadata and build dependencies/scripts. |
| embedded-assistant/c#-wpf/WebAssets/package-lock.json | Lockfile for reproducible WebAssets installs. |
| embedded-assistant/c#-wpf/WebAssets/index.html | Local shell page loaded via WebView2 virtual host mapping. |
| embedded-assistant/c#-wpf/WebAssets/README.md | WebAssets-specific rebuild instructions. |
| embedded-assistant/c#-wpf/Services/CortiSettings.cs | Loads required Corti configuration from a project-local .env. |
| embedded-assistant/c#-wpf/Services/CortiAuthService.cs | Performs ROPC token retrieval against the Corti auth endpoint. |
| embedded-assistant/c#-wpf/README.md | Top-level example documentation (prereqs, config, run, troubleshooting). |
| embedded-assistant/c#-wpf/MainWindow.xaml.cs | WebView2 setup, auth button flow, navigation + JS injection, host message handling. |
| embedded-assistant/c#-wpf/MainWindow.xaml | WPF layout hosting the Authenticate button and WebView2 control. |
| embedded-assistant/c#-wpf/CortiAssistantApp.slnx | Solution definition for the example project. |
| embedded-assistant/c#-wpf/CortiAssistantApp.csproj | WPF project config + build target to copy built web assets into output. |
| embedded-assistant/c#-wpf/AssemblyInfo.cs | WPF theme metadata. |
| embedded-assistant/c#-wpf/App.xaml.cs | WPF application entry class. |
| embedded-assistant/c#-wpf/App.xaml | WPF application resource/StartupUri definition. |
| embedded-assistant/c#-wpf/.gitignore | Ignores build outputs, .env, and WebAssets build/install directories. |
| embedded-assistant/c#-wpf/.env.example | Example environment variables required to run the sample. |
Files not reviewed (1)
- embedded-assistant/c#-wpf/WebAssets/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Filip Weilid (filipweilid)
left a comment
There was a problem hiding this comment.
It is working as advertised
|
Filip Weilid (@filipweilid) not even surprised by that comment 😂 but also curious to hear your suggestions for improvements - I'm sure you have some thoughts 😁 |
|
I don't actually have that many suggestions; but one thing I thought would be nice was to display the events being sent and received to get a better idea of what is happening |
Uh oh!
There was an error while loading. Please reload this page.