loader

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package loader provides on-demand access to Copilot custom instruction files from local directories and GitHub repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instruction

type Instruction struct {
	Source  string // origin identifier (directory basename or owner/repo)
	Path    string // relative path within the source
	Content string // raw markdown content
	URI     string // MCP resource URI
}

Instruction represents a single instruction file.

type Loader

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

Loader provides on-demand access to instruction files.

func New

func New(cfg *config.Config, gh *github.Client) *Loader

New creates a Loader with its background syncer.

func (*Loader) ForceSync

func (l *Loader) ForceSync()

ForceSync triggers an immediate sync of all remote repos.

func (*Loader) Get

func (l *Loader) Get(uri string) (Instruction, bool)

Get returns a single instruction by URI.

func (*Loader) List

func (l *Loader) List() []Instruction

List returns all instructions. Local dirs are read from disk; repos from cache. When no dirs are configured, the current working directory is used as default so the server works out-of-the-box when run from a repository root.

func (*Loader) Start

func (l *Loader) Start(ctx context.Context)

Start begins background sync. Stop must be called to shut down.

func (*Loader) Stop

func (l *Loader) Stop()

Stop shuts down the background sync.

Jump to

Keyboard shortcuts

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