Add named-pipe agent samples for DirectLineFlex#613
Draft
matthewmeyer wants to merge 1 commit into
Draft
Conversation
matthewmeyer
commented
Jun 11, 2026
Contributor
- Created named-pipe agent with necessary dependencies in .NET and NodeJS.
- Added documentation for setting up the samples and linked to docs for the Azure App Service deployment
- Created named-pipe agent with necessary dependencies in .NET and NodeJS. - Added documentation for setting up the samples and linked to docs for the Azure App Service deployment
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds new named-pipe (“pipe-only”) agent samples for both Node.js and .NET, intended to run behind the DirectLine App Service extension (DirectLineFlex), and updates the samples index/docs to reference them.
Changes:
- Adds a new Node.js named-pipe sample using
@microsoft/agents-hosting-directline-namedpipeswith pipe-only startup and environment template. - Adds a new .NET named-pipe sample project wired into the samples solution, using
Microsoft.Agents.Hosting.DirectLine.NamedPipes. - Updates the Node.js and .NET samples README tables to include the new sample.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/nodejs/README.md | Adds the Named Pipe Agent entry to the Node.js samples list. |
| samples/nodejs/named-pipe-agent/tsconfig.json | New TS build configuration for the Node.js named-pipe sample. |
| samples/nodejs/named-pipe-agent/src/index.ts | Implements pipe-only echo agent and named-pipe server startup/shutdown logic. |
| samples/nodejs/named-pipe-agent/README.md | Documents how to run/deploy the Node.js named-pipe sample behind DirectLineFlex. |
| samples/nodejs/named-pipe-agent/package.json | Defines scripts/dependencies for building and running the Node.js sample. |
| samples/nodejs/named-pipe-agent/package-lock.json | Locks Node.js sample dependencies for reproducible installs. |
| samples/nodejs/named-pipe-agent/env.TEMPLATE | Adds environment template for pipe name/debug settings. |
| samples/dotnet/Samples.sln | Adds the new NamedPipeAgent project to the .NET samples solution. |
| samples/dotnet/README.md | Adds the Named Pipe Agent entry to the .NET samples list. |
| samples/dotnet/named-pipe-agent/README.md | Documents how to run/deploy the .NET named-pipe sample behind DirectLineFlex. |
| samples/dotnet/named-pipe-agent/Properties/launchSettings.json | Adds launch profile settings for the .NET sample. |
| samples/dotnet/named-pipe-agent/Program.cs | Configures agent hosting and enables the named-pipe transport. |
| samples/dotnet/named-pipe-agent/NamedPipeAgent.csproj | New .NET project definition with named-pipe transport package references. |
| samples/dotnet/named-pipe-agent/MyAgent.cs | Implements the .NET echo agent behavior with a per-conversation counter. |
| samples/dotnet/named-pipe-agent/appsettings.json | Adds agent/logging configuration for the .NET sample. |
Files not reviewed (1)
- samples/nodejs/named-pipe-agent/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+11
to
+16
| WebApplicationBuilder builder = WebApplication.CreateBuilder(args); | ||
|
|
||
| // Add the AgentApplication, which contains the logic for responding to | ||
| // user messages. | ||
| builder.AddAgent<MyAgent>(); | ||
|
|
Comment on lines
+61
to
+81
| service.ready.then(() => { | ||
| console.log(`Named pipe agent connected on '${PIPE_NAME}'`) | ||
| }).catch(() => { | ||
| // Ready rejection means stop() was called before connecting — normal during shutdown. | ||
| }) | ||
|
|
||
| console.log(`Named pipe agent started, waiting for connection on '${PIPE_NAME}'...`) | ||
|
|
||
| // Graceful shutdown — handle both SIGINT (Ctrl-C) and SIGTERM (App Service / container). | ||
| let shuttingDown = false | ||
| const shutdown = async (signal: string) => { | ||
| if (shuttingDown) return | ||
| shuttingDown = true | ||
| console.log(`Received ${signal}, shutting down...`) | ||
| try { | ||
| await service.stop() | ||
| } catch (err) { | ||
| console.error('Error during shutdown:', err) | ||
| } | ||
| process.exit(0) | ||
| } |
Comment on lines
+32
to
+35
| ```sh | ||
| npm install | ||
| npm run build | ||
| ``` |
Comment on lines
+7
to
+8
| // Create custom conversation state properties. This is | ||
| // used to store customer properties in conversation state. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.