output

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "thr.cli/v2"

Variables

This section is empty.

Functions

func EncodeJSONV2 added in v0.1.24

func EncodeJSONV2(w io.Writer, envelope Envelope) error

func NewTable added in v0.1.24

func NewTable(w io.Writer) *tabwriter.Writer

func PrintForget

func PrintForget(w io.Writer, memory domain.Memory)

func PrintMemory

func PrintMemory(w io.Writer, memory domain.Memory)

func PrintMemoryAdded

func PrintMemoryAdded(w io.Writer, memory domain.Memory)

func PrintMemoryJSON

func PrintMemoryJSON(w io.Writer, memory domain.Memory) error

func PrintMemoryList

func PrintMemoryList(w io.Writer, memories []domain.Memory)

func PrintMemoryListJSON

func PrintMemoryListJSON(w io.Writer, memories []domain.Memory) error

func PrintSearchResults

func PrintSearchResults(w io.Writer, memories []domain.Memory)

func PrintSearchResultsJSON

func PrintSearchResultsJSON(w io.Writer, memories []domain.Memory) error

func PrintSemanticResults

func PrintSemanticResults(w io.Writer, results []store.SemanticHit, withDistance bool)

func PrintSemanticResultsJSON

func PrintSemanticResultsJSON(w io.Writer, results []store.SemanticHit) error

func PrintStats

func PrintStats(w io.Writer, stats Stats)

func PrintStatsJSON

func PrintStatsJSON(w io.Writer, stats Stats) error

func SanitizeInline added in v0.1.24

func SanitizeInline(value string) string

func ScopeMarker added in v0.1.24

func ScopeMarker(scope domain.Scope, assignment domain.ScopeAssignment) string

Types

type Context added in v0.1.24

type Context struct {
	Database          Database          `json:"database"`
	CWD               string            `json:"cwd"`
	ScopeSelection    *ScopeSelection   `json:"scope_selection,omitempty"`
	CurrentScope      *ContextScopeDTO  `json:"current_scope,omitempty"`
	ProspectiveScope  *ContextScopeDTO  `json:"prospective_scope,omitempty"`
	DefaultWriteScope *ContextScopeDTO  `json:"default_write_scope,omitempty"`
	DefaultReadScopes []ContextScopeDTO `json:"default_read_scopes,omitempty"`
	Resolution        *ResolutionDTO    `json:"resolution,omitempty"`
}

type ContextScopeDTO added in v0.1.24

type ContextScopeDTO struct {
	ID     *string `json:"id"`
	Kind   string  `json:"kind"`
	Label  string  `json:"label"`
	Status string  `json:"status"`
}

type Database added in v0.1.24

type Database struct {
	Path   string `json:"path"`
	Status string `json:"status"`
}

type Envelope added in v0.1.24

type Envelope struct {
	APIVersion string           `json:"api_version"`
	OK         bool             `json:"ok"`
	Command    string           `json:"command"`
	Context    Context          `json:"context"`
	Result     any              `json:"result"`
	Error      *StructuredError `json:"error"`
	Warnings   []Warning        `json:"warnings"`
}

type MatchDTO added in v0.1.24

type MatchDTO struct {
	Kind     string  `json:"kind"`
	Distance float64 `json:"distance"`
}

type MemoryDTO added in v0.1.24

type MemoryDTO struct {
	ID              string   `json:"id"`
	Text            string   `json:"text"`
	Scope           ScopeDTO `json:"scope"`
	ScopeAssignment string   `json:"scope_assignment"`
	CreatedAt       string   `json:"created_at"`
	UpdatedAt       string   `json:"updated_at"`
	ScopeUpdatedAt  string   `json:"scope_updated_at"`
	Revision        int64    `json:"revision"`
}

func NewMemoryDTO added in v0.1.24

func NewMemoryDTO(memory domain.Memory) MemoryDTO

type ResolutionDTO added in v0.1.24

type ResolutionDTO struct {
	Source string `json:"source"`
	Status string `json:"status"`
}

type ScopeDTO added in v0.1.24

type ScopeDTO struct {
	ID    string `json:"id"`
	Kind  string `json:"kind"`
	Label string `json:"label"`
}

func NewScopeDTO added in v0.1.24

func NewScopeDTO(scope domain.Scope) ScopeDTO

type ScopeSelection added in v0.1.24

type ScopeSelection struct {
	Mode      string   `json:"mode"`
	Requested []string `json:"requested"`
	Resolved  []string `json:"resolved"`
}

type SemanticMatchDTO added in v0.1.24

type SemanticMatchDTO struct {
	Rank   int       `json:"rank"`
	Memory MemoryDTO `json:"memory"`
	Match  MatchDTO  `json:"match"`
}

func NewSemanticMatchDTO added in v0.1.24

func NewSemanticMatchDTO(rank int, hit store.SemanticHit) SemanticMatchDTO

type Stats

type Stats struct {
	DBPath              string `json:"db_path"`
	ModelCache          string `json:"model_cache"`
	Memories            int64  `json:"memories"`
	ModelID             string `json:"model_id"`
	ModelRevision       string `json:"model_revision"`
	ModelManifestSHA256 string `json:"model_manifest_sha256"`
	ModelVerified       bool   `json:"model_verified"`
	IndexedMemories     int64  `json:"indexed_memories"`
	StaleMemories       int64  `json:"stale_memories"`
	MissingEmbeddings   int64  `json:"missing_embeddings"`
}

type StructuredError added in v0.1.24

type StructuredError struct {
	Code             string         `json:"code"`
	Message          string         `json:"message"`
	Retryable        bool           `json:"retryable"`
	SuggestedCommand string         `json:"suggested_command,omitempty"`
	Details          map[string]any `json:"details,omitempty"`
}

type Warning added in v0.1.24

type Warning struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Details map[string]any `json:"details,omitempty"`
}

Jump to

Keyboard shortcuts

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