Documentation
¶
Overview ¶
Package resolver provides name-to-ID resolution for Linear resources.
Resolves friendly names (e.g., "Engineering", "alice@company.com") to UUIDs with caching to improve performance.
Index ¶
- type Cache
- type ResolutionError
- type Resolver
- func (r *Resolver) ResolveCycle(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveDocument(ctx context.Context, titleOrID string) (string, error)
- func (r *Resolver) ResolveInitiative(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveIssue(ctx context.Context, identifierOrID string) (string, error)
- func (r *Resolver) ResolveLabel(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveMilestone(ctx context.Context, idOrName string) (string, error)
- func (r *Resolver) ResolveProject(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveProjectStatus(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveState(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveTeam(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveTemplate(ctx context.Context, nameOrID string) (string, error)
- func (r *Resolver) ResolveUser(ctx context.Context, nameOrEmailOrID string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides a file-backed TTL cache for name→ID resolution. Uses fido with local filesystem persistence to survive across MCP subprocess calls (ophis spawns new process per tool invocation).
func NewCache ¶
NewCache creates a new cache with the specified TTL. Uses fido with local filesystem persistence.
type ResolutionError ¶
type ResolutionError struct {
EntityType string // "team", "user", "label", etc.
Input string // What the user provided (safe to expose)
Reason string // User-facing reason
Suggestions []string // Actionable suggestions for the user
Internal error // Underlying error (for logging)
}
ResolutionError represents a name-to-ID resolution failure. Provides user-friendly messages while preserving internal context.
func (*ResolutionError) Error ¶
func (e *ResolutionError) Error() string
Error implements the error interface.
func (*ResolutionError) ToErrorContext ¶
func (e *ResolutionError) ToErrorContext(operation string) *linear.ErrorContext
ToErrorContext converts ResolutionError to linear.ErrorContext.
func (*ResolutionError) Unwrap ¶
func (e *ResolutionError) Unwrap() error
Unwrap returns the wrapped error.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves names to IDs for Linear resources.
func (*Resolver) ResolveCycle ¶
ResolveCycle resolves a cycle name to its ID. Accepts: cycle name or UUID.
func (*Resolver) ResolveDocument ¶
ResolveDocument resolves a document title to its ID. Accepts: document title or UUID.
func (*Resolver) ResolveInitiative ¶
ResolveInitiative resolves an initiative name to its ID. Accepts: initiative name or UUID.
func (*Resolver) ResolveIssue ¶
ResolveIssue resolves an issue identifier or ID to its UUID. Accepts: issue identifier (e.g., "ENG-123"), issue number, or UUID.
func (*Resolver) ResolveLabel ¶
ResolveLabel resolves a label name to its ID. Accepts: label name or UUID.
func (*Resolver) ResolveMilestone ¶
ResolveMilestone resolves a milestone ID. Currently only accepts UUIDs. Name-based resolution requires knowing the project. Use: go-linear project milestone-list <project> to find milestone UUIDs.
func (*Resolver) ResolveProject ¶
ResolveProject resolves a project name to its ID. Accepts: project name or UUID.
func (*Resolver) ResolveProjectStatus ¶
ResolveProjectStatus resolves a project status name to its ID. Accepts: status name (e.g., "Backlog", "In Progress", "Completed") or UUID. Shows available statuses in error message since they're organization-specific.
func (*Resolver) ResolveState ¶
ResolveState resolves a workflow state name to its ID. Accepts: state name, state type, common aliases (todo, done, etc.), or UUID. For aliases/types, only resolves if there's exactly one matching state. In multi-team workspaces with multiple matching states, returns an error with suggestions for disambiguation.
func (*Resolver) ResolveTeam ¶
ResolveTeam resolves a team name or key to its ID. Accepts: team name, team key, or UUID.
func (*Resolver) ResolveTemplate ¶
ResolveTemplate resolves a template name to its ID. Accepts: template name or UUID.