Documentation
¶
Overview ¶
Package discover enumerates agent session files from each agent's known roots. It only locates files; reading their headers and resolving them to a project is the resolve package's job.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Matches ¶
Matches reports whether a filename is a session file for the given agent. Codex files are named rollout-*.jsonl; Claude and pi use any *.jsonl. This is only a suffix gate: every agent's files are further validated by a positive session-header signature at resolve time (see resolve.sessionSignature), which is what keeps unrelated *.jsonl under a custom extra_root from being ingested.
Types ¶
type Excluder ¶
type Excluder struct {
// contains filtered or unexported fields
}
Excluder skips discovered paths that match any of a set of glob patterns, backing the config's `excludes` knob (config.Client.Excludes) so a user can keep a sensitive or noisy session directory from being discovered, watched, and uploaded. Patterns match against the full path with forward slashes, and `*` (or `**`) spans separators, so `**/tmp/**` excludes any path with a `tmp` segment and `*.private.jsonl` excludes by suffix anywhere. A zero Excluder (no patterns) excludes nothing, so callers that do not filter pass the zero value.
func NewExcluder ¶
NewExcluder compiles a set of exclude globs. Blank patterns are dropped and every pattern is normalized to forward slashes so a config written on one OS matches paths discovered on another.
func (Excluder) Excluded ¶
Excluded reports whether path matches any exclude pattern. The path is normalized to forward slashes before matching so the patterns are OS-agnostic.
func (Excluder) ExcludedDir ¶
ExcludedDir reports whether a directory should be pruned. A directory is matched both bare and with a trailing slash so either pattern style prunes it: the bare form catches an exact pattern like `**/private`, and the trailing-slash form catches a subtree pattern like `**/tmp/**` (whose trailing `**` needs the slash to match the directory node itself, not just files under it).
type File ¶
File is one discovered session file. Root is the discovery directory the file was found under: it is what lets resolution compute a stable, unique id from the file's location relative to the root, which is how Claude's subagent and workflow files (which all carry their parent's sessionId inside) avoid colliding on a single source id.
func Discover ¶
Discover walks every root and returns the session files it finds, de-duplicated by path and sorted for stable output. A missing root is not an error: agents a user does not run simply contribute nothing. ex drops paths the user configured to exclude (pass the zero Excluder to keep everything): an excluded directory is pruned from the walk, and an excluded file is skipped, so an ignored location is never discovered, watched, or uploaded.
type Root ¶
Root is a directory to scan for one agent's sessions.