core

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCacheSize = 50

Variables

This section is empty.

Functions

func RegisterInterface

func RegisterInterface(name string, iface Interface)

func ResolveClient

func ResolveClient(modelID string, models []config.ModelConfig, providers []config.ProviderConfig, verbose bool) (*provider.Client, string, error)

func Run

func Run(def Definition)

func RunArgs

func RunArgs(args []string, def Definition) error

func StartScheduler added in v0.1.1

func StartScheduler(deps Deps, notifier Notifier) *cron.Cron

Types

type Definition

type Definition struct {
	Name       string
	Tools      []tools.Tool
	ToolConfig func(services map[string]map[string]any, storeDir, configDir string) []tools.Tool
}

type Deps

type Deps struct {
	AgentName        string
	Client           *provider.Client
	CompactionClient *provider.Client
	Registry         *tools.Registry
	SystemPrompt     string
	MaxRounds        int
	CWD              string
	Store            *session.Store
	Subagents        map[string]*agent.SubagentDef
	Skills           *skills.Store
	Config           config.Config
	MemoryService    *memory.MemoryService
	StartScheduler   func()
	ConfigDir        string
	ModelName        string
	Templates        []prompts.Template
}

func Init

func Init(opts ...Option) (*Deps, error)

func InitWithConfig added in v0.1.2

func InitWithConfig(cfg config.Config, systemPrompt string, cwd string, storeDir string, opts ...Option) (*Deps, error)

func (Deps) NewSession added in v0.1.1

func (d Deps) NewSession(sess *session.Session) *agent.AgentSession

func (Deps) NewSessionManager added in v0.1.1

func (d Deps) NewSessionManager(keyStorePath string) (*SessionManager, error)

func (Deps) NewSessionWithClient added in v0.1.1

func (d Deps) NewSessionWithClient(sess *session.Session, client *provider.Client) *agent.AgentSession

type Interface

type Interface interface {
	Name() string
	Run(ctx context.Context, deps Deps) error
}

func Local

func Local() Interface

func LookupInterface

func LookupInterface(name string) (Interface, bool)

type LocalInterface

type LocalInterface struct{}

func (LocalInterface) Name

func (LocalInterface) Name() string

func (LocalInterface) Run

func (LocalInterface) Run(_ context.Context, deps Deps) error

type Notifier added in v0.1.1

type Notifier interface {
	ScheduleNotify(ctx context.Context, channel, message string) error
}

type Option

type Option func(*initConfig)

func WithConfigDir

func WithConfigDir(dir string) Option

func WithVerbose

func WithVerbose(v bool) Option

type SessionManager added in v0.1.1

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

func NewSessionManager added in v0.1.1

func NewSessionManager(store *session.Store, cache *session.Cache[*agent.AgentSession], keyStore *session.KeyStore, factory func(*session.Session) *agent.AgentSession) *SessionManager

func (*SessionManager) GetOrCreate added in v0.1.1

func (sm *SessionManager) GetOrCreate(key string) (*agent.AgentSession, error)

func (*SessionManager) Save added in v0.1.1

func (sm *SessionManager) Save(key string, sess *agent.AgentSession)

Jump to

Keyboard shortcuts

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