runner

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 21 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)

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.

Types

type Config

type Config struct {
	// ShutdownTimeoutSeconds bounds how long shutdown waits for in-flight turns
	// to finish. 0 waits indefinitely.
	ShutdownTimeoutSeconds int `json:"shutdownTimeoutSeconds"`
	// 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, platform, chat_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"`
}

type Deps

type Deps struct {
	Platform     agentkit.Platform     `json:"platform"`
	Loop         agentkit.Loop         `json:"loop"`
	SessionStore agentkit.SessionStore `json:"sessionStore,omitempty"`
	Schedules    []capschedule.Runtime `json:"schedules,omitempty"`
	Telemetry    telemetry.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