Help us shape the future of Go! Take the 2026 Go Developer Survey

runner

package
v0.4.32 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, deps Deps) (agentkit.Runner, error)

Types

type Config

type Config struct {
	// ShutdownTimeoutSeconds bounds how long shutdown waits for in-flight turns
	// to finish on normal exit (e.g. platform EOF). 0 waits indefinitely.
	// SIGINT/SIGTERM use immediate abandon (see shutdownGraceSecondsOnSignal).
	ShutdownTimeoutSeconds int `json:"shutdownTimeoutSeconds"`
	// ShutdownGraceSecondsOnSignal caps wait after SIGINT/SIGTERM once in-flight
	// turns are cancelled. 0 abandons immediately (default).
	ShutdownGraceSecondsOnSignal int `json:"shutdownGraceSecondsOnSignal"`
	// SessionScope collapses platform delivery SessionIDs for Loop locking and
	// history: "channel" (default), "thread", or "user".
	SessionScope string `json:"sessionScope"`
	// MaxConcurrentTurns caps how many turns run at once across distinct effective
	// sessions. Defaults to 64. Ordering within one session is always preserved.
	MaxConcurrentTurns int `json:"maxConcurrentTurns"`
	// Inject lists fields prepended to each inbound user message as
	// [meta sender_id=... timestamp="..." task_id="..." ...].
	// Built-in tokens: sender_id, sender_name, sender_email, mentions, platform, chat_id, thread_id,
	// timestamp, task_id, trace_id, language, custom.*, or any Metadata key.
	// L0 config.base.yaml defaults to sender_id, sender_name, timestamp; inject: [] disables.
	Inject []string `json:"inject"`
	// DefaultTimezone is the fallback IANA timezone for inject timestamp when the
	// platform does not implement UserTimezoneProvider.
	DefaultTimezone string `json:"defaultTimezone"`
}

func (*Config) SetDefaults added in v0.3.48

func (c *Config) SetDefaults()

New registers runner: Root plugin: connects Platform to Loop and owns process lifecycle.

Best practices:

  • Platforms emit delivery SessionIDs; runner applies sessionScope and agent routing before dispatch.
  • Ordering within a session is preserved at any concurrency; only cross-session turns overlap.
  • A panicking or failing turn is reported on its session and never kills the process.

SetDefaults implements pluginkit.Defaulter.

func (*Config) Validate added in v0.3.48

func (c *Config) Validate() error

Validate implements pluginkit.Validator.

type Deps

type Deps struct {
	Platform     agentkit.Platform         `json:"platform"`
	Loop         agentkit.Loop             `json:"loop"`
	SessionStore agentkit.SessionStore     `json:"sessionStore,omitempty"`
	Workspace    workspace.Service         `json:"workspace,omitempty"`
	Schedules    []capschedule.Runtime     `json:"schedules,omitempty"`
	Init         []agentkit.AppInitializer `json:"init,omitempty"`
	Telemetry    captelemetry.Exporter     `json:"telemetry,omitempty"`
}

type Root

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

func (*Root) Commands added in v0.1.6

func (r *Root) Commands() []agentkit.Command

func (*Root) Loop

func (r *Root) Loop() agentkit.Loop

Loop exposes the turn scheduler so RPC/TUI integrations can steer or queue follow-ups; agentkit.Loop already carries Steer/FollowUp.

func (*Root) Run

func (r *Root) Run(ctx context.Context, result *build.Result) error

func (*Root) SessionStore added in v0.1.6

func (r *Root) SessionStore() agentkit.SessionStore

SessionStore returns the durable session backend used for routing and bindings.

func (*Root) Stop

func (r *Root) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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