Documentation
¶
Overview ¶
Package providers defines the provider interface and registry for productivity tools
Index ¶
- Constants
- Variables
- type Provider
- type ProviderCapabilities
- type ProviderInfo
- type ProviderStatus
- type Registry
- func (r *Registry) Count() int
- func (r *Registry) ExecuteTool(toolName string, params map[string]interface{}) (ToolResult, error)
- func (r *Registry) Get(name string) (Provider, error)
- func (r *Registry) GetActive() (Provider, error)
- func (r *Registry) GetActiveName() string
- func (r *Registry) HasProvider(name string) bool
- func (r *Registry) List() []ProviderInfo
- func (r *Registry) ListNames() []string
- func (r *Registry) Register(p Provider) error
- func (r *Registry) SetActive(name string) error
- type ToolResult
Constants ¶
const ( ErrNotImplemented = "tool not implemented by this provider" ErrNotAuthenticated = "provider not authenticated" ErrRateLimitExceeded = "rate limit exceeded" ErrInvalidParameters = "invalid tool parameters" )
Common error messages
Variables ¶
var ErrNoProvider = fmt.Errorf("no productivity provider configured. Run 'jeff auth google' to connect your Google account")
ErrNoProvider is returned when no provider is configured
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface {
// Metadata
Name() string // Provider name (e.g., "gmail", "outlook")
SupportedTools() []string // List of tool names this provider implements
// Lifecycle
Initialize(config map[string]string) error // Setup and configuration
Authenticate() error // Perform OAuth or other auth flow
Close() error // Cleanup resources
// Health (for future multi-provider routing)
Status() ProviderStatus // Current provider health status
Capabilities() ProviderCapabilities // Provider capabilities and limits
// Tool execution
ExecuteTool(toolName string, params map[string]interface{}) (ToolResult, error)
}
Provider is the interface that all productivity providers must implement Providers handle authentication and execution of productivity tools (email, calendar, tasks)
type ProviderCapabilities ¶
type ProviderCapabilities struct {
RateLimits map[string]int // tool_name -> calls per hour
Features []string // Feature flags (e.g., "attachments", "calendar_sharing")
MaxResults int // Maximum results for list/search operations
}
ProviderCapabilities describes what a provider can do
type ProviderInfo ¶
type ProviderInfo struct {
Name string // Provider name
Authenticated bool // Whether provider has valid credentials
Active bool // Whether this is the active provider
SupportedTools []string // Tools this provider implements
}
ProviderInfo contains metadata about a registered provider
type ProviderStatus ¶
type ProviderStatus struct {
Healthy bool // Whether provider is operational
Message string // Status message or error description
LastCheck time.Time // When status was last checked
}
ProviderStatus represents the current health status of a provider
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages available productivity providers
func (*Registry) ExecuteTool ¶
func (r *Registry) ExecuteTool(toolName string, params map[string]interface{}) (ToolResult, error)
ExecuteTool routes a tool call to the active provider
func (*Registry) GetActiveName ¶
GetActiveName returns the name of the currently active provider
func (*Registry) HasProvider ¶
HasProvider checks if a provider with the given name exists
func (*Registry) List ¶
func (r *Registry) List() []ProviderInfo
List returns information about all registered providers
type ToolResult ¶
type ToolResult struct {
Success bool `json:"success"` // Whether operation succeeded
Data interface{} `json:"data,omitempty"` // Result data (format varies by tool)
Error string `json:"error,omitempty"` // Error message if failed
Metadata map[string]interface{} `json:"metadata,omitempty"` // Additional provider-specific info
}
ToolResult is returned from tool execution
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gmail implements the Gmail productivity provider for Jeff
|
Package gmail implements the Gmail productivity provider for Jeff |
|
Package oauth provides OAuth2 authentication utilities for productivity providers
|
Package oauth provides OAuth2 authentication utilities for productivity providers |