Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

**Human-led AI agent teams for any project.** One command. A team that helps you move faster with your code.

[![Status](https://img.shields.io/badge/status-alpha-blueviolet)](#status)
[![Platform](https://img.shields.io/badge/platform-GitHub%20Copilot-blue)](#what-is-squad)

> ⚠️ **Alpha Software** — Squad is experimental. APIs and CLI commands may change between releases. We'll document breaking changes in [CHANGELOG.md](CHANGELOG.md).
Breaking changes are documented in [CHANGELOG.md](CHANGELOG.md).

---

Expand Down Expand Up @@ -96,9 +95,9 @@ Squad proposes a team — each member named from a persistent thematic cast. You

---

## .NET package preview
## .NET package

Building a .NET app that should call a Squad team as a Microsoft Agent Framework agent? `Squad.Agents.AI` is a preview NuGet package under [`src/Squad.Agents.AI`](src/Squad.Agents.AI/README.md). It registers a Squad-backed `AIAgent` in DI and targets early `0.1.0-preview` consumers.
Building a .NET app that should call a Squad team as a Microsoft Agent Framework agent? `Squad.Agents.AI` is a NuGet package under [`src/Squad.Agents.AI`](src/Squad.Agents.AI/README.md). Version **1.0.0** targets .NET 8, 9, and 10 and registers a Squad-backed `AIAgent` in DI. See the package README for installation and local validation before publication.

## Upgrading

Expand Down
3 changes: 1 addition & 2 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

**为任何项目打造的 AI 智能体团队。** 一行命令,拥有一个随代码同步成长的开发团队。

[![状态](https://img.shields.io/badge/status-alpha-blueviolet)](#status)
[![平台](https://img.shields.io/badge/platform-GitHub%20Copilot-blue)](#what-is-squad)

> ⚠️ **Alpha 预览版** — Squad 仍处于实验阶段。API 和命令行工具可能在版本更迭中发生变化。我们会在 [CHANGELOG.md](CHANGELOG.md) 中记录重大变更。
重大变更会记录在 [CHANGELOG.md](CHANGELOG.md) 中。

---

Expand Down
10 changes: 5 additions & 5 deletions docs/src/content/docs/guide/agent-framework-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Microsoft Agent Framework integration"
description: "Expose any Squad team as a MAF AIAgent for durable .NET workflows, Aspire dashboard observability, and multi-model composition."
---

> ⚠️ **Preview** — `Squad.Agents.AI` is a preview package. APIs may change before stable release. Use `--prerelease` when installing and pin to a specific version in production builds.
`Squad.Agents.AI` **1.0.0** is the stable package version for .NET 8, 9, and 10. Source versioning is separate from publication; until 1.0.0 is available on NuGet, follow the [local package instructions](https://github.com/bradygaster/squad/blob/dev/src/Squad.Agents.AI/README.md#install).

`Squad.Agents.AI` exposes any Squad team as a Microsoft Agent Framework (MAF) `AIAgent`. Once registered, a `SquadAgent` participates in durable workflows alongside Azure OpenAI, Anthropic, and every other MAF provider — with DTS checkpointing, Aspire dashboard observability, and streaming out of the box.

Expand Down Expand Up @@ -35,14 +35,14 @@ Authentication uses the signed-in GitHub Copilot CLI user by default. No separat
## Install

```bash
dotnet add package Squad.Agents.AI --prerelease
dotnet add package Squad.Agents.AI --version 1.0.0
```

Minimum version for Aspire dashboard observability: **0.5.1**. Current version: **0.5.6-rc1**.
Minimum version for Aspire dashboard observability: **0.5.1**. Stable package version: **1.0.0**.

### GitHub.Copilot.SDK direct reference — active workaround

`Squad.Agents.AI 0.5.6-rc1` ships a `buildTransitive/Squad.Agents.AI.props` that pins the correct `GitHub.Copilot.SDK` version for all consumers, so **most users do not need to add a direct reference**. If you are on an older version of `Squad.Agents.AI` and see:
`Squad.Agents.AI 1.0.0` ships a `buildTransitive/Squad.Agents.AI.props` that pins `GitHub.Copilot.SDK` 1.0.14 for all consumers, so **most users do not need to add a direct reference**. If you are on an older version of `Squad.Agents.AI` and see:

```
InvalidOperationException: Copilot runtime not found
Expand All @@ -54,7 +54,7 @@ add the direct reference that was previously required:
<PackageReference Include="GitHub.Copilot.SDK" Version="*-*" />
```

The root cause is that without a direct `PackageReference`, the SDK's MSBuild targets that copy `copilot.exe` into `bin/` do not fire for transitive consumers. The upstream fix is tracked in [microsoft/agent-framework#6457](https://github.com/microsoft/agent-framework/issues/6457). `Squad.Agents.AI 0.5.6-rc1` works around it independently via the generated `buildTransitive` bridge.
The root cause is that without a direct `PackageReference`, the SDK's MSBuild targets that copy `copilot.exe` into `bin/` do not fire for transitive consumers. The upstream fix is tracked in [microsoft/agent-framework#6457](https://github.com/microsoft/agent-framework/issues/6457). Since 0.5.6-rc1, `Squad.Agents.AI` works around it independently via the generated `buildTransitive` bridge.

---

Expand Down
2 changes: 1 addition & 1 deletion packages/squad-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The programmable multi-agent CLI for GitHub Copilot. Build an AI team, assign roles, and let them work your repo—automating issue triage, code review, documentation, and more through orchestrated AI agents.

> ⚠️ **Experimental** — Squad is alpha software. APIs, commands, and behavior may change between releases.
Breaking changes are documented in [CHANGELOG.md](https://github.com/bradygaster/squad/blob/main/CHANGELOG.md).

## Installation

Expand Down
46 changes: 31 additions & 15 deletions src/Squad.Agents.AI/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Squad.Agents.AI

> **Preview package.** `Squad.Agents.AI` is a preview NuGet package for early adopters. It multi-targets `net8.0`, `net9.0`, and `net10.0`, and depends on preview Microsoft Agent Framework / GitHub Copilot SDK packages, so APIs may change before a stable release.
`Squad.Agents.AI` **1.0.0** is the stable package version and multi-targets `net8.0`, `net9.0`, and `net10.0`. It uses Microsoft Agent Framework 1.23.0 and GitHub Copilot SDK 1.0.14. Source versioning does not confirm NuGet publication; use the local package instructions below until 1.0.0 is published.

## What it does

`Squad.Agents.AI` exposes a Squad team as a Microsoft Agent Framework `AIAgent`. `SquadAgent` composes the Squad CLI through the GitHub Copilot SDK, delegates MAF sessions/runs/streaming to the inner Copilot agent, and gives .NET consumers a DI-friendly wrapper instead of hand-rolling CLI process setup.

Public surface in this preview:
Public surface:

- `SquadAgent` — sealed `AIAgent` wrapper over the Copilot-backed inner agent. Supports both non-streaming and streaming via `RunStreamingAsync`.
- `SquadAgentOptions` — team root, CLI path/args, environment, token, logging, instruction settings, and a `ConfigureCopilotClient` delegate for advanced SDK customization.
Expand All @@ -18,23 +18,33 @@ Repository: <https://github.com/bradygaster/squad>
## Install

```bash
dotnet add package Squad.Agents.AI --prerelease
dotnet add package Squad.Agents.AI --version 1.0.0
```

If you are consuming the PR before publish, pack it locally and add the generated package source:

```bash
dotnet pack src/Squad.Agents.AI/Squad.Agents.AI.csproj -c Release -o nupkgs
dotnet add package Squad.Agents.AI --prerelease --source ./nupkgs
dotnet add package Squad.Agents.AI --version 1.0.0 --source ./nupkgs
```

## Prerequisites

- .NET 10 SDK.
- .NET 8, 9, or 10 for consumers; .NET 10 SDK to build this repository and run the sample.
- GitHub Copilot CLI available on `PATH` (`copilot --version`).
- Squad CLI and an initialized Squad team root; see the [Squad CLI repo](https://github.com/bradygaster/squad).
- GitHub Copilot authentication through the signed-in user. The quickstart below does not require an app key or environment variable.

For a bounded sample check without authentication, CLI startup, or model calls:

```powershell
dotnet run --project src\Squad.Agents.AI\samples\Squad.Agents.AI.Sample -- --smoke
```

This checks default and keyed DI resolution and the client configuration callback.
The five live sample flows still require Copilot authentication and may consume credits;
the smoke check does not validate live responses or streaming.

## Five-line quickstart

```csharp
Expand Down Expand Up @@ -223,28 +233,28 @@ builder.Services.AddSquadAgent(o =>
- **TraceEvents warning:** Enabling `TraceEvents` logs a startup warning because verbose SDK traces may include sensitive operational details.
- **Avoid hardcoded tokens:** Never embed tokens in source code. Use `GitHubTokenProvider` for production token retrieval from Key Vault, managed identity, or similar secure stores.

## Notes for v0.1-preview
## Runtime notes

- Default DI lifetime is scoped. An overload accepts any `ServiceLifetime`.
- DI registers both `SquadAgent` and base `AIAgent` (non-keyed). Keyed DI registers both `SquadAgent` and `AIAgent` under the same key.
- Multi-targeting and Aspire telemetry remain candidates for a later preview.
- The package targets .NET 8, 9, and 10 and includes OpenTelemetry activity support.
- The package does not validate that `SquadFolderPath` exists; consumers should validate their deployment paths.
- `TraceEvents` can log sensitive operational details. Keep it off unless debugging.

## Package contents

- `lib/net10.0/Squad.Agents.AI.dll`
- `lib/net10.0/Squad.Agents.AI.xml` for IntelliSense / API docs
- `lib/net8.0/`, `lib/net9.0/`, and `lib/net10.0/`, each containing `Squad.Agents.AI.dll` and XML IntelliSense / API docs
- `buildTransitive/Squad.Agents.AI.props` for the pinned Copilot SDK native runtime bridge
- `README.md` for NuGet.org rendering
- `.nuspec` metadata with authors, tags, repository, and readme pointer
- `LICENSE` copied from the repository root

## Sample

A runnable console application is included at
`src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/`. It demonstrates the four
`src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/`. It demonstrates the five
core integration patterns in one place: basic DI, keyed DI with multiple agents,
the `ConfigureCopilotClient` BYOK delegate, and streaming via `RunStreamingAsync`.
the `ConfigureCopilotClient` delegate, streaming via `RunStreamingAsync`, and subagent OpenTelemetry observability.

### Prerequisites

Expand All @@ -268,19 +278,20 @@ $env:SQUAD_TEAM_ROOT = "C:\path\to\your\team-root"

### Run

Run all four flows in sequence:
Run all five flows in sequence:

```bash
dotnet run --project src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/
```

Run a single flow (1–4):
Run a single flow (1–5):

```bash
dotnet run --project src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/ -- --flow=1
dotnet run --project src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/ -- --flow=2
dotnet run --project src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/ -- --flow=3
dotnet run --project src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/ -- --flow=4
dotnet run --project src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/ -- --flow=5
```

### Flow walkthrough
Expand All @@ -294,14 +305,19 @@ under keys `"alpha"` and `"beta"`. Resolution uses
`GetRequiredKeyedService<SquadAgent>("alpha")`.

**Flow 3 — BYOK / `ConfigureCopilotClient` delegate** — the delegate receives
`CopilotClientOptions` after Squad has applied its defaults. Inject a custom token
or environment variable. The routing gate prevents accidental redirection of
`CopilotClientOptions` after Squad has applied its defaults. The sample merges a custom
environment variable without overriding authentication, model, or session configuration.
Hosts can additionally inject a token from their credential store. The routing gate prevents accidental redirection of
`Cwd`, `CliPath`, or `CliArgs` — configure those on `SquadAgentOptions` directly.

**Flow 4 — Streaming** — `RunStreamingAsync` returns
`IAsyncEnumerable<AgentResponseUpdate>`. Each `update.Text` fragment is written to
`Console.Write` without a newline for live token-by-token output.

**Flow 5 — Subagent observability** — requests two specialist introductions and
prints dispatch callbacks and OpenTelemetry span counts. A response alone does
not prove that subagents were dispatched; inspect the captured events and spans.

### Troubleshooting

| Error | Cause | Fix |
Expand Down
15 changes: 4 additions & 11 deletions src/Squad.Agents.AI/Squad.Agents.AI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,17 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!--
Prerelease because Microsoft.Agents.AI.GitHub.Copilot 1.15.0-rc1 (below) is itself a
prerelease package. A STABLE Squad.Agents.AI depending on a prerelease package makes
`dotnet pack` emit NU5104 ("A stable release ... should not have a prerelease
dependency"). Prior releases (0.2.0 through 0.5.5) stayed stable and carried that
warning silently; this bump actually resolves it instead of suppressing it, and
matches the "-rc1" convention already used by the adapter dependency itself. Bump
back to a stable version only once Microsoft.Agents.AI.GitHub.Copilot ships a GA
release (dev->main promotions already require bumping this by hand; see
squad-agents-ai-release.yml, which refuses to publish a prerelease Version from main).
Stable package version. Publication is a separate human-triggered release step;
setting this version does not publish the package.
-->
<Version>0.5.6-rc1</Version>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="samples/**/*.cs" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Squad.Agents.AI.Tests" />
<PackageReference Include="Microsoft.Agents.AI.GitHub.Copilot" Version="1.22.0" />
<PackageReference Include="Microsoft.Agents.AI.GitHub.Copilot" Version="1.23.0" />
<!--
Direct reference to GitHub.Copilot.SDK so its build/ targets fire during our build.
Without this, the SDK's MSBuild download/copy targets only flow to projects with a
Expand Down
51 changes: 39 additions & 12 deletions src/Squad.Agents.AI/samples/Squad.Agents.AI.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,42 @@
using Microsoft.Extensions.Logging;
using Squad.Agents.AI;

if (args.Contains("--smoke", StringComparer.OrdinalIgnoreCase))
{
var builder = Host.CreateApplicationBuilder();
var callbackInvoked = false;
var unavailableCli = Path.Combine(Path.GetTempPath(), $"squad-smoke-{Guid.NewGuid():N}.exe");
builder.Services.AddSquadAgent(options =>
{
options.SquadFolderPath = Directory.GetCurrentDirectory();
options.CliPath = unavailableCli;
options.AgentName = "SmokeSquad";
options.ConfigureCopilotClient = _ => callbackInvoked = true;
});
foreach (var key in new[] { "alpha", "beta" })
{
builder.Services.AddKeyedSquadAgent(key, options =>
{
options.SquadFolderPath = Directory.GetCurrentDirectory();
options.CliPath = unavailableCli;
options.AgentName = key;
});
}

await using var services = builder.Services.BuildServiceProvider();
var agent = services.GetRequiredService<SquadAgent>();
if (agent.Name != "SmokeSquad" || !callbackInvoked ||
!ReferenceEquals(agent, services.GetRequiredService<AIAgent>()) ||
services.GetRequiredKeyedService<SquadAgent>("alpha").Name != "alpha" ||
services.GetRequiredKeyedService<SquadAgent>("beta").Name != "beta")
{
throw new InvalidOperationException("Sample smoke validation failed.");
}

Console.WriteLine("Smoke passed: default/keyed DI and client configuration. No sessions or model calls.");
return;
}

// ── Argument parsing ─────────────────────────────────────────────────────────
int? selectedFlow = null;
foreach (var arg in args)
Expand All @@ -37,7 +73,7 @@
// Real-world usage: set SQUAD_TEAM_ROOT to the path of an initialized Squad team.
var teamRoot = System.Environment.GetEnvironmentVariable("SQUAD_TEAM_ROOT")
?? System.IO.Directory.GetCurrentDirectory();
PrintBanner($"Squad.Agents.AI v0.1 — sample run (team root: {teamRoot})");
PrintBanner($"Squad.Agents.AI 1.0.0 — sample run (team root: {teamRoot})");
Console.WriteLine();

// ─────────────────────────────────────────────────────────────────────────────
Expand All @@ -51,7 +87,7 @@
host1.Logging.SetMinimumLevel(LogLevel.Warning); // keep sample output clean
host1.Services.AddSquadAgent(o =>
{
o.SquadFolderPath = @"C:\Users\tamirdresher\source\repos\squad-squad";
o.SquadFolderPath = teamRoot;
o.AgentName = "SampleSquad";
o.EmitSubagentActivities = true;
o.Instructions = "You are a helpful assistant. Respond concisely. and ask each subagent for their input before providing a final answer.";
Expand Down Expand Up @@ -189,10 +225,6 @@
{
PrintHeader("Flow 3 — BYOK / ConfigureCopilotClient delegate");

// Simulate a token from a credential store (never hardcode real tokens).
// In production replace this with Key Vault, managed identity, etc.
const string simulatedToken = "YOUR_GITHUB_PAT_HERE";

var host3 = Host.CreateApplicationBuilder(args);
host3.Logging.SetMinimumLevel(LogLevel.Warning);
host3.Services.AddSquadAgent(o =>
Expand All @@ -205,9 +237,6 @@
// custom token or environment variable from your own credential store.
o.ConfigureCopilotClient = clientOpts =>
{
// Inject a token from an external credential store
clientOpts.GitHubToken = simulatedToken;

// IReadOnlyDictionary indexer is read-only; always assign a new instance.
// ⚠️ IMPORTANT: copilot.exe inherits this dictionary verbatim. If you replace
// it with only your custom vars (no SYSTEMROOT / PATH / TEMP), the native
Expand All @@ -231,7 +260,7 @@

var agent3 = app3.Services.GetRequiredService<SquadAgent>();
Console.WriteLine($"Agent name : {agent3.Name}");
Console.WriteLine("BYOK delegate registered — custom token + env var will be forwarded to Copilot SDK.");
Console.WriteLine("Client delegate registered — custom env var forwarded; signed-in authentication unchanged.");
Console.WriteLine("Sending : \"Ping\"");

var result3 = await RunWithErrorHandlingAsync(async () =>
Expand Down Expand Up @@ -567,5 +596,3 @@ static async ValueTask DisposeIfNeeded(SquadAgent agent)
}




Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<ProjectReference Include="..\..\Squad.Agents.AI.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.12" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.12" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.12" />
</ItemGroup>
</Project>
Loading