focus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package focus stores scoped context used to steer an agent session.

Index

Constants

View Source
const (
	FileName       = "focus.json"
	MaxFileBytes   = 16 * 1024
	MaxDirChildren = 100
)

Variables

This section is empty.

Functions

func Path

func Path(workspace string) string

func RenderPrompt

func RenderPrompt(workspace string) string

func RenderText

func RenderText(w io.Writer, report Report)

func Save

func Save(workspace string, state State) error

Types

type Entry

type Entry struct {
	Path      string `json:"path"`
	Kind      string `json:"kind"`
	Exists    bool   `json:"exists"`
	Lines     int    `json:"lines,omitempty"`
	Chars     int    `json:"chars,omitempty"`
	Truncated bool   `json:"truncated,omitempty"`
}

type Report

type Report struct {
	Kind    string  `json:"kind"`
	Action  string  `json:"action"`
	Total   int     `json:"total"`
	Entries []Entry `json:"entries"`
}

func Add

func Add(workspace string, paths []string) (Report, error)

func BuildReport

func BuildReport(workspace string) (Report, error)

func Clear

func Clear(workspace string) (Report, error)

func Remove

func Remove(workspace string, paths []string) (Report, error)

type State

type State struct {
	Kind      string    `json:"kind"`
	Workspace string    `json:"workspace"`
	UpdatedAt time.Time `json:"updated_at"`
	Entries   []Entry   `json:"entries"`
}

func Load

func Load(workspace string) (State, error)

Jump to

Keyboard shortcuts

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