Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
type ChatRequest struct {
Prompt string `json:"prompt"`
SessionID string `json:"session_id,omitempty"`
Model string `json:"model,omitempty"`
MaxTurns int `json:"max_turns,omitempty"`
Autonomy string `json:"autonomy,omitempty"`
CWD string `json:"cwd,omitempty"`
Agent string `json:"agent,omitempty"`
}
ChatRequest is the JSON body for POST /v1/chat.
type ChatResponse ¶
type ChatResponse struct {
SessionID string `json:"session_id"`
Response string `json:"response"`
TokensIn int `json:"tokens_in"`
TokensOut int `json:"tokens_out"`
TurnsTaken int `json:"turns_taken"`
Duration string `json:"duration"`
}
ChatResponse is the JSON response from POST /v1/chat.
type Config ¶
type Config struct {
Port int `json:"port"`
Host string `json:"host"`
LogFile string `json:"log_file"`
}
Config holds daemon configuration.
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
Version string `json:"version"`
Uptime string `json:"uptime"`
Sessions int `json:"active_sessions"`
StartedAt string `json:"started_at"`
}
HealthResponse is the JSON response from GET /v1/health.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the hawk daemon HTTP server for programmatic/CI access.
func New ¶
func New(cfg Config, factory SessionFactory) *Server
New creates a new daemon server. If factory is nil, chat endpoint returns an error.
type Session ¶
type Session struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
LastUsed time.Time `json:"last_used"`
Turns int `json:"turns"`
CWD string `json:"cwd"`
}
Session tracks an active daemon session.
type SessionFactory ¶
type SessionFactory func(req ChatRequest) (*engine.Session, error)
SessionFactory creates a configured engine session for a given request. The caller (cmd package) provides this, wiring system prompts, tools, keys.
Click to show internal directories.
Click to hide internal directories.