Documentation
¶
Overview ¶
Package collect reads the agent network off this machine, read-only:
- leases ~/.claude/agentsync/locks/*.lease
- tells ~/.claude/agentsync/locks/<target>.messages
- session recs ~/.claude/agentsync/sessions/<uuid>.json
- transcripts ~/.claude/projects/<project>/<session>.jsonl, and the sub-agents under <project>/<session>/subagents/
and folds them into one model.Snapshot. It never writes to any of them, it reads transcripts incrementally and bounded, and it extracts metadata only (see transcript.go for what is and is not decoded).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentWindows ¶ added in v0.10.4
AgentWindows are the compaction windows the agent definitions of claudeDir/agents/<type>.md name in their frontmatter (autoCompactWindow), by agent type. A type whose file names none, or a bad one, is left out: it runs under the session's window.
func CompactWindow ¶ added in v0.9.0
CompactWindow is the context size, in tokens, at which Claude Code compacts: autoCompactWindow of claudeDir/settings.json, else the CLAUDE_CODE_AUTO_COMPACT_WINDOW environment variable, else one million. A value that is not a positive integer is not a window and falls through to the next source. getenv is os.Getenv, or a test's.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector holds what is remembered between snapshots: the offset reached in each transcript and the parsed form of each small file that has not changed.
type Options ¶
type Options struct {
ClaudeDir string // ~/.claude
LocalhostRoot string // ~/Documents/VCS/GIT/localhost
GithubRoot string // ~/Documents/VCS/GIT/github.com
Active time.Duration // a session is active when written within this
Horizon time.Duration // sessions and expired leases older than this are not listed
TellWindow time.Duration // tells older than this are not listed
TailBytes int64 // first read of a transcript covers its last TailBytes
MaxLine int // a transcript line longer than this is skipped
MaxTellText int // runes of a tell text kept
MaxAgents int // sub-agents listed per session (newest first)
Now func() time.Time
}
Options configures a Collector. The zero value is not useful; use DefaultOptions.
func DefaultOptions ¶
DefaultOptions are the settings of `agentscope serve` without flags.
type Resolver ¶
type Resolver struct {
LocalhostRoot string // <org>-<repo>[-topic] clones
GithubRoot string // <org>/<repo> clones
TTL time.Duration
Now func() time.Time
// contains filtered or unexported fields
}
Resolver turns what a lease calls its resource into a repository, when it is one. A lease key is whatever a session typed: "go-tex/engine", "github.com/go-ansible/.github", and also a task note used as the key, or a flag ("--note"). The first two are repositories; the rest are anomalies the UI must show, not drop.