Documentation
¶
Index ¶
- type AskUserHandler
- type AskUserResponse
- type AskUserTool
- func (t *AskUserTool) Description() string
- func (t *AskUserTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)
- func (t *AskUserTool) Label() string
- func (t *AskUserTool) Name() string
- func (t *AskUserTool) Schema() map[string]any
- func (t *AskUserTool) SetHandler(h AskUserHandler)
- type FetchProvider
- type JinaFetchProvider
- type JinaProvider
- type Option
- type Question
- type SearchProvider
- type SearchResult
- type Task
- type TaskCreateTool
- func (t *TaskCreateTool) Description() string
- func (t *TaskCreateTool) Execute(_ context.Context, args json.RawMessage) (json.RawMessage, error)
- func (t *TaskCreateTool) Label() string
- func (t *TaskCreateTool) Name() string
- func (t *TaskCreateTool) Schema() map[string]any
- func (t *TaskCreateTool) SetNotifyFn(fn TaskNotifyFn)
- func (t *TaskCreateTool) Store() *TaskStore
- type TaskGetTool
- type TaskListTool
- type TaskNotifyFn
- type TaskSnapshot
- type TaskStatus
- type TaskStore
- func (s *TaskStore) Create(subject, description, activeForm string, metadata map[string]any) *Task
- func (s *TaskStore) Get(id string) (*Task, bool)
- func (s *TaskStore) List() []Task
- func (s *TaskStore) SetDir(dir string) error
- func (s *TaskStore) SetNotifyFn(fn TaskNotifyFn)
- func (s *TaskStore) Snapshot() TaskSnapshot
- func (s *TaskStore) Update(id string, opts UpdateOpts) (*Task, error)
- type TaskUpdateTool
- type TavilyFetchProvider
- type TavilyProvider
- type UpdateOpts
- type WebFetchTool
- type WebSearchTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AskUserHandler ¶
type AskUserHandler func(ctx context.Context, questions []Question) (*AskUserResponse, error)
AskUserHandler blocks until the user answers all questions. Returns answers and notes. Returns error on cancel or timeout.
type AskUserResponse ¶
type AskUserResponse struct {
Answers map[string]string // question text → answer
Notes map[string]string // question text → custom note (only for "Type something")
}
AskUserResponse carries answers and optional user notes (from custom input).
type AskUserTool ¶
type AskUserTool struct {
// contains filtered or unexported fields
}
AskUserTool lets the LLM ask the user structured questions.
func NewAskUser ¶
func NewAskUser() *AskUserTool
NewAskUser creates an AskUserTool with no handler (set later via SetHandler).
func (*AskUserTool) Description ¶
func (t *AskUserTool) Description() string
func (*AskUserTool) Execute ¶
func (t *AskUserTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)
func (*AskUserTool) Label ¶
func (t *AskUserTool) Label() string
func (*AskUserTool) Name ¶
func (t *AskUserTool) Name() string
func (*AskUserTool) Schema ¶
func (t *AskUserTool) Schema() map[string]any
func (*AskUserTool) SetHandler ¶
func (t *AskUserTool) SetHandler(h AskUserHandler)
SetHandler sets the UI callback. Must be called before the tool is used.
type FetchProvider ¶
FetchProvider performs web page content extraction.
type JinaFetchProvider ¶
type JinaProvider ¶
type JinaProvider struct {
APIKey string
Client *http.Client // nil uses default with 30s timeout
BaseURL string // default: https://s.jina.ai/
}
JinaProvider implements SearchProvider using the Jina search endpoint. It calls POST https://s.jina.ai/ with X-Respond-With: no-content to return only SERP metadata (title, URL, snippet) without full page content.
func (*JinaProvider) Search ¶
func (p *JinaProvider) Search(ctx context.Context, query string, maxResults int) ([]SearchResult, error)
type Question ¶
type Question struct {
Question string `json:"question"`
Header string `json:"header"`
Options []Option `json:"options"`
MultiSelect bool `json:"multiSelect"`
}
Question is a single question with selectable options.
type SearchProvider ¶
type SearchProvider interface {
Search(ctx context.Context, query string, maxResults int) ([]SearchResult, error)
}
SearchProvider performs web searches.
type SearchResult ¶
type SearchResult struct {
Title string `json:"title"`
URL string `json:"url"`
Snippet string `json:"content"`
}
SearchResult represents a single web search result.
type Task ¶
type Task struct {
ID string `json:"id"`
Subject string `json:"subject"`
Description string `json:"description,omitempty"`
ActiveForm string `json:"activeForm,omitempty"`
Status TaskStatus `json:"status"`
Owner string `json:"owner,omitempty"`
Blocks []string `json:"blocks"`
BlockedBy []string `json:"blockedBy"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Task is a single tracked work item.
type TaskCreateTool ¶
type TaskCreateTool struct {
// contains filtered or unexported fields
}
TaskCreateTool creates new tasks.
func (*TaskCreateTool) Description ¶
func (t *TaskCreateTool) Description() string
func (*TaskCreateTool) Execute ¶
func (t *TaskCreateTool) Execute(_ context.Context, args json.RawMessage) (json.RawMessage, error)
func (*TaskCreateTool) Label ¶
func (t *TaskCreateTool) Label() string
func (*TaskCreateTool) Name ¶
func (t *TaskCreateTool) Name() string
func (*TaskCreateTool) Schema ¶
func (t *TaskCreateTool) Schema() map[string]any
func (*TaskCreateTool) SetNotifyFn ¶
func (t *TaskCreateTool) SetNotifyFn(fn TaskNotifyFn)
SetNotifyFn registers the TUI notification callback (delegates to store).
func (*TaskCreateTool) Store ¶
func (t *TaskCreateTool) Store() *TaskStore
Store returns the underlying TaskStore (used for persistence wiring).
type TaskGetTool ¶
type TaskGetTool struct {
// contains filtered or unexported fields
}
TaskGetTool retrieves a single task by ID.
func (*TaskGetTool) Description ¶
func (t *TaskGetTool) Description() string
func (*TaskGetTool) Execute ¶
func (t *TaskGetTool) Execute(_ context.Context, args json.RawMessage) (json.RawMessage, error)
func (*TaskGetTool) Label ¶
func (t *TaskGetTool) Label() string
func (*TaskGetTool) Name ¶
func (t *TaskGetTool) Name() string
func (*TaskGetTool) Schema ¶
func (t *TaskGetTool) Schema() map[string]any
type TaskListTool ¶
type TaskListTool struct {
// contains filtered or unexported fields
}
TaskListTool lists all tasks.
func (*TaskListTool) Description ¶
func (t *TaskListTool) Description() string
func (*TaskListTool) Execute ¶
func (t *TaskListTool) Execute(_ context.Context, _ json.RawMessage) (json.RawMessage, error)
func (*TaskListTool) Label ¶
func (t *TaskListTool) Label() string
func (*TaskListTool) Name ¶
func (t *TaskListTool) Name() string
func (*TaskListTool) Schema ¶
func (t *TaskListTool) Schema() map[string]any
type TaskNotifyFn ¶
type TaskNotifyFn func(TaskSnapshot)
TaskNotifyFn is called after each store mutation with the latest snapshot.
type TaskSnapshot ¶
TaskSnapshot is a read-only snapshot of all tasks sent to the TUI.
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the lifecycle state of a task.
const ( TaskPending TaskStatus = "pending" TaskInProgress TaskStatus = "in_progress" TaskCompleted TaskStatus = "completed" )
type TaskStore ¶
type TaskStore struct {
// contains filtered or unexported fields
}
TaskStore is a thread-safe task store with optional file persistence.
func NewTaskTools ¶
NewTaskTools creates a TaskStore and the four task tools that share it.
func (*TaskStore) SetDir ¶
SetDir enables file persistence. It creates the directory if needed and loads any existing tasks from disk. Call before the store is used.
func (*TaskStore) SetNotifyFn ¶
func (s *TaskStore) SetNotifyFn(fn TaskNotifyFn)
SetNotifyFn registers a callback invoked after every mutation.
func (*TaskStore) Snapshot ¶
func (s *TaskStore) Snapshot() TaskSnapshot
Snapshot returns the current read-only snapshot (public, for initial TUI state).
type TaskUpdateTool ¶
type TaskUpdateTool struct {
// contains filtered or unexported fields
}
TaskUpdateTool modifies an existing task.
func (*TaskUpdateTool) Description ¶
func (t *TaskUpdateTool) Description() string
func (*TaskUpdateTool) Execute ¶
func (t *TaskUpdateTool) Execute(_ context.Context, args json.RawMessage) (json.RawMessage, error)
func (*TaskUpdateTool) Label ¶
func (t *TaskUpdateTool) Label() string
func (*TaskUpdateTool) Name ¶
func (t *TaskUpdateTool) Name() string
func (*TaskUpdateTool) Schema ¶
func (t *TaskUpdateTool) Schema() map[string]any
type TavilyFetchProvider ¶
type TavilyProvider ¶
type TavilyProvider struct {
APIKey string
Client *http.Client // nil uses default with 30s timeout
}
TavilyProvider implements SearchProvider using the Tavily API.
func (*TavilyProvider) Search ¶
func (p *TavilyProvider) Search(ctx context.Context, query string, maxResults int) ([]SearchResult, error)
type UpdateOpts ¶
type UpdateOpts struct {
Status *TaskStatus
Subject *string
Description *string
ActiveForm *string
Owner *string
Metadata map[string]any // merged; nil-valued keys are deleted
AddBlocks []string
AddBlockedBy []string
}
UpdateOpts describes optional fields to update.
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool fetches web content and returns markdown.
func NewWebFetch ¶
func NewWebFetch(providerName, apiKey string) *WebFetchTool
NewWebFetch creates a WebFetchTool for the configured provider. Supported providers: tavily, jina.
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
func (*WebFetchTool) Execute ¶
func (t *WebFetchTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)
func (*WebFetchTool) Label ¶
func (t *WebFetchTool) Label() string
func (*WebFetchTool) Name ¶
func (t *WebFetchTool) Name() string
func (*WebFetchTool) Schema ¶
func (t *WebFetchTool) Schema() map[string]any
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool provides web search capability.
func NewWebSearch ¶
func NewWebSearch(providerName, apiKey string) *WebSearchTool
NewWebSearch creates a WebSearchTool for the configured provider. Supported providers: tavily, jina.
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)
func (*WebSearchTool) Label ¶
func (t *WebSearchTool) Label() string
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
func (*WebSearchTool) Schema ¶
func (t *WebSearchTool) Schema() map[string]any