Documentation
¶
Overview ¶
Package ai provides LLM-powered command interpretation for task management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Type CommandType `json:"type"`
TaskID int64 `json:"task_id,omitempty"`
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
Status string `json:"status,omitempty"`
Project string `json:"project,omitempty"`
Query string `json:"query,omitempty"`
Message string `json:"message,omitempty"` // Human-readable response
}
Command represents a parsed command from user input.
type CommandService ¶
type CommandService struct {
// contains filtered or unexported fields
}
CommandService handles AI command interpretation.
func NewCommandService ¶
func NewCommandService(apiKey string) *CommandService
NewCommandService creates a new command service.
func (*CommandService) InterpretCommand ¶
func (s *CommandService) InterpretCommand(ctx context.Context, input string, cmdCtx *Context) (*Command, error)
InterpretCommand uses an LLM to interpret a natural language command.
func (*CommandService) IsAvailable ¶
func (s *CommandService) IsAvailable() bool
IsAvailable returns true if the service has an API key.
type CommandType ¶
type CommandType string
CommandType represents the type of action to perform.
const ( CommandCreateTask CommandType = "create_task" CommandUpdateStatus CommandType = "update_status" CommandSelectTask CommandType = "select_task" CommandSearchTasks CommandType = "search_tasks" CommandUnknown CommandType = "unknown" )
type ProjectMetadata ¶ added in v0.3.0
type ProjectMetadata struct {
Name string `json:"name"`
Alias string `json:"alias"`
Description string `json:"description"`
}
ProjectMetadata is the structured result of inferring a project's identity.
func InferProjectMetadata ¶ added in v0.3.0
func InferProjectMetadata(dir, configDir string) (ProjectMetadata, error)
InferProjectMetadata shells out to `claude -p` (print mode) to infer a clean project name, short alias, and one-line description from the folder. It reuses the user's Claude CLI auth via CLAUDE_CONFIG_DIR (no API key), mirroring executor.RenameClaudeSession. Returns an error when claude is unavailable, times out, or returns unparseable output; callers MUST degrade gracefully.