You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-8Lines changed: 52 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@
7
7
8
8
SharpClaw Code is a C# and .NET-native coding agent runtime for teams building AI developer tools, agentic CLIs, and MCP-enabled workflows.
9
9
10
-
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.
10
+
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.
11
11
12
-
## What SharpClaw Code Is
12
+
## What It Is
13
13
14
14
SharpClaw Code is an open-source runtime for building and operating coding-agent experiences in the .NET ecosystem.
-**Safety by default**: permission modes, approval gates, workspace-boundary enforcement, and mediated tool execution
29
29
-**Extensible surface**: providers, MCP servers, plugins, skills, ACP hosting, and runtime commands integrate through explicit seams
30
-
-**Good fit for automation**: JSON-friendly command output, stable operational commands, and a clean CLI-first workflow
30
+
-**Automation-ready interface**: stable JSONoutput, operational commands, and a clean CLI-first workflow that works for both humans and scripts
31
31
32
32
## Quick Start
33
33
@@ -71,6 +71,23 @@ dotnet run --project src/SharpClaw.Code.Cli -- --output-format json doctor
71
71
72
72
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.
73
73
74
+
Parity-oriented commands now include:
75
+
76
+
-`models` / `/models`
77
+
-`usage` / `/usage`
78
+
-`cost` / `/cost`
79
+
-`stats` / `/stats`
80
+
-`connect` / `/connect`
81
+
-`hooks` / `/hooks`
82
+
-`skills` / `/skills`
83
+
-`agents` / `/agents`
84
+
-`todo` / `/todo`
85
+
-`share` / `/share`
86
+
-`unshare` / `/unshare`
87
+
-`compact` / `/compact`
88
+
-`serve` / `/serve`
89
+
-`/sessions` as a friendlier alias over `/session list`
90
+
74
91
Primary workflow modes:
75
92
76
93
-`build`: normal coding-agent execution
@@ -89,14 +106,18 @@ Primary workflow modes:
89
106
| Structured telemetry | Emit runtime events and usage signals that support diagnostics, replay, and automation |
90
107
| JSON-friendly CLI | Use the same runtime through human-readable terminal flows or machine-readable command output |
91
108
| Spec workflow mode | Turn prompts into structured requirements, technical design, and task documents for feature proposals |
109
+
| Embedded local server | Expose prompt, session, status, doctor, and share endpoints for editor or automation clients |
110
+
| Config + agent catalog | Layer user/workspace JSONC config with typed agent defaults, tool allowlists, and runtime hooks |
111
+
| Session sharing | Create self-hosted share links and durable sanitized share snapshots under `.sharpclaw/`|
112
+
| Diagnostics context | Surface configured diagnostics sources into prompt context, status, and machine-readable output |
92
113
93
114
## Good Fit For
94
115
95
116
- building a **C# AI coding assistant**
96
117
- running a **local or hosted coding-agent CLI**
97
118
- creating a **.NET MCP client/runtime**
98
119
- adding **session persistence and auditability** to agent workflows
99
-
-experimenting with**Agent Framework-backed orchestration** without pushing core runtime logic into the framework layer
120
+
-building on**Microsoft Agent Framework** without pushing your application core into framework-specific code
100
121
101
122
## Solution Layout
102
123
@@ -145,8 +166,9 @@ dotnet test SharpClawCode.sln --filter "FullyQualifiedName~ParityScenarioTests"
145
166
|`--output-format text\|json`| Human-readable or structured output |
146
167
|`--primary-mode <mode>`| Workflow bias for prompts: `build`, `plan`, or `spec`|
147
168
|`--session <id>`| Reuse a specific SharpClaw session id for prompt execution |
169
+
|`--agent <id>`| Select the active agent for prompt execution |
148
170
149
-
Subcommands include `prompt`, `repl`, `doctor`, `status`, `session`, `commands`, `mcp`, `plugins`, `acp`, `bridge`, and `version`.
SharpClaw Code uses the standard .NET configuration stack (`appsettings.json`, environment variables, CLI args). Key configuration sections:
192
+
SharpClaw Code uses both the standard .NET configuration stack (`appsettings.json`, environment variables, CLI args) and layered SharpClaw JSONC config files:
193
+
194
+
- user config: `~/.config/sharpclaw/config.jsonc` on Unix-like systems
195
+
- Windows user config: `%AppData%\\SharpClaw\\config.jsonc`
@@ -177,13 +209,25 @@ SharpClaw Code uses the standard .NET configuration stack (`appsettings.json`, e
177
209
|`SharpClaw:Web`| Web search provider name, endpoint template, user agent |
178
210
|`SharpClaw:Telemetry`| Runtime event ring buffer capacity |
179
211
212
+
Key `sharpclaw.jsonc` capabilities:
213
+
214
+
-`shareMode`: `manual`, `auto`, or `disabled`
215
+
-`server`: host, port, and optional public base URL for share links
216
+
-`defaultAgentId`: default prompt agent
217
+
-`agents`: typed agent catalog entries with model defaults, tool allowlists, and instruction appendices
218
+
-`lspServers`: configured diagnostics sources
219
+
-`hooks`: lifecycle hooks for turn/tool/share/server events
220
+
-`connectLinks`: browser entry points for provider or external auth flows
221
+
180
222
All options are validated at startup via `IValidateOptions` implementations.
181
223
182
224
## Current Scope
183
225
184
226
- The shared tooling layer is permission-aware across the runtime.
185
-
- The current Agent Framework bridge is focused on provider-backed runs rather than a full tool-calling loop inside the framework path.
186
-
- Operational commands support stable JSON output via `--output-format json`, which makes them useful in scripts and automation.
227
+
- The current runtime includes multi-turn provider-backed tool execution, session-backed prompt replay, and durable conversation history.
228
+
- Agent-driven tool calls flow through the same approval and allowlist enforcement path used by direct tool execution, including caller-aware interactive approval behavior.
229
+
- Operational commands support stable JSON output via `--output-format json`, which makes them suitable for scripts, editors, and automation.
230
+
- The embedded server exposes local JSON and SSE endpoints for prompts, sessions, sharing, status, and doctor flows.
Copy file name to clipboardExpand all lines: docs/architecture.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Test projects: **UnitTests**, **IntegrationTests**, **MockProvider**, **ParityHa
40
40
4.**`SharpClawAgentBase`** delegates to **`AgentFrameworkBridge.RunAsync`**, which drives **`ProviderBackedAgentKernel`** (streaming `IModelProvider`, auth checks, **`ProviderExecutionException`** on hard failures).
41
41
5. Turn completion updates session, checkpoints as implemented in **`ConversationRuntime`**, publishes events via **`IRuntimeEventPublisher`**.
42
42
43
-
**Note:**`AgentRunContext` carries **`IToolExecutor`**, but the current **`AgentFrameworkBridge`** path does not attach SharpClaw tools to the Microsoft Agent Framework chat loop; **`AgentRunResult.ToolResults`** is empty in that bridge. Tools are still fully usable via **`IToolExecutor`** (tests and parity harness call it directly).
43
+
**Note:**`AgentRunContext` carries **`IToolExecutor`**, and the current **`AgentFrameworkBridge`** path advertises the resolved tool set to the provider, executes tool calls through the permission-aware executor, and records tool results in the agent run result. Prompt references and tool approvals respect the caller's normalized interactivity mode.
- persisted active-agent metadata from the session, when present
23
+
- auto-share policy checks (`ShareMode.Auto`)
24
+
18
25
The agent stack is described in [agents.md](agents.md).
19
26
20
27
## Lifecycle and state
@@ -24,7 +31,9 @@ The agent stack is described in [agents.md](agents.md).
24
31
25
32
## Context assembly
26
33
27
-
**`PromptContextAssembler`** pulls workspace/session-aware data (skills registry, memory hooks, git context as wired today) into the prompt path before the agent runs.
34
+
**`PromptContextAssembler`** pulls workspace/session-aware data (skills registry, todo state, memory hooks, git context as wired today) into the prompt path before the agent runs.
35
+
36
+
It also includes a compact diagnostics summary from **`IWorkspaceDiagnosticsService`**, which currently surfaces configured diagnostics sources and build-derived findings for .NET workspaces.
28
37
29
38
When the effective **`PrimaryMode`** is **`Spec`**, the assembler appends a structured output contract that requires the model to return machine-readable requirements, design, and task content.
30
39
@@ -50,6 +59,41 @@ Each spec-mode prompt creates a fresh folder. If the same slug already exists, t
50
59
51
60
Used by **`GetStatusAsync`**, **`RunDoctorAsync`**, and **`InspectSessionAsync`** to build **Protocol** reports (`DoctorReport`, `RuntimeStatusReport`, `SessionInspectionReport`).
52
61
62
+
`RuntimeStatusReport` now also carries:
63
+
64
+
- configured diagnostics source count
65
+
- current diagnostic error count
66
+
- current diagnostic warning count
67
+
68
+
## Config, agents, and hooks
69
+
70
+
The parity layer adds several runtime-owned services:
71
+
72
+
-**`ISharpClawConfigService`** — loads user/workspace `config.jsonc` + `sharpclaw.jsonc` and merges them by precedence
73
+
-**`IAgentCatalogService`** — overlays configured specialist agents on top of built-in agents
74
+
-**`IConversationCompactionService`** — creates durable session summaries stored in session metadata
75
+
-**`IShareSessionService`** — creates and removes self-hosted share snapshots
76
+
-**`IHookDispatcher`** — executes configured hook processes for turn/tool/share/server events and exposes hook inspection/testing
77
+
-**`ITodoService`** — persists session and workspace todo items under session metadata and `.sharpclaw/tasks.json`
78
+
-**`IWorkspaceInsightsService`** — reconstructs durable usage, cost, and execution stats from persisted event logs
79
+
80
+
These services are intentionally small and runtime-owned rather than separate orchestration subsystems.
81
+
82
+
## Embedded server
83
+
84
+
**`IWorkspaceHttpServer`** / **`WorkspaceHttpServer`** expose a minimal local HTTP surface for editor and automation clients:
85
+
86
+
-`POST /v1/prompt`
87
+
-`GET /v1/sessions`
88
+
-`GET /v1/sessions/{id}`
89
+
-`POST /v1/share/{sessionId}`
90
+
-`DELETE /v1/share/{sessionId}`
91
+
-`GET /v1/status`
92
+
-`GET /v1/doctor`
93
+
-`GET /s/{shareId}`
94
+
95
+
Prompt requests can return JSON or replay the completed runtime event stream as SSE.
96
+
53
97
## Hosted service
54
98
55
99
**`RuntimeCoordinatorHostedServiceAdapter`** is registered as **`IHostedService`** and currently logs start/stop only (placeholder for future lifecycle coordination).
@@ -62,3 +106,7 @@ Used by **`GetStatusAsync`**, **`RunDoctorAsync`**, and **`InspectSessionAsync`*
0 commit comments