Package proxy provides an HTTP proxy that sits between AI coding tools and
the Claude API. It intercepts requests to inject relevant project context
from mnemo's search index into the system prompt, and tracks token usage
from responses.
The proxy listens on a local port and forwards to the upstream Claude API,
adding an "X-Mnemo-Tracked" header to indicate context was injected.
type ClaudeRequest struct {
Model string `json:"model"`
Messages []ClaudeMessage `json:"messages"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
System string `json:"system,omitempty"`
Stream bool `json:"stream,omitempty"`
}
type ClaudeResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
Content []ContentBlock `json:"content"`
Model string `json:"model"`
Usage UsageInfo `json:"usage"`
}