integrations

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package integrations provides readers for external configuration and task sources. Supports claude.md, agents.md, td task management, and GitHub issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentsMDReader

type AgentsMDReader struct {
	// contains filtered or unexported fields
}

AgentsMDReader reads agents.md files for agent behavior configuration.

func NewAgentsMDReader

func NewAgentsMDReader(cfg *config.Config) *AgentsMDReader

NewAgentsMDReader creates a reader based on config.

func (*AgentsMDReader) Enabled

func (r *AgentsMDReader) Enabled() bool

Enabled reports whether agents.md integration is configured.

func (*AgentsMDReader) Name

func (r *AgentsMDReader) Name() string

Name returns the integration identifier.

func (*AgentsMDReader) Read

func (r *AgentsMDReader) Read(ctx context.Context, projectPath string) (*Result, error)

Read looks for agents.md or AGENTS.md and extracts behavior preferences.

type AggregatedResult

type AggregatedResult struct {
	// Results by reader name.
	Results map[string]*Result

	// AllTasks from all sources.
	AllTasks []TaskItem

	// AllHints from all sources.
	AllHints []Hint

	// CombinedContext for agent prompts.
	CombinedContext string

	// Errors encountered (non-fatal).
	Errors []ReaderError
}

AggregatedResult combines results from all integrations.

type ClaudeMDReader

type ClaudeMDReader struct {
	// contains filtered or unexported fields
}

ClaudeMDReader reads claude.md files for project context.

func NewClaudeMDReader

func NewClaudeMDReader(cfg *config.Config) *ClaudeMDReader

NewClaudeMDReader creates a reader based on config.

func (*ClaudeMDReader) Enabled

func (r *ClaudeMDReader) Enabled() bool

Enabled reports whether claude.md integration is configured.

func (*ClaudeMDReader) Name

func (r *ClaudeMDReader) Name() string

Name returns the integration identifier.

func (*ClaudeMDReader) Read

func (r *ClaudeMDReader) Read(ctx context.Context, projectPath string) (*Result, error)

Read looks for claude.md in project root and extracts context.

type GitHubReader

type GitHubReader struct {
	// contains filtered or unexported fields
}

GitHubReader integrates with GitHub issues via gh CLI.

func NewGitHubReader

func NewGitHubReader(cfg *config.Config) *GitHubReader

NewGitHubReader creates a reader based on config.

func (*GitHubReader) Close

func (r *GitHubReader) Close(ctx context.Context, projectPath string, issueNumber int) error

Close closes an issue.

func (*GitHubReader) Comment

func (r *GitHubReader) Comment(ctx context.Context, projectPath string, issueNumber int, body string) error

Comment adds a comment to an issue.

func (*GitHubReader) Enabled

func (r *GitHubReader) Enabled() bool

Enabled reports whether GitHub issue integration is configured.

func (*GitHubReader) Name

func (r *GitHubReader) Name() string

Name returns the integration identifier.

func (*GitHubReader) Read

func (r *GitHubReader) Read(ctx context.Context, projectPath string) (*Result, error)

Read fetches issues from GitHub using gh CLI.

type Hint

type Hint struct {
	Type    HintType // Type of hint
	Content string   // Hint content
	Source  string   // Where the hint came from
}

Hint is a lightweight suggestion from a config file.

type HintType

type HintType int

HintType categorizes hints.

const (
	HintTaskSuggestion HintType = iota // Suggested task to run
	HintConvention                     // Coding convention
	HintConstraint                     // Safety constraint
	HintContext                        // Background context
)

func (HintType) String

func (h HintType) String() string

String returns the machine-readable name of the hint type.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager coordinates multiple integration readers.

func NewManager

func NewManager(cfg *config.Config) *Manager

NewManager creates a manager with the configured integrations.

func (*Manager) ReadAll

func (m *Manager) ReadAll(ctx context.Context, projectPath string) (*AggregatedResult, error)

ReadAll gathers results from all enabled integrations.

type Reader

type Reader interface {
	// Name returns the integration identifier.
	Name() string

	// Enabled returns true if this integration is configured.
	Enabled() bool

	// Read loads data from the integration source.
	// Returns nil if the source doesn't exist (not an error).
	Read(ctx context.Context, projectPath string) (*Result, error)
}

Reader loads context and tasks from an integration source.

type ReaderError

type ReaderError struct {
	Reader string
	Err    error
}

ReaderError records a failed reader.

func (ReaderError) Error

func (e ReaderError) Error() string

Error returns a formatted error string identifying the failed reader.

type Result

type Result struct {
	// Context provides text to include in agent prompts.
	Context string

	// Tasks are work items from task sources (td, GitHub issues).
	Tasks []TaskItem

	// Hints are lightweight suggestions extracted from config files.
	Hints []Hint

	// Metadata holds source-specific data.
	Metadata map[string]any
}

Result holds data loaded from an integration.

type TDReader

type TDReader struct {
	// contains filtered or unexported fields
}

TDReader integrates with the td task management CLI.

func NewTDReader

func NewTDReader(cfg *config.Config) *TDReader

NewTDReader creates a reader based on config.

func (*TDReader) Assign

func (r *TDReader) Assign(ctx context.Context, projectPath, taskID string) error

Assign marks a task as assigned in td.

func (*TDReader) Complete

func (r *TDReader) Complete(ctx context.Context, projectPath, taskID string) error

Complete marks a task as done in td.

func (*TDReader) Enabled

func (r *TDReader) Enabled() bool

Enabled reports whether td integration is configured.

func (*TDReader) Name

func (r *TDReader) Name() string

Name returns the integration identifier.

func (*TDReader) Read

func (r *TDReader) Read(ctx context.Context, projectPath string) (*Result, error)

Read fetches tasks from td CLI.

type TaskItem

type TaskItem struct {
	ID          string            // Unique identifier (e.g., "td-abc123", "gh-42")
	Title       string            // Task title
	Description string            // Full description/body
	Priority    int               // Priority (higher = more important)
	Labels      []string          // Tags/labels
	Source      string            // Source name (e.g., "td", "github")
	Metadata    map[string]string // Source-specific fields
}

TaskItem represents a task from an external source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL