ctx/internal/plugins/csharp/helper/protocol.go
Ricardo Carneiro 59cb2b5ddb feat(csharp): implement 'project' command via Roslyn helper
Replaces placeholder with full csharp@0.1.0 plugin. Adds helper/
package (locate, process, client, protocol) for JSON-RPC over stdio
to ctx-roslyn-helper. project.go finds .sln (fallback: single .csproj),
loads it, retrieves projectSummary, formats dense markdown with project
details, reference graph, and multi-targeting section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 19:31:00 -03:00

27 lines
785 B
Go

package helper
import "encoding/json"
// Request is a newline-delimited JSON-RPC request sent to the helper process.
type Request struct {
ID int `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
}
// Response is a newline-delimited JSON-RPC response from the helper process.
type Response struct {
ID int `json:"id"`
Result json.RawMessage `json:"result,omitempty"`
Error *RpcError `json:"error,omitempty"`
}
// RpcError is a structured error from the helper process.
type RpcError struct {
Code string `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}
func (e *RpcError) Error() string { return e.Code + ": " + e.Message }