watcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePath

func EncodePath(path string) string

EncodePath converts an absolute path to CC's encoded project directory name. CC replaces / and . with - (e.g. /Users/neil/clawd -> -Users-neil-clawd).

Types

type AgentInfo

type AgentInfo struct {
	TeamName  string
	AgentName string
}

AgentInfo pairs an agent with its team context.

type AgentWatcher

type AgentWatcher struct {
	// contains filtered or unexported fields
}

AgentWatcher watches a single agent's CC project directory for JSONL output.

func NewAgentWatcher

func NewAgentWatcher(agentName, workDir string, send SendTextFunc) *AgentWatcher

NewAgentWatcher creates a watcher for a single CC agent's JSONL output.

func (*AgentWatcher) Run

func (w *AgentWatcher) Run(done <-chan struct{})

Run starts watching the agent's project dir for JSONL writes. Blocks until done is closed.

type QuestionFunc

type QuestionFunc func(teamName, agentName, correlationID string, questions []runtime.Question)

QuestionFunc is called when an AskUserQuestion is detected in CC JSONL.

type SendFunc

type SendFunc func(teamName, agentName, text string)

SendFunc is the callback for sending a message to Telegram. teamName and agentName identify the agent, text is the assistant text block.

type SendTextFunc

type SendTextFunc func(text string)

SendTextFunc is called when new assistant text is detected.

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher tails active CC JSONL files and sends assistant text to Telegram.

func New

func New(agents map[string]AgentInfo, send SendFunc, onQuestion QuestionFunc) (*Watcher, error)

New creates a Watcher from a pre-built agent path mapping. Config-driven: no DB or config.Load() required.

func (*Watcher) Run

func (w *Watcher) Run(done <-chan struct{}) error

Run starts watching. Blocks until done is closed.

Jump to

Keyboard shortcuts

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