Skip to content

Add named-pipe agent samples for DirectLineFlex#613

Draft
matthewmeyer wants to merge 1 commit into
mainfrom
users/matthewm/namedpipes-samples
Draft

Add named-pipe agent samples for DirectLineFlex#613
matthewmeyer wants to merge 1 commit into
mainfrom
users/matthewm/namedpipes-samples

Conversation

@matthewmeyer

Copy link
Copy Markdown
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
@matthewmeyer matthewmeyer requested a review from Copilot June 11, 2026 21:18
@github-actions github-actions Bot added the Samples Changes to Samples label Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-namedpipes with 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Samples Changes to Samples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants