Documentation
¶
Overview ¶
Package processor provides functionality for processing agent-sync tasks
Package processor provides functionality for processing agent-sync tasks ¶
Package processor provides functionality for processing agent-sync tasks ¶
Package processor provides functionality for processing agent-sync tasks ¶
Package processor provides functionality for processing agent-sync tasks ¶
Package processor provides functionality for processing agent-sync tasks ¶
Package processor provides functionality for processing agent-sync tasks
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDirectory ¶
IsDirectory determines if a path represents a directory by checking if it ends with a path separator
func RemoveFileExtension ¶
RemoveFileExtension returns the filename without its extension
Types ¶
type BaseProcessor ¶
type BaseProcessor struct {
// contains filtered or unexported fields
}
BaseProcessor contains common functionality for all task processors
func NewBaseProcessor ¶
func NewBaseProcessor(fs util.FileSystem, logger *zap.Logger, absInputRoot string, registry *agent.Registry, userScope bool) *BaseProcessor
NewBaseProcessor creates a new BaseProcessor with the given parameters
type CommandProcessor ¶
type CommandProcessor struct {
*BaseProcessor
}
CommandProcessor processes command tasks
func NewCommandProcessor ¶
func NewCommandProcessor(base *BaseProcessor) *CommandProcessor
NewCommandProcessor creates a new CommandProcessor
func (*CommandProcessor) GetOutputPath ¶
func (p *CommandProcessor) GetOutputPath(agent agent.Agent, outputPath string) string
GetOutputPath returns the appropriate output path for command tasks
func (*CommandProcessor) Process ¶
func (p *CommandProcessor) Process(inputs []string, cfg *OutputConfig) (*TaskResult, error)
Process implements the task processing for command task type
type FSAdapter ¶
type FSAdapter struct {
// contains filtered or unexported fields
}
FSAdapter bridges util.FileSystem to template.FileResolver.
func NewFSAdapter ¶
func NewFSAdapter(fs util.FileSystem) *FSAdapter
NewFSAdapter creates a new FSAdapter
func (*FSAdapter) ResolvePath ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager orchestrates task execution based on loaded configuration.
func NewManager ¶
NewManager creates a new Manager by loading configuration from the given path.
type MemoryProcessor ¶
type MemoryProcessor struct {
*BaseProcessor
}
MemoryProcessor processes memory tasks
func NewMemoryProcessor ¶
func NewMemoryProcessor(base *BaseProcessor) *MemoryProcessor
NewMemoryProcessor creates a new MemoryProcessor
func (*MemoryProcessor) GetOutputPath ¶
func (p *MemoryProcessor) GetOutputPath(agent agent.Agent, outputPath string) string
GetOutputPath returns the appropriate output path for memory tasks
func (*MemoryProcessor) Process ¶
func (p *MemoryProcessor) Process(inputs []string, cfg *OutputConfig) (*TaskResult, error)
Process implements the task processing for memory task type
type ModeProcessor ¶ added in v0.0.4
type ModeProcessor struct {
*BaseProcessor
}
ModeProcessor processes mode tasks
func NewModeProcessor ¶ added in v0.0.4
func NewModeProcessor(base *BaseProcessor) *ModeProcessor
NewModeProcessor creates a new ModeProcessor
func (*ModeProcessor) GetOutputPath ¶ added in v0.0.4
func (p *ModeProcessor) GetOutputPath(agent agent.Agent, outputPath string) string
GetOutputPath returns the appropriate output path for mode tasks
func (*ModeProcessor) Process ¶ added in v0.0.4
func (p *ModeProcessor) Process(inputs []string, cfg *OutputConfig) (*TaskResult, error)
Process implements the task processing for mode task type
type OutputConfig ¶
type OutputConfig struct {
Agent agent.Agent
// RelPath is the relative path from the output directory or file where the processed content will be written
// If the path ends with "/", it indicates a directory output
// If it does not end with "/", it indicates a file output
RelPath string
IsDirectory bool
AgentName string // Original agent name from config
}
OutputConfig encapsulates output configuration settings
type Pipeline ¶
type Pipeline struct {
// Task contains the configuration for the current task being processed,
// including its name, type, inputs, targets, and concatenation settings.
Task config.Task
// AbsInputRoot is the base directory path for resolving input files and determining
// output paths. For user-scoped tasks, it represents the user's home directory.
AbsInputRoot string
// AbsOutputDirs is a list of output directory paths where the processed
// content will be written. Each output directory will receive a copy of the output.
AbsOutputDirs []string
// UserScope indicates whether the task operates in user scope (true) or project
// scope (false). This affects output path resolution and file organization.
UserScope bool
// DryRun indicates whether the pipeline should actually write files to disk.
// When true, the pipeline will simulate file operations but not actually write files.
DryRun bool
// Force indicates whether to overwrite files without confirmation.
// When true, existing files will be overwritten without prompting.
Force bool
// contains filtered or unexported fields
}
Pipeline represents the processing pipeline for a single task.
type ProcessedFile ¶
type ProcessedFile struct {
// Content is the processed file content
Content string
// AgentName is the name of the agent for this file
AgentName string
// contains filtered or unexported fields
}
ProcessedFile represents a processed output file
type ProcessorStrategy ¶ added in v0.0.4
type ProcessorStrategy[T any] interface { Parse(absPath string, raw []byte) (T, error) GetContent(item T) string SetContent(item T, content string) T FormatOne(a agent.Agent, item T) (string, error) FormatMany(a agent.Agent, items []T) (string, error) }
ProcessorStrategy provides the per-task-type behavior plugged into the generic driver. T is the parsed item type (e.g., model.Command, model.Mode, or string for memory). The driver performs templating centrally using hooks to read/write the "content" portion.
type TaskProcessor ¶
type TaskProcessor interface {
// Process handles task-specific processing of inputs and returns the processed result
Process(inputs []string, cfg *OutputConfig) (*TaskResult, error)
// GetOutputPath returns the appropriate output path for the given agent and task type
GetOutputPath(agent agent.Agent, outputPath string) string
}
TaskProcessor defines the interface for processing different types of tasks
type TaskResult ¶
type TaskResult struct {
Files []ProcessedFile
}
TaskResult represents the result of processing a task