Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
822cc63
feat(protocol): add ChatMessage and ContentBlock models for conversat…
Telli Apr 11, 2026
6fa6ce6
feat(protocol): extend ProviderRequest with Messages/Tools, ProviderE…
Telli Apr 11, 2026
6e7467a
feat(providers): Anthropic adapter extracts tool-use blocks and accep…
Telli Apr 11, 2026
a868c13
feat(providers): OpenAI adapter extracts tool calls and accepts messa…
Telli Apr 11, 2026
cad2009
feat(agents): add ToolCallDispatcher to bridge tool-use events to ITo…
Telli Apr 11, 2026
040d283
feat(agents): implement tool-calling loop in ProviderBackedAgentKernel
Telli Apr 11, 2026
f623d73
feat(runtime): assemble conversation history from session events with…
Telli Apr 11, 2026
2d7a1f1
build: add NuGet package metadata for publishing
Telli Apr 11, 2026
f89906c
ci: add GitHub Actions workflows for CI and NuGet release
Telli Apr 11, 2026
8c27ca4
docs: add getting started guide
Telli Apr 11, 2026
0fbddbf
docs: add Microsoft Agent Framework integration guide
Telli Apr 11, 2026
2a02159
docs: add example projects (minimal console, web API, custom tool agent)
Telli Apr 11, 2026
6347727
feat(telemetry): add OpenTelemetry spans, metrics, and NDJSON trace sink
Telli Apr 11, 2026
05a5ecf
feat(providers): add retry, rate-limit, and circuit-breaker resilience
Telli Apr 11, 2026
a5fb2b9
Address PR review comments
Telli Apr 13, 2026
8355c4f
feat: add parity config, server, sharing, and commands
Telli Apr 13, 2026
a25732f
Address PR #4 review comments
Telli Apr 14, 2026
f3f9c23
feat: expand parity workflows and harden agent runtime
Telli Apr 14, 2026
ef727c6
docs: refine README positioning
Telli Apr 14, 2026
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
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore SharpClawCode.sln
- name: Build
run: dotnet build SharpClawCode.sln --no-restore --configuration Release
- name: Test
run: dotnet test SharpClawCode.sln --no-build --configuration Release --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./coverage/**/coverage.cobertura.xml
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
tags: ['v*']

permissions:
contents: read
packages: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore SharpClawCode.sln
- name: Build
run: dotnet build SharpClawCode.sln --no-restore --configuration Release
- name: Test
run: dotnet test SharpClawCode.sln --no-build --configuration Release
- name: Pack
run: dotnet pack SharpClawCode.sln --no-build --configuration Release --output ./nupkg
- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@
<GenerateDocumentationFile Condition="'$(IsTestProject)' != 'true'">true</GenerateDocumentationFile>
<GenerateDocumentationFile Condition="'$(IsTestProject)' == 'true'">false</GenerateDocumentationFile>
<NoWarn Condition="'$(IsTestProject)' == 'true'">1591;$(NoWarn)</NoWarn>
<Authors>clawdotnet</Authors>
<Company>clawdotnet</Company>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/clawdotnet/SharpClawCode</PackageProjectUrl>
<RepositoryUrl>https://github.com/clawdotnet/SharpClawCode</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright (c) 2025 clawdotnet</Copyright>
</PropertyGroup>
</Project>
60 changes: 52 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

SharpClaw Code is a C# and .NET-native coding agent runtime for teams building AI developer tools, agentic CLIs, and MCP-enabled workflows.

It combines durable sessions, permission-aware tool execution, provider abstraction, structured telemetry, and an automation-friendly command-line surface in a codebase designed for production-quality .NET systems, not toy demos.
It combines durable sessions, permission-aware tool execution, provider abstraction, structured telemetry, and an automation-friendly command-line surface in a runtime shaped for real .NET systems: explicit, testable, and operationally legible.

## What SharpClaw Code Is
## What It Is

SharpClaw Code is an open-source runtime for building and operating coding-agent experiences in the .NET ecosystem.

Expand All @@ -27,7 +27,7 @@ It is designed for:
- **Durable runtime model**: sessions, checkpoints, append-only event logs, export/import flows, and recovery-aware orchestration
- **Safety by default**: permission modes, approval gates, workspace-boundary enforcement, and mediated tool execution
- **Extensible surface**: providers, MCP servers, plugins, skills, ACP hosting, and runtime commands integrate through explicit seams
- **Good fit for automation**: JSON-friendly command output, stable operational commands, and a clean CLI-first workflow
- **Automation-ready interface**: stable JSON output, operational commands, and a clean CLI-first workflow that works for both humans and scripts

## Quick Start

Expand Down Expand Up @@ -71,6 +71,23 @@ dotnet run --project src/SharpClaw.Code.Cli -- --output-format json doctor

Built-in REPL slash commands include `/help`, `/status`, `/doctor`, `/session`, `/commands`, `/mode`, `/editor`, `/export`, `/undo`, `/redo`, and `/version`. Use `/help` to see the active command set, including discovered workspace custom commands.

Parity-oriented commands now include:

- `models` / `/models`
- `usage` / `/usage`
- `cost` / `/cost`
- `stats` / `/stats`
- `connect` / `/connect`
- `hooks` / `/hooks`
- `skills` / `/skills`
- `agents` / `/agents`
- `todo` / `/todo`
- `share` / `/share`
- `unshare` / `/unshare`
- `compact` / `/compact`
- `serve` / `/serve`
- `/sessions` as a friendlier alias over `/session list`

Primary workflow modes:

- `build`: normal coding-agent execution
Expand All @@ -89,14 +106,18 @@ Primary workflow modes:
| Structured telemetry | Emit runtime events and usage signals that support diagnostics, replay, and automation |
| JSON-friendly CLI | Use the same runtime through human-readable terminal flows or machine-readable command output |
| Spec workflow mode | Turn prompts into structured requirements, technical design, and task documents for feature proposals |
| Embedded local server | Expose prompt, session, status, doctor, and share endpoints for editor or automation clients |
| Config + agent catalog | Layer user/workspace JSONC config with typed agent defaults, tool allowlists, and runtime hooks |
| Session sharing | Create self-hosted share links and durable sanitized share snapshots under `.sharpclaw/` |
| Diagnostics context | Surface configured diagnostics sources into prompt context, status, and machine-readable output |

## Good Fit For

- building a **C# AI coding assistant**
- running a **local or hosted coding-agent CLI**
- creating a **.NET MCP client/runtime**
- adding **session persistence and auditability** to agent workflows
- experimenting with **Agent Framework-backed orchestration** without pushing core runtime logic into the framework layer
- building on **Microsoft Agent Framework** without pushing your application core into framework-specific code

## Solution Layout

Expand Down Expand Up @@ -145,8 +166,9 @@ dotnet test SharpClawCode.sln --filter "FullyQualifiedName~ParityScenarioTests"
| `--output-format text\|json` | Human-readable or structured output |
| `--primary-mode <mode>` | Workflow bias for prompts: `build`, `plan`, or `spec` |
| `--session <id>` | Reuse a specific SharpClaw session id for prompt execution |
| `--agent <id>` | Select the active agent for prompt execution |

Subcommands include `prompt`, `repl`, `doctor`, `status`, `session`, `commands`, `mcp`, `plugins`, `acp`, `bridge`, and `version`.
Subcommands include `prompt`, `repl`, `doctor`, `status`, `session`, `models`, `usage`, `cost`, `stats`, `connect`, `hooks`, `skills`, `agents`, `todo`, `share`, `unshare`, `compact`, `serve`, `commands`, `mcp`, `plugins`, `acp`, `bridge`, and `version`.

## Documentation Map

Expand All @@ -167,7 +189,17 @@ Subcommands include `prompt`, `repl`, `doctor`, `status`, `session`, `commands`,

## Configuration

SharpClaw Code uses the standard .NET configuration stack (`appsettings.json`, environment variables, CLI args). Key configuration sections:
SharpClaw Code uses both the standard .NET configuration stack (`appsettings.json`, environment variables, CLI args) and layered SharpClaw JSONC config files:

- user config: `~/.config/sharpclaw/config.jsonc` on Unix-like systems
- Windows user config: `%AppData%\\SharpClaw\\config.jsonc`
- workspace config: `<workspace>/sharpclaw.jsonc`

Precedence is:

`CLI args > workspace sharpclaw.jsonc > user config.jsonc > appsettings/environment defaults`

Key runtime configuration sections:

| Section | Purpose |
|---|---|
Expand All @@ -177,13 +209,25 @@ SharpClaw Code uses the standard .NET configuration stack (`appsettings.json`, e
| `SharpClaw:Web` | Web search provider name, endpoint template, user agent |
| `SharpClaw:Telemetry` | Runtime event ring buffer capacity |

Key `sharpclaw.jsonc` capabilities:

- `shareMode`: `manual`, `auto`, or `disabled`
- `server`: host, port, and optional public base URL for share links
- `defaultAgentId`: default prompt agent
- `agents`: typed agent catalog entries with model defaults, tool allowlists, and instruction appendices
- `lspServers`: configured diagnostics sources
- `hooks`: lifecycle hooks for turn/tool/share/server events
- `connectLinks`: browser entry points for provider or external auth flows

All options are validated at startup via `IValidateOptions` implementations.

## Current Scope

- The shared tooling layer is permission-aware across the runtime.
- The current Agent Framework bridge is focused on provider-backed runs rather than a full tool-calling loop inside the framework path.
- Operational commands support stable JSON output via `--output-format json`, which makes them useful in scripts and automation.
- The current runtime includes multi-turn provider-backed tool execution, session-backed prompt replay, and durable conversation history.
- Agent-driven tool calls flow through the same approval and allowlist enforcement path used by direct tool execution, including caller-aware interactive approval behavior.
- Operational commands support stable JSON output via `--output-format json`, which makes them suitable for scripts, editors, and automation.
- The embedded server exposes local JSON and SSE endpoints for prompts, sessions, sharing, status, and doctor flows.

## Contributing

Expand Down
Loading
Loading