queue

package
v0.0.240 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 3 Imported by: 1 module, 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

This section is empty.

Functions

func CollapsedThinkText

func CollapsedThinkText(thinks []types.AgentEvent) string

CollapsedThinkText joins prefix think event text with spaces.

func ConsumedEvents

func ConsumedEvents(batch Batch) []types.AgentEvent

ConsumedEvents returns all AgentEvents served for one breakpoint dequeue.

func DelayFor added in v0.0.142

func DelayFor(events []types.AgentEvent) time.Duration

DelayFor is the sum of DelayMs on events (sleep events and delay_ms on others).

func SleepFor added in v0.0.142

func SleepFor(events []types.AgentEvent)

SleepFor sleeps DelayFor(events). No-op when the sum is 0.

Types

type Batch

type Batch struct {
	PrefixSleep []types.AgentEvent
	PrefixThink []types.AgentEvent
	Breakpoint  types.AgentEvent
}

Batch is the slice consumed for one HTTP serve: leading sleep/think events plus one breakpoint.

func DequeueToBreakpoint

func DequeueToBreakpoint(queue *[]types.AgentEvent) (batch Batch, ok bool)

DequeueToBreakpoint pops leading sleep and think events and exactly one tool_call or message breakpoint. Sleep events are consumed (not a breakpoint). If the queue holds only sleep/think (no breakpoint), nothing is consumed and ok is false.

Jump to

Keyboard shortcuts

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