Documentation
¶
Overview ¶
Package presentation contains Traceary's external adapters.
Today that includes the CLI and MCP server entrypoints, plus the operator-facing formatting and command wiring that sit on top of the application layer.
Index ¶
Constants ¶
const RetentionModeArchiveThenGC = "archive_then_gc"
RetentionModeArchiveThenGC opts into opportunistic archive-before-GC (#1372).
const RetentionModeDisabled = "disabled"
RetentionModeDisabled is the fail-closed default for automatic archive-then-gc.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶ added in v0.18.0
DefaultConfigPath returns the canonical per-user Traceary config path.
func LoadExtraRedactPatterns ¶ added in v0.4.0
func LoadExtraRedactPatterns() []string
LoadExtraRedactPatterns preserves the earlier API so callers that only need redaction patterns can keep using this single-purpose helper.
Types ¶
type Config ¶
type Config struct {
// UILanguage is the operator-facing CLI/TUI language (en / ja). Empty
// string means "fall back to the built-in default language". Runtime
// environment overrides such as TRACEARY_LANG are resolved by the CLI
// layer because they are process-local, not persisted config.
UILanguage string
// ExtraRedactPatterns are additional regex patterns applied on top of the
// built-in audit redaction rules. Nil / empty means "no extras".
ExtraRedactPatterns []string
// StructuredRedactRules are named/configurable redaction rules applied
// alongside ExtraRedactPatterns. Nil / empty means "no configured structured rules".
StructuredRedactRules []redaction.RuleConfig
// AuditMaxInputBytes and AuditMaxOutputBytes override the built-in
// command-audit persistence limits when positive. Zero means "fall back to
// the built-in default"; runtime command flags and environment variables
// may still override these config defaults.
AuditMaxInputBytes int
AuditMaxOutputBytes int
// ReadFields is the default column order applied to tail / list / search
// text output when the user does not pass --fields. Nil / empty means
// "fall back to the built-in default column order".
ReadFields []string
// ReadPresets captures user-defined read presets. The runtime validates
// field names, kind values, and other constraints when a preset is
// applied; LoadConfig only parses the shape.
ReadPresets map[string]ReadPreset
// ReadColor is the default --color mode (auto / always / never) for
// read commands. Empty string means "fall back to auto". The runtime
// validates the value when a command is about to render text.
ReadColor string
// Retention holds opt-in archive-before-GC automation. Zero Mode means
// disabled (same as explicit "disabled").
Retention RetentionConfig
}
Config carries the resolved configuration values consumed by the CLI and MCP server. Zero values mean "fall back to the built-in default" so callers do not need to distinguish between "file missing" and "key missing".
func LoadConfig ¶
func LoadConfig() Config
LoadConfig reads the optional Traceary config file and returns a Config. When the file is missing, unreadable, or invalid, the returned Config is zero-valued and a warning is logged via slog so operators can see that config-backed features fell back to built-in defaults.
type ReadPreset ¶ added in v0.7.0
type ReadPreset struct {
Fields []string
Filters ReadPresetFilters
}
ReadPreset is the runtime-facing view of a user-defined preset loaded from config.json. It intentionally uses plain fields so callers can apply a preset without importing JSON tag types from this package.
type ReadPresetFilters ¶ added in v0.7.0
type ReadPresetFilters struct {
Kind string
Failures *bool
Workspace string
SessionID string
Client string
Agent string
}
ReadPresetFilters lists the filter keys a preset can carry. Presence (non-zero value) is what matters to the runtime; the preset applies the filter only when the corresponding key is set.
type RetentionConfig ¶ added in v0.28.0
type RetentionConfig struct {
// Mode is "disabled" (default) or "archive_then_gc".
Mode string
// Interval between automatic archive-then-gc attempts (e.g. "168h").
Interval string
// KeepDays matches store gc --keep-days when positive; zero means default 90.
KeepDays int
// Target is events|sessions|memories|memory_edges|all; empty means all.
Target string
// OutputDir stores archive packages; empty means ~/.config/traceary/archives.
OutputDir string
// PassphraseEnv is the name of an env var holding an optional passphrase.
// Secrets are never stored in config or SQLite.
PassphraseEnv string
}
RetentionConfig is the runtime view of config.json retention.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cli provides the Traceary command-line interface.
|
Package cli provides the Traceary command-line interface. |
|
tui
Package tui hosts the shared Bubble Tea / Bubbles / Lip Gloss foundation used by Traceary's interactive CLI surfaces.
|
Package tui hosts the shared Bubble Tea / Bubbles / Lip Gloss foundation used by Traceary's interactive CLI surfaces. |
|
Package mcpserver provides the Traceary MCP server.
|
Package mcpserver provides the Traceary MCP server. |