executor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL      string                                  `yaml:"baseUrl" json:"baseUrl" `
	Agent        *mcpcfg.Group[*agent.Agent]             `yaml:"agents" json:"agents"`
	Model        *mcpcfg.Group[*llmprovider.Config]      `yaml:"models" json:"models"`
	Embedder     *mcpcfg.Group[*embedderprovider.Config] `yaml:"embedders" json:"embedders" `
	MCP          *mcpcfg.Group[*mcp.ClientOptions]       `yaml:"mcp" json:"mcp"`
	DAOConnector *view.DBConfig                          `yaml:"daoConfig" json:"daoConfig" `
	Default      config.Defaults                         `yaml:"default" json:"default"`

	ToolRetries int

	Services []string `yaml:"services" json:"services"`
	// contains filtered or unexported fields
}

func (*Config) DefaultAgentFinder

func (c *Config) DefaultAgentFinder(options ...agentloader.Option) *agentfinder.Finder

func (*Config) DefaultEmbedderFinder

func (c *Config) DefaultEmbedderFinder() *embedderfinder.Finder

func (*Config) DefaultModelFinder

func (c *Config) DefaultModelFinder() *modelfinder.Finder

func (*Config) Meta

func (c *Config) Meta() *meta.Service

func (*Config) Validate

func (c *Config) Validate() error

type Option

type Option func(config *Service)

func WithAgents

func WithAgents(agents ...*agent.Agent) Option

WithAgents sets a custom agent registry.

func WithConfig

func WithConfig(config *Config) Option

func WithFluxorActivityLogger

func WithFluxorActivityLogger(w io.Writer) Option

WithFluxorActivityLogger writes every executed Fluxor task (as seen by the executor listener) to the supplied writer in JSON. Passing nil disables logging.

func WithHistory

func WithHistory(store memory.History) Option

WithHistory injects a custom conversation history implementation.

func WithLLMLogger

func WithLLMLogger(w io.Writer) Option

WithLLMLogger redirects all LLM prompt/response traffic captured by the core LLM service to the supplied writer. Passing nil disables logging.

func WithMetaService

func WithMetaService(metaService *meta.Service) Option

WithMetaService sets metaService service

func WithModelConfig

func WithModelConfig(providers ...*modelprovider.Config) Option

func WithNewElicitationAwaiter

func WithNewElicitationAwaiter(newAwaiter func() elicitation.Awaiter) Option

WithNewElicitationAwaiter registers an interactive Awaiter responsible for resolving schema-driven user prompts ("elicitation"). When set, the awaiter is attached to the internally managed MCP client so that interactive CLI sessions can synchronously obtain the required payload.

The last non-nil value wins when the option is applied multiple times. WithNewElicitationAwaiter registers (or overrides) the Awaiter that will be used to resolve schema-based elicitation requests originating from the runtime.

Passing a non-nil Awaiter enables interactive (or otherwise custom) behaviour. Passing nil explicitly disables any previously registered Awaiter – this is useful for headless deployments such as the embedded HTTP server where blocking on stdin must be avoided.

The *last* call wins, therefore a later invocation can override an earlier one (including the implicit registration performed by the CLI helpers).

func WithToolDebugLogger

func WithToolDebugLogger(w io.Writer) Option

WithToolDebugLogger enables debug logging for every atool call executed via the executor's atool registry. Each invocation is written to the supplied writer. Passing nil disables logging.

func WithToolRetries

func WithToolRetries(maxRetries int) Option

WithToolRetries sets the default retry count for atool execution steps.

func WithTools

func WithTools(tools tool.Registry) Option

WithTools sets a custom atool registry.

func WithWorkflowOptions

func WithWorkflowOptions(option ...fluxor.Option) Option

WithWorkflowOptions sets fluxor options

func WithoutHotSwap

func WithoutHotSwap() Option

WithoutHotSwap disables automatic workspace hot-reload. Use this option for deterministic production runs where configuration should not change while the process is running.

type Service

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

func New

func New(ctx context.Context, options ...Option) (*Service, error)

New creates a new executor service

func (*Service) AgentService

func (e *Service) AgentService() *llmagent.Service

AgentService returns the registered llmagent service

func (*Service) ApprovalService

func (e *Service) ApprovalService() approval.Service

ApprovalService exposes the Fluxor approval service from the orchestration engine. It returns nil when orchestration is not yet initialised.

func (*Service) Config

func (e *Service) Config() *Config

Config returns the underlying configuration struct (read-only). Callers must treat the returned pointer as immutable once the executor has been initialised.

func (*Service) Conversation

func (e *Service) Conversation() *conversation.Manager

Conversation returns the shared conversation manager initialised by the service.

func (*Service) EventService

func (e *Service) EventService() *event.Service

func (*Service) ExecuteTool

func (e *Service) ExecuteTool(ctx context.Context, name string, args map[string]interface{}, timeout time.Duration) (interface{}, error)

ExecuteTool invokes a registered tool through the configured tool registry. It provides a lightweight way to run an individual tool without crafting a full workflow. When `timeout` is positive a child context with that deadline is used.

func (*Service) ExecutionStore

func (e *Service) ExecutionStore() *memory.ExecutionStore

ExecutionStore returns the shared executoin store

func (*Service) IsStarted

func (e *Service) IsStarted() bool

func (*Service) LLMCore

func (e *Service) LLMCore() *core.Service

LLMCore returns the underlying llm/core service instance (mainly for introspection or test hooks).

func (*Service) NewContext

func (e *Service) NewContext(ctx context.Context) context.Context

func (*Service) OAuthFinder

func (e *Service) OAuthFinder() *oauthfinder.Finder

OAuthFinder exposes decrypted OAuth2 configurations loaded from workspace.

func (*Service) Orchestration

func (e *Service) Orchestration() *mcp.Service

func (*Service) Runtime

func (e *Service) Runtime() *fluxor.Runtime

func (*Service) Shutdown

func (e *Service) Shutdown(ctx context.Context)

func (*Service) Start

func (e *Service) Start(ctx context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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