workspace

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 13 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 workspace reads what an agent run is told about its working directory: git state, platform and project instruction files.

Index

Constants

View Source
const MaxInstructionBytes = 32 << 10

MaxInstructionBytes caps the instruction files of one run together.

Variables

This section is empty.

Functions

func Platform

func Platform() string

Platform names the OS and architecture, with the distribution on Linux.

Types

type Git

type Git struct {
	Root string
	// Branch describes HEAD, such as "branch main (upstream origin/main, ahead 1)".
	Branch string
	// Status holds porcelain status lines; MoreStatus counts the ones left out.
	Status     []string
	MoreStatus int
	StatusErr  string
	Commits    []string
}

Git is a snapshot of the repository a directory belongs to.

func ReadGit

func ReadGit(ctx context.Context, dir string) (Git, bool)

ReadGit snapshots the repository of dir; false outside a repository. Each part that fails or times out is left out rather than failing the snapshot.

type InstructionFile

type InstructionFile struct {
	Path      string
	Content   string
	Truncated bool
}

InstructionFile is one instruction file as a run gets it. Truncated marks a file cut, or left out entirely, at MaxInstructionBytes.

func Instructions

func Instructions(workingDir, gitRoot, home, global string) []InstructionFile

Instructions reads the instruction files for workingDir, outermost first: global, then each directory from the top down to workingDir. The top is home when workingDir lies under it, else the git root, else workingDir.

Jump to

Keyboard shortcuts

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