Documentation
¶
Index ¶
- Constants
- Variables
- func HubCI(hub func() *forge.Remote, noHub error) http.HandlerFunc
- func InsideWorktreeVia(worktree string, calls []editCall, ...) (rels []string, outside int)
- func ResolveInsideMemo(worktree, realRoot, p string) (string, bool)
- func TurnsOf(path string) (*turnIndex, error)
- type ChangeFile
- type Changes
- type ChangesCut
- type ChangesView
- type Config
- type ForkSpec
- type PRRunner
- type Receipt
Constants ¶
const ( ChangesFilesMax = 400 ChangesHunksMax = 2 << 20 ChangesFileMax = 256 << 10 // listMax bounds the file lists git prints, which are paths and counts and never hunks. // PatchMax is what is read of one patch: the total hunk bound, a file that would be cut anyway, and slack. PatchMax = ChangesHunksMax + ChangesFileMax + 64<<10 )
Variables ¶
var ListMax = 16 << 20
ListMax is a variable so a test can use a small cap.
Functions ¶
func HubCI ¶
func HubCI(hub func() *forge.Remote, noHub error) http.HandlerFunc
HubCI is POST /v1/hub/ci: a CI question (atrium_ci) asked of the hub over the link. The room never runs a forge CLI, so a room with no hub answers noHub, and the hub's refusal is passed on as its own sentence.
func InsideWorktreeVia ¶
func ResolveInsideMemo ¶
Types ¶
type ChangeFile ¶
type ChangeFile struct {
Path string `json:"path"`
OldPath string `json:"old_path,omitempty"`
// Status is added, modified, deleted, renamed or binary.
Status string `json:"status"`
// Size is the byte size of an untracked file listed with no body.
Size int64 `json:"size,omitempty"`
Added int `json:"added"`
Removed int `json:"removed"`
// Hunks is the unified diff as text. Empty for a binary file, and for a file whose diff was
// over the bound, which HunksCut says.
Hunks string `json:"hunks"`
HunksCut bool `json:"hunks_cut,omitempty"`
// Via, in a `turn` answer, is where the file's change was found: `edits` (uncommitted) or
// `commits` (the turn committed it).
Via string `json:"via,omitempty"`
// Cumulative says the numbers include more than this turn: the transcript shows the file
// edited in another turn since the last commit.
Cumulative bool `json:"cumulative,omitempty"`
}
ChangeFile is one file in an answer.
type Changes ¶
type Changes struct {
Get func(id string) (*store.Task, error)
Transcript func(t *store.Task) string
ListMax int
}
Changes is what answering for one card reads from the daemon: the card, its transcript and the list bound.
type ChangesCut ¶
type ChangesCut struct {
// Files is how many files were left off the list.
Files int `json:"files"`
// Hunks is how many listed files carry counts and no hunks.
Hunks int `json:"hunks"`
Why string `json:"why"`
}
ChangesCut says what the bounds left out, so the view never claims to be the whole change.
type ChangesView ¶
type ChangesView struct {
// Against is head, base, or turn.
Against string `json:"against"`
// Note says why the answer is not the one asked for.
Note string `json:"note,omitempty"`
Base string `json:"base"`
Head string `json:"head"`
Dirty bool `json:"dirty"`
Total int `json:"total"`
Files []ChangeFile `json:"files"`
Cut *ChangesCut `json:"cut,omitempty"`
// Partial, Why and Outside are set on a `turn` answer. Outside counts edit paths that
// resolved outside the worktree. It never names them.
Partial *bool `json:"partial,omitempty"`
Why string `json:"why,omitempty"`
Outside int `json:"outside,omitempty"`
}
ChangesView is the answer, for a card or for one turn.
type Config ¶
type Config struct {
Fork func(ctx context.Context, spec ForkSpec) ([]byte, error)
UserSettings func() []byte
LeanArgs func(args []string, userSettings []byte, gateway string) ([]string, error)
ForkEnv func(extra, harnessEnv map[string]string)
ChildEnv func(base []string, harnessEnv map[string]string, atrium map[string]string) []string
Cost func(raw []byte) float64
OnAccess func(kind string, err error) bool
OnWorked func(kind, host string)
Hub func() *forge.Remote
HubSource func(ctx context.Context, name string) (string, func(), error)
}
Config is what the daemon passes in: the seams a run reads and the board alert hooks. See pulls_fork.go.
type ForkSpec ¶
type ForkSpec struct {
Exe string
Args []string
Dir string
Env []string
// Stdin is the prompt, too long for a command line.
Stdin []byte
// Timeout bounds the run.
Timeout time.Duration
}
ForkSpec is one claude call's command line. The daemon runs it, see pulls_fork.go.
type PRRunner ¶
type PRRunner struct {
// contains filtered or unexported fields
}
PRRunner is the daemon's PRRunner.
func (*PRRunner) Abort ¶
Abort cancels the run, which kills its forks. The API has already marked the row aborted and deletes the folder.
func (*PRRunner) Start ¶
Start moves a queued row to fetching and runs it in the background. A row that is not queued is somebody else's run and is left alone.
type Receipt ¶
type Receipt struct {
Subtype string `json:"subtype"`
IsError bool `json:"is_error"`
Result string `json:"result"`
NumTurns int `json:"num_turns"`
SessionID string `json:"session_id"`
PermissionDenials []json.RawMessage `json:"permission_denials"`
Usage *struct {
Input int64 `json:"input_tokens"`
CacheWrite int64 `json:"cache_creation_input_tokens"`
CacheRead int64 `json:"cache_read_input_tokens"`
Output int64 `json:"output_tokens"`
} `json:"usage"`
}
Receipt is the part of `claude -p --output-format json` a run reads.