focus

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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