Documentation
¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaudeMessage ¶
ClaudeMessage represents a single message in a Claude API conversation.
type ClaudeRequest ¶
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"`
}
ClaudeRequest represents an outgoing Claude API request body.
type ClaudeResponse ¶
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"`
}
ClaudeResponse represents the Claude API response body with usage metadata.
type ContentBlock ¶
ContentBlock represents a single content block in a Claude response (text, image, etc.).