Documentation
¶
Index ¶
- func New(envConfig *config.EnvConfig) (*http.Server, error)
- func Run(envConfig *config.EnvConfig) error
- func SetVersion(v string)
- type AddModelRequest
- type AvailableModel
- type AvailableModelListResponse
- type BackupResponse
- type BulkFileRequest
- type BulkFileResponse
- type ChatCompletionChoice
- type ChatCompletionRequest
- type ChatCompletionResponse
- type ChatDelta
- type ChatMessage
- type ConfiguredModel
- type ConfiguredModelListResponse
- type ContentPart
- type ContextIndex
- type ContextKnowledgeGraph
- type ContextProject
- type ContextResponse
- type EnvironmentRequest
- type EnvironmentResponse
- type ErrorResponse
- type FileInfo
- type FileRequest
- type FileResponse
- type FileResult
- type FileUploadResponse
- type GenerateRequest
- type GenerateResponse
- type HealthResponse
- type ListResponse
- type ModelInfo
- type ModelListResponse
- type OpenAIError
- type OpenAIErrorDetail
- type PreflightIssue
- type PreflightRequest
- type PreflightResponse
- type ProcessResponse
- type ProviderInfo
- type ProviderListResponse
- type ProviderRequest
- type RestoreRequest
- type Server
- type SuccessResponse
- type UpdateModelRequest
- type UsageInfo
- type ValidateRequest
- type ValidateResponse
- type ValidationIssue
- type YAMLRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetVersion ¶ added in v0.0.208
func SetVersion(v string)
SetVersion sets the version string reported by the /health endpoint
Types ¶
type AddModelRequest ¶ added in v0.0.24
type AddModelRequest struct {
Name string `json:"name"`
Target string `json:"target,omitempty"`
Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}
AddModelRequest is the request body for adding a model to a provider's configuration
type AvailableModel ¶ added in v0.0.24
type AvailableModel struct {
Name string `json:"name"`
Description string `json:"description,omitempty"` // Optional description if available
}
AvailableModel represents a model available from the provider's service
type AvailableModelListResponse ¶ added in v0.0.24
type AvailableModelListResponse struct {
Success bool `json:"success"`
Models []AvailableModel `json:"models"`
Error string `json:"error,omitempty"`
}
AvailableModelListResponse is the response for listing available models from a provider
type BackupResponse ¶ added in v0.0.8
type BackupResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Filename string `json:"filename,omitempty"`
}
BackupResponse represents a response for backup operations
type BulkFileRequest ¶ added in v0.0.8
type BulkFileRequest struct {
Files []FileRequest `json:"files"`
}
BulkFileRequest represents a request for bulk file operations
type BulkFileResponse ¶ added in v0.0.8
type BulkFileResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Results []FileResult `json:"results,omitempty"`
}
BulkFileResponse represents a response for bulk file operations
type ChatCompletionChoice ¶ added in v0.0.84
type ChatCompletionChoice struct {
Index int `json:"index"`
Message *ChatMessage `json:"message,omitempty"`
Delta *ChatDelta `json:"delta,omitempty"`
FinishReason *string `json:"finish_reason"`
}
ChatCompletionChoice represents a single completion choice
type ChatCompletionRequest ¶ added in v0.0.84
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
Stream bool `json:"stream,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
MaxTokens *int `json:"max_tokens,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
PresencePenalty *float64 `json:"presence_penalty,omitempty"`
Stop []string `json:"stop,omitempty"`
User string `json:"user,omitempty"`
}
ChatCompletionRequest represents the OpenAI chat completion request
type ChatCompletionResponse ¶ added in v0.0.84
type ChatCompletionResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []ChatCompletionChoice `json:"choices"`
Usage UsageInfo `json:"usage"`
}
ChatCompletionResponse represents the non-streaming response
type ChatDelta ¶ added in v0.0.84
type ChatDelta struct {
Role string `json:"role,omitempty"`
Content string `json:"content,omitempty"`
}
ChatDelta represents incremental content in streaming
type ChatMessage ¶ added in v0.0.84
type ChatMessage struct {
Role string `json:"role"`
Content interface{} `json:"content"` // string or []ContentPart
RawContent string `json:"-"` // Extracted text content
}
ChatMessage represents a message in the conversation Content can be a string or an array of content parts (for multi-modal)
func (*ChatMessage) GetTextContent ¶ added in v0.0.84
func (m *ChatMessage) GetTextContent() string
GetTextContent extracts the text content from the message Handles both string content and array of content parts
type ConfiguredModel ¶ added in v0.0.24
type ConfiguredModel struct {
Name string `json:"name"`
Target string `json:"target,omitempty"`
Type string `json:"type"` // e.g., "local", "external"
Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}
ConfiguredModel represents a model as configured within Comanda
type ConfiguredModelListResponse ¶ added in v0.0.24
type ConfiguredModelListResponse struct {
Success bool `json:"success"`
Models []ConfiguredModel `json:"models"`
Error string `json:"error,omitempty"`
}
ConfiguredModelListResponse is the response for listing models configured for a provider
type ContentPart ¶ added in v0.0.84
ContentPart represents a part of multi-modal content
type ContextIndex ¶ added in v0.0.211
type ContextIndex struct {
ID string `json:"id"`
ProjectID string `json:"project_id"`
SourceRoot string `json:"source_root"`
IndexPath string `json:"index_path"`
Status string `json:"status"`
LastIndexed string `json:"last_indexed,omitempty"`
ContentHash string `json:"content_hash,omitempty"`
FileCount int `json:"file_count"`
SizeBytes int64 `json:"size_bytes"`
Encrypted bool `json:"encrypted"`
Languages string `json:"languages,omitempty"`
}
ContextIndex is the Canvas-facing metadata for a registered codebase index.
type ContextKnowledgeGraph ¶ added in v0.0.211
type ContextKnowledgeGraph struct {
ID string `json:"id"`
ProjectID string `json:"project_id"`
IndexID string `json:"index_id"`
Status string `json:"status"`
NodeCount int `json:"node_count"`
EdgeCount int `json:"edge_count"`
}
ContextKnowledgeGraph describes the graph that belongs to an index/project.
type ContextProject ¶ added in v0.0.211
type ContextProject struct {
ID string `json:"id"`
Name string `json:"name"`
SourceRoot string `json:"source_root"`
Available bool `json:"available"`
}
ContextProject is a project that the server can resolve without accepting a client-provided absolute path. Today projects are backed by registered indexes; that gives an existing Comanda installation a useful, safe default.
type ContextResponse ¶ added in v0.0.211
type ContextResponse struct {
APIVersion int `json:"api_version"`
Capabilities []string `json:"capabilities"`
Projects []ContextProject `json:"projects"`
Indexes []ContextIndex `json:"indexes"`
KnowledgeGraphs []ContextKnowledgeGraph `json:"knowledge_graphs"`
}
type EnvironmentRequest ¶ added in v0.0.8
type EnvironmentRequest struct {
Password string `json:"password"`
}
EnvironmentRequest represents a request for environment operations
type EnvironmentResponse ¶ added in v0.0.8
type EnvironmentResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
}
EnvironmentResponse represents a response for environment operations
type ErrorResponse ¶ added in v0.0.24
type ErrorResponse struct {
Success bool `json:"success"` // Should always be false
Error string `json:"error"`
}
ErrorResponse represents a generic error API response
type FileInfo ¶ added in v0.0.8
type FileInfo struct {
Name string `json:"name"`
Path string `json:"path"`
Size int64 `json:"size"`
IsDir bool `json:"isDir"`
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
Methods string `json:"methods,omitempty"`
}
FileInfo represents detailed information about a file
type FileRequest ¶ added in v0.0.8
FileRequest represents a request to create/edit a file
type FileResponse ¶ added in v0.0.8
type FileResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
File FileInfo `json:"file,omitempty"`
}
FileResponse represents a response for file operations
type FileResult ¶ added in v0.0.8
type FileResult struct {
Path string `json:"path"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
FileResult represents the result of a single file operation
type FileUploadResponse ¶ added in v0.0.14
type FileUploadResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
File FileInfo `json:"file,omitempty"`
}
FileUploadResponse represents a response for file upload operations
type GenerateRequest ¶ added in v0.0.35
GenerateRequest represents the request body for the generate endpoint
type GenerateResponse ¶ added in v0.0.35
type GenerateResponse struct {
Success bool `json:"success"`
YAML string `json:"yaml,omitempty"`
Error string `json:"error,omitempty"`
Model string `json:"model,omitempty"`
}
GenerateResponse represents the response for the generate endpoint
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
Timestamp string `json:"timestamp"`
Version string `json:"version,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
}
HealthResponse represents the health check response
type ListResponse ¶
type ListResponse struct {
Success bool `json:"success"`
Files []FileInfo `json:"files"`
Error string `json:"error,omitempty"`
}
ListResponse represents the response for file listing
type ModelInfo ¶ added in v0.0.84
type ModelInfo struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
}
ModelInfo represents model information for /v1/models
type ModelListResponse ¶ added in v0.0.84
ModelListResponse represents the models list response
type OpenAIError ¶ added in v0.0.84
type OpenAIError struct {
Error OpenAIErrorDetail `json:"error"`
}
OpenAIError represents an error response
type OpenAIErrorDetail ¶ added in v0.0.84
type OpenAIErrorDetail struct {
Message string `json:"message"`
Type string `json:"type"`
Param *string `json:"param"`
Code *string `json:"code"`
}
OpenAIErrorDetail represents the error details
type PreflightIssue ¶ added in v0.0.211
type PreflightRequest ¶ added in v0.0.211
type PreflightResponse ¶ added in v0.0.211
type PreflightResponse struct {
Ready bool `json:"ready"`
Project *ContextProject `json:"project,omitempty"`
ResolvedSourceRoot string `json:"resolved_source_root,omitempty"`
RuntimeDir string `json:"runtime_dir,omitempty"`
Issues []PreflightIssue `json:"issues"`
}
type ProcessResponse ¶
type ProcessResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Output string `json:"output,omitempty"`
}
ProcessResponse represents the response for process operations
type ProviderInfo ¶ added in v0.0.8
type ProviderInfo struct {
Name string `json:"name"`
Models []string `json:"models"`
Enabled bool `json:"enabled"`
}
ProviderInfo represents information about a provider
type ProviderListResponse ¶ added in v0.0.8
type ProviderListResponse struct {
Success bool `json:"success"`
Providers []ProviderInfo `json:"providers"`
Error string `json:"error,omitempty"`
}
ProviderListResponse represents the response for provider listing
type ProviderRequest ¶ added in v0.0.8
type ProviderRequest struct {
Name string `json:"name"`
APIKey string `json:"apiKey"`
Models []string `json:"models,omitempty"`
Enabled bool `json:"enabled"`
}
ProviderRequest represents a request to modify a provider
type RestoreRequest ¶ added in v0.0.8
type RestoreRequest struct {
Backup string `json:"backup"`
}
RestoreRequest represents a request for restore operations
type Server ¶ added in v0.0.8
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
type SuccessResponse ¶ added in v0.0.24
type SuccessResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
}
SuccessResponse represents a generic successful API response
type UpdateModelRequest ¶ added in v0.0.24
UpdateModelRequest is the request body for updating a configured model's modes
type UsageInfo ¶ added in v0.0.84
type UsageInfo struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
}
UsageInfo represents token usage information
type ValidateRequest ¶ added in v0.0.208
type ValidateRequest struct {
Content string `json:"content"`
// CheckModels also validates model names against the models configured
// on this server (plus any detected CLI providers)
CheckModels bool `json:"checkModels,omitempty"`
}
ValidateRequest represents the request body for the validate endpoint
type ValidateResponse ¶ added in v0.0.208
type ValidateResponse struct {
Success bool `json:"success"`
Valid bool `json:"valid"`
Errors []ValidationIssue `json:"errors,omitempty"`
InvalidModels []string `json:"invalidModels,omitempty"`
Error string `json:"error,omitempty"`
}
ValidateResponse represents the response for the validate endpoint
type ValidationIssue ¶ added in v0.0.208
type ValidationIssue struct {
Line int `json:"line,omitempty"`
Field string `json:"field,omitempty"`
Message string `json:"message"`
Fix string `json:"fix,omitempty"`
}
ValidationIssue represents a single validation error with actionable feedback
type YAMLRequest ¶ added in v0.0.14
type YAMLRequest struct {
Content string `json:"content"`
Input string `json:"input"`
Streaming bool `json:"streaming"`
}
YAMLRequest represents a request for YAML operations