worker

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkerNotFound = errors.New("worker not found")

Functions

This section is empty.

Types

type WorkerEnvType

type WorkerEnvType string
const (
	WorkerEnvProcess  WorkerEnvType = "process"
	WorkerEnvDocker   WorkerEnvType = "docker"
	WorkerEnvKubeVirt WorkerEnvType = "kubevirt"
)

type WorkerInstance

type WorkerInstance struct {
	ID        string
	WorkerID  string
	Status    string
	PID       int
	StartedAt time.Time
	Endpoint  string
}

type WorkerScheduler

type WorkerScheduler interface {
	Start(ctx context.Context, spec *WorkerSpec) (*WorkerInstance, error)
	Stop(ctx context.Context, workerID string) error
	Health(ctx context.Context, workerID string) error
	List(ctx context.Context) ([]*WorkerInstance, error)
}

type WorkerSpec

type WorkerSpec struct {
	ID             string
	OrgID          uint
	WorkerID       uint
	Name           string
	Labels         map[string]string
	Annotations    map[string]string
	ServerAddr     string
	BootstrapToken string
	EnvType        WorkerEnvType
	Image          string
	Command        []string
	Args           []string
	Env            map[string]string
	WorkingDir     string
}

type WorkerSpecReconciler added in v0.1.20

type WorkerSpecReconciler interface {
	NeedsReconcile(ctx context.Context, spec *WorkerSpec) (bool, error)
}

WorkerSpecReconciler reports whether an existing runtime worker diverges from the scheduler's desired spec. Schedulers that can inspect external state implement this optional interface.

Directories

Path Synopsis
Package command 提供统一的 Worker Command 分发器。
Package command 提供统一的 Worker Command 分发器。
interaction
Package interaction 处理 cmd.interaction lane 的交互式命令 (approval.resolve 和 question.answer),通过 Resolver 接口转发。
Package interaction 处理 cmd.interaction lane 的交互式命令 (approval.resolve 和 question.answer),通过 Resolver 接口转发。
projectfile
Package projectfile handles project file commands on the worker that owns the workspace.
Package projectfile handles project file commands on the worker that owns the workspace.
run
Package run 提供 worker agent run 命令的 cmd.run lane handler。
Package run 提供 worker agent run 命令的 cmd.run lane handler。
run/inbox
Package inbox provides a strongly-typed durable inbox for worker run commands.
Package inbox provides a strongly-typed durable inbox for worker run commands.
skill
Package skill handles cmd.skill lane commands (install, list, detail, uninstall, import).
Package skill handles cmd.skill lane commands (install, list, detail, uninstall, import).
Package eventpub publishes fully constructed Worker business events.
Package eventpub publishes fully constructed Worker business events.
Package mcp 通过 Model Context Protocol 暴露 Leros 运行时能力。
Package mcp 通过 Model Context Protocol 暴露 Leros 运行时能力。
Package router 提供 Worker HTTP 服务的 Gin 路由组装。
Package router 提供 Worker HTTP 服务的 Gin 路由组装。
Package run provides the Worker-side RunCoordinator.
Package run provides the Worker-side RunCoordinator.
Package runtimehost provides Worker-specific implementations of agent ports.
Package runtimehost provides Worker-specific implementations of agent ports.

Jump to

Keyboard shortcuts

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