worker

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("worker not found")
View Source
var ErrValidation = errors.New("validation error")

Functions

func NamePool added in v0.0.30

func NamePool(lang string) []string

func PickRandomName added in v0.0.30

func PickRandomName(pool []string, used map[string]struct{}) (string, bool)

Types

type CreateWorkerParams added in v0.0.22

type CreateWorkerParams struct {
	Name             string
	Description      string
	Constraints      string
	WorkDir          string
	PermissionScopes string
	Engine           string
	EngineArgs       string // JSON: map[engine]rawCLIString
}

CreateWorkerParams holds the inputs for creating a new worker.

type ExecuteRequest added in v0.0.39

type ExecuteRequest struct {
	WorkerID     string
	TaskID       string
	TriggerInput string
	SessionID    string
	Resume       bool
}

ExecuteRequest bundles the inputs for ExecuteWorker. SessionID must always be non-empty; callers generate it. Resume tells the AI engine to resume the session identified by SessionID instead of starting fresh.

type Manager

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

func NewManager

func NewManager(
	workerBaseDir string,
	bc config.BeeConfig,
	ws *store.WorkerStore,
	es *store.ExecutionStore,
	engines map[string]ai.EngineAdapter,
	engineCfg *enginecfg.Store,
	envService *env.Service,
	sysConfigStore systemConfigReader,
) *Manager

func (*Manager) CancelExecution

func (m *Manager) CancelExecution(_ context.Context, executionID string) error

CancelExecution implements task.ExecutionManager. It stops the active worker process for the given executionID.

func (*Manager) CreateWorker

func (m *Manager) CreateWorker(p CreateWorkerParams) (model.Worker, error)

func (*Manager) DeleteWorker

func (m *Manager) DeleteWorker(id string, deleteWorkDir bool) error

func (*Manager) EnabledEngines added in v0.0.26

func (m *Manager) EnabledEngines() []string

func (*Manager) ExecuteWorker

func (m *Manager) ExecuteWorker(ctx context.Context, req ExecuteRequest) (model.WorkerExecution, error)

ExecuteWorker runs a worker against req.

func (*Manager) StopExecution

func (m *Manager) StopExecution(executionID string) error

func (*Manager) UpdateWorker added in v0.0.31

func (m *Manager) UpdateWorker(id string, p UpdateWorkerParams) (model.Worker, error)

func (*Manager) ValidateEngine added in v0.0.26

func (m *Manager) ValidateEngine(name string) error

An empty name is accepted (means "use server default").

func (*Manager) ValidateEngineArgs added in v0.0.32

func (m *Manager) ValidateEngineArgs(raw map[string]string) error

type UpdateWorkerParams added in v0.0.30

type UpdateWorkerParams struct {
	Name             *string `json:"name"`
	Description      *string `json:"description"`
	Constraints      *string `json:"constraints"`
	PermissionScopes *string `json:"permission_scopes"`
	Engine           *string `json:"engine"`
	// nil = no change; empty map clears all; per-engine empty string deletes that entry.
	EngineArgs map[string]string `json:"engine_args"`
}

UpdateWorkerParams holds the inputs for a partial worker update.

func (UpdateWorkerParams) ApplyTo added in v0.0.30

func (p UpdateWorkerParams) ApplyTo(w *model.Worker) error

func (UpdateWorkerParams) HasChanges added in v0.0.30

func (p UpdateWorkerParams) HasChanges() bool

func (UpdateWorkerParams) Validate added in v0.0.30

func (p UpdateWorkerParams) Validate(m *Manager) error

Jump to

Keyboard shortcuts

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