Skip to content

feat: FDC3 for native side apps over a gRPC named pipe, discovered from the App Directory - #10

Merged
moonolgerd merged 14 commits into
mainfrom
claude/grpc-pipe-fdc3-b92284
Nov 12, 2026
Merged

moonolgerd merged 14 commits into
mainfrom
claude/grpc-pipe-fdc3-b92284

Conversation

@moonolgerd

@moonolgerd moonolgerd commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Native side apps can now join Bermuda's in-process FDC3 2.2 DesktopAgent over gRPC on a Windows named pipe, next to the WebView2 windows, sharing channels and intents with them. Web behaviour is unchanged.

  • gRPC over a named pipe (Bermuda.Fdc3.Grpc): Kestrel named-pipe transport, current-user-only, HTTP/2 without TLS. The pipe name is configurable and defaults to a per-user name. Each Subscribe(app_id) stream is one app instance; the app id is validated against the App Directory, and the instance is removed when the stream or pipe ends. Fdc3Errors strings are the gRPC status detail. Config: FDC3_GRPC_ENABLED, FDC3_GRPC_PIPE.
  • The proto is the source of truth (Bermuda.Fdc3.Proto/Protos/fdc3.proto). Building that project generates the gRPC classes (Grpc.Tools), the C# IFdc3Commands contract in Bermuda.IpcContract (the old hand-written Fdc3Contract.cs is gone), and the proto-to-record mapping plus service overrides. The generated files are checked in and CI fails if they are stale. The conventions are documented at the top of the proto.
  • Client: Fdc3PipeClient lives in Bermuda.Fdc3.Proto, so a native app does not need ASP.NET Core.
  • Sample native app (Bermuda.NativeApp, native-incidents): joins a channel and acknowledges incidents and ViewIncident intents. It allows one copy per user.
  • Native apps are discovered from the App Directory. An entry in fdc3-appd.json with type: native, details.path and details.project is all it takes. Aspire (bumped to 13.6.5, using AddCSharpApp) starts it, CreateMsix publishes it into Bermuda's package and adds its manifest <Application> (via tools/native-apps.cs, a file-based C# app run with dotnet run --file), CI publishes it for tagged releases, and Bermuda starts and stops it with the host (NATIVE_APP_AUTOSTART=false turns that off). It ships inside Bermuda's MSIX, so it installs, updates and is signed with Bermuda.

Tests

  • dotnet build Bermuda.slnx and dotnet test Bermuda.slnx: 9 pipe integration tests plus the existing 47 pass.
  • pnpm e2e: 124 pass, including 4 new Playwright tests against the native app (metadata, web broadcast to native ack, intent result, findIntent).
  • Built an MSIX locally and checked that its manifest contains the generated native <Application>.
  • Not verified: installing a freshly built, signed MSIX and watching Bermuda start the native app from the installed package.

See docs/fdc3.md section 7a.

🤖 Generated with Claude Code

… pipe

New Bermuda.Fdc3.Grpc project: a Kestrel named-pipe (current-user-only)
gRPC service mirroring IFdc3Commands. Each Subscribe(app_id) stream is one
app instance (app id validated against the AppDirectory) and is disposed
when the stream or pipe ends; Fdc3Errors strings are the gRPC status
detail. Started/stopped by App.xaml.cs (FDC3_GRPC_ENABLED, FDC3_GRPC_PIPE).
Adds a reference .NET pipe client, integration tests over a real pipe and a
docs/fdc3.md section.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

moonolgerd and others added 8 commits November 11, 2026 02:24
Bermuda.Fdc3.Grpc.Generator reflects over the contract and writes
fdc3.proto, the proto<->contract mapping and the service overrides, run
by the Bermuda.Fdc3.Grpc build. Replaces the hand-written proto, mapping
and 22 service methods.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bermuda.NativeApp connects to the host's gRPC pipe as native-incidents
(registered in fdc3-appd.json), joins a channel and acks incidents it
receives, as a broadcast or as a ViewIncident intent result. The AppHost
starts it after the host. Fdc3PipeClient moves into Bermuda.Fdc3.Grpc so
native .NET apps can reuse it. Playwright e2e covers web->native and
native->web over the channel, the intent round trip and findIntent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The proto is now hand-written (Protos/fdc3.proto) and built by Grpc.Tools.
The generator reads protoc's descriptor set, fails the build if the C#
contract disagrees with it, and writes the mapping/service glue from it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fdc3.proto (new Bermuda.Fdc3.Proto project) is now the single source of
truth. Its build runs Bermuda.Fdc3.Grpc.Generator on protoc's descriptor
set to write the Fdc3* records and IFdc3Commands (Bermuda.IpcContract/
Generated) and the gRPC glue (Bermuda.Fdc3.Grpc/Generated). The pipe
client moves into the proto project so native apps need no ASP.NET Core.
API event details are JSON; AgentEvent's oneof is `kind`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The native side app is a second application of the Bermuda package (own
startup task, no Start entry), published into the same folder as the host,
so it installs and updates with Bermuda from the same .appinstaller. CI
publishes it into the release folder and fails if the committed generated
FDC3 code is stale.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The host launches Bermuda.NativeApp.exe from its own package on startup
(NATIVE_APP_AUTOSTART=false disables it) and closes it on exit; the side
app allows one copy per user. Its own startup task is removed: the host is
what starts it, so it no longer needs a sign-in entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…name

The name had lost it (LocalBermuda...), so the copy Bermuda autostarts and the
one Aspire starts both stayed up and the e2e saw two native-incidents instances.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fdc3-appd.json is now the one list of native side apps (type native, details.path,
details.project). Aspire, the MSIX build (native-apps.ps1 publishes each project and
adds its manifest Application), CI and the host's autostart all read it, so adding a
native app is a one-line edit of that file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@moonolgerd moonolgerd changed the title feat: serve the FDC3 DesktopAgent to native apps over gRPC on a named… feat: FDC3 for native side apps over a gRPC named pipe, discovered from the App Directory Nov 11, 2026
…ctory with a C# file app

The native-apps script is now a .NET file-based app (dotnet run --file) instead of
PowerShell; the AppHost registers native apps with Aspire's new AddCSharpApp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@moonolgerd moonolgerd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Five issues, marked inline.

  1. Untargeted raiseIntent("ViewIncident") fails once the native app is connected. Both native-incidents and bermuda-incidents listen for it, and ChooseTarget rejects a raise with more than one running listener (ResolverUnavailable). The README example raises with no target app. The new e2e always passes an instance id.
  2. Subscribe trusts the caller's app id. Any process of the current user can join as any directory app, including bermuda-incidents.
  3. open and intent launch cannot start a native app. WindowAppLauncher still requires a web URL, so those calls fail with ErrorOnLaunch. Autostart runs only from OnStartup and does not bring the process back if it exits later.
  4. Autostart does not use the host's pipe name. FDC3_GRPC_PIPE in appsettings never reaches the child, which only reads the environment variable.
  5. One unexpected exception ends the side app for the rest of the session. The reconnect filter misses HttpRequestException and JsonException, and Bermuda will not start the exe again.

The pipe tests cover broadcast, intent round-trip, FDC3 error strings, and instance ids used from another connection. Still missing: an untargeted ViewIncident with both listeners connected, open of a native app that is down, and the appsettings pipe name. A signed MSIX install (both self-contained apps in one folder, manifest patched) is still unverified.

Comment thread src/Bermuda.NativeApp/Program.cs Resolved
Comment thread src/Bermuda/App.xaml.cs Resolved
Comment thread src/Bermuda/App.xaml.cs Resolved
Comment thread src/Bermuda.NativeApp/Program.cs Resolved
moonolgerd and others added 4 commits November 11, 2026 15:29
… pipe name and robustness

- the native sample handles AcknowledgeIncident, so an untargeted ViewIncident still resolves to the dashboard
- Subscribe only accepts type native apps; web apps cannot be claimed over the pipe
- fdc3.open / intents start a native app that is down (NativeAppHost), passing FDC3_GRPC_PIPE and FDC3_INSTANCE_ID; Subscribe takes instance_id
- details.path must stay inside Bermuda's folder; Aspire passes FDC3_GRPC_PIPE through
- the sample reconnects after any failure and tolerates a non-JSON payload

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…atching

tools/native-apps.cs now does publish, manifest and appinstaller steps with real XML
handling and validation, reporting one clear error per problem. The manifest no longer
carries a placeholder comment, and the build no longer parses tool output or edits the
manifest with regexes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The runner is a normal user machine: an installed Bermuda's native app was connecting to the
same default FDC3 pipe as the test host (two native-incidents instances), and a concurrent
local Aspire held the dashboard port. Each run now gets its own FDC3 pipe, web and CDP ports
and Aspire endpoints, e2e jobs are serialised, and CI never reuses an existing server.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@moonolgerd
moonolgerd merged commit c67e661 into main Nov 12, 2026
4 checks passed
@moonolgerd
moonolgerd deleted the claude/grpc-pipe-fdc3-b92284 branch November 12, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants