instruction

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package instruction discovers the project's instruction files (AGENTS.md and the files named in config, local or remote) and tracks which ones a session has already loaded, so each is injected into the prompt once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Instructions []string
}

type DefaultHTTPClient

type DefaultHTTPClient struct {
	Client *http.Client
}

func (*DefaultHTTPClient) Fetch

func (client *DefaultHTTPClient) Fetch(
	ctx context.Context, url string,
) ([]byte, error)

type FileSystem

type FileSystem interface {
	ExistsSafe(path string) bool
	ReadFileString(path string) (string, error)
	FindUp(target, start, stop string) ([]string, error)
	GlobUp(pattern, start, stop string) ([]string, error)
	Glob(pattern, cwd string) ([]string, error)
}

type Flags

type Flags struct {
	DisableClaudeCodePrompt bool
	DisableProjectConfig    bool
}

type Global

type Global struct {
	Config string
	Home   string
}

type HTTPClient

type HTTPClient interface {
	Fetch(ctx context.Context, url string) ([]byte, error)
}

type Instance

type Instance struct {
	Directory string
	Worktree  string
}

type OSFileSystem

type OSFileSystem struct{}

func (OSFileSystem) ExistsSafe

func (OSFileSystem) ExistsSafe(path string) bool

func (OSFileSystem) FindUp

func (filesystem OSFileSystem) FindUp(
	target, start, stop string,
) ([]string, error)

func (OSFileSystem) Glob

func (OSFileSystem) Glob(pattern, cwd string) ([]string, error)

func (OSFileSystem) GlobUp

func (filesystem OSFileSystem) GlobUp(
	pattern, start, stop string,
) ([]string, error)

func (OSFileSystem) ReadFileString

func (OSFileSystem) ReadFileString(path string) (string, error)

type Options

type Options struct {
	Config   Config
	Global   Global
	Instance Instance
	Flags    Flags
	FS       FileSystem
	HTTP     HTTPClient
}

type OrderedSet

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

func Loaded

func Loaded(messages []msgmodel.WithParts) *OrderedSet

func NewOrderedSet

func NewOrderedSet() *OrderedSet

func (*OrderedSet) Add

func (set *OrderedSet) Add(value string)

func (*OrderedSet) Has

func (set *OrderedSet) Has(value string) bool

func (*OrderedSet) Values

func (set *OrderedSet) Values() []string

type Resolved

type Resolved struct {
	Filepath string `json:"filepath"`
	Content  string `json:"content"`
}

type Service

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

func New

func New(options Options) *Service

func (*Service) Clear

func (service *Service) Clear(messageID string)

func (*Service) Find

func (service *Service) Find(dir string) *string

func (*Service) Resolve

func (service *Service) Resolve(
	messages []msgmodel.WithParts, file string, messageID string,
) []Resolved

func (*Service) System

func (service *Service) System(ctx context.Context) []string

func (*Service) SystemPaths

func (service *Service) SystemPaths() *OrderedSet

Jump to

Keyboard shortcuts

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