meta

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package meta stores cct's own per-session annotations — a friendly name and a set of tags — keyed by the session's thread id. Coding agents give you no way to organize a growing pile of sessions; this is that organizational layer.

The annotations live in a single JSON file (meta.json) under cct's config dir. cct NEVER writes them into the agent's session files or its index: this sidecar is purely cct's, so tagging a session can never corrupt or slow down the agent.

Index

Constants

View Source
const FileName = "meta.json"

FileName is the sidecar file's name within the config dir.

Variables

This section is empty.

Functions

func FilePath

func FilePath(dir string) string

FilePath returns the sidecar path within dir.

func NormalizeTag

func NormalizeTag(tag string) string

NormalizeTag lowercases and trims a tag and collapses internal whitespace to a single dash, so "In Progress" and "in-progress" are the same tag.

Types

type Entry

type Entry struct {
	Name string   `json:"name,omitempty"`
	Tags []string `json:"tags,omitempty"`
}

Entry is the annotation for one session.

type Store

type Store struct {
	Sessions map[string]Entry `json:"sessions"`
}

Store is the full set of annotations, keyed by thread id.

func Load

func Load(dir string) (*Store, error)

Load reads the sidecar from dir. A missing file yields an empty store.

func (*Store) AddTag

func (s *Store) AddTag(id, tag string) bool

AddTag adds a normalized tag, returning false if it was already present.

func (*Store) AllTags

func (s *Store) AllTags() []string

AllTags returns every distinct tag in use, sorted.

func (*Store) Get

func (s *Store) Get(id string) Entry

Get returns the annotation for a thread id (zero Entry when none).

func (*Store) HasTag

func (s *Store) HasTag(id, tag string) bool

HasTag reports whether a session carries the given tag.

func (*Store) IDsWithTag

func (s *Store) IDsWithTag(tag string) []string

IDsWithTag returns the thread ids carrying the given tag, sorted.

func (*Store) RemoveTag

func (s *Store) RemoveTag(id, tag string) bool

RemoveTag removes a tag, returning false if it was not present.

func (*Store) Save

func (s *Store) Save(dir string) error

Save writes the sidecar to dir (0600), creating the directory if needed.

func (*Store) SetName

func (s *Store) SetName(id, name string)

SetName sets (or, with an empty name, clears) a session's friendly name.

Jump to

Keyboard shortcuts

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