types

package
v0.2.49 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: GPL-2.0, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types defines checkpoint domain types shared between the checkpoint implementation and its consumers (api, hub). This leaf package has zero internal dependencies, breaking the api→checkpoint import cycle.

Index

Constants

This section is empty.

Variables

View Source
var ErrTagNotFound = errors.New("tag not found")

ErrTagNotFound is returned when a tag does not exist in the store. Separate from a generic error so the HTTP layer can map it to 404.

Functions

This section is empty.

Types

type BlobRef

type BlobRef struct {
	BeforeSHA string `json:"before_sha,omitempty"`
	AfterSHA  string `json:"after_sha,omitempty"`
}

BlobRef is the minimal struct for extracting blob SHA references from the event JSONL log. Shared between the checkpoint and gc packages to keep the JSON tag contract as a single source of truth.

type ConflictPayload

type ConflictPayload struct {
	Path        string `json:"path"`
	OtherChat   string `json:"other_chat"`
	ExpectedSHA string `json:"expected_sha"`
	ActualSHA   string `json:"actual_sha"`
	Tag         string `json:"tag"`
	TS          int64  `json:"ts"`
}

ConflictPayload is what the broadcaster receives per conflict.

type FileChange

type FileChange struct {
	Status       FileStatus `json:"status"`
	Path         string     `json:"path"`
	LinesAdded   int        `json:"lines_added"`
	LinesRemoved int        `json:"lines_removed"`
}

FileChange is one entry returned by Diff.

type FileStatus

type FileStatus string

FileStatus is a typed string for diff result statuses.

const (
	FileAdded    FileStatus = "A"
	FileModified FileStatus = "M"
	FileDeleted  FileStatus = "D"
)

FileAdded and the following constants define the valid FileStatus diff result values.

func (FileStatus) Valid

func (s FileStatus) Valid() bool

Valid reports whether s is one of the three known diff statuses.

type Tag

type Tag string

Tag is a validated checkpoint tag with grammar "N" or "N.K" where N is the turn number and K is the tool index within that turn.

func ParseTag

func ParseTag(s string) (Tag, error)

ParseTag validates and returns a Tag. Returns an error if the input doesn't match the "N" or "N.K" grammar.

func (Tag) String

func (t Tag) String() string

String returns the tag's string representation.

Jump to

Keyboard shortcuts

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