Documentation
¶
Index ¶
- func New(cfg Config, deps Deps) (agentkit.Loop, error)
- type Config
- type Control
- func (c *Control) Await(ctx context.Context, req permission.Request) (permission.Result, error)
- func (c *Control) BeginStep(parent context.Context) (context.Context, func())
- func (c *Control) Cancel(_ context.Context, reason string) error
- func (c *Control) ClearTurnCancel()
- func (c *Control) DeliverPermissionReply(_ agentkit.SessionID, reply permission.Reply) bool
- func (c *Control) DrainFollowUps(_ context.Context, mode agentkit.FollowUpMode) ([]agentkit.ModelMessage, error)
- func (c *Control) FollowUp(_ context.Context, msg agentkit.ModelMessage) error
- func (c *Control) HasSteering() bool
- func (c *Control) PermissionCapability() permission.Capability
- func (c *Control) PopCancelReason() string
- func (c *Control) PopSteering() []agentkit.ModelMessage
- func (c *Control) Steer(_ context.Context, msg agentkit.ModelMessage) error
- func (c *Control) SupersedePending(_ agentkit.SessionID, reason string) bool
- type Default
- func (l *Default) Agents() []agentkit.Agent
- func (l *Default) Dispatch(ctx context.Context, req agentkit.LoopRequest) error
- func (l *Default) FollowUp(ctx context.Context, msg agentkit.ModelMessage) error
- func (l *Default) IsSessionBusy(sessionID agentkit.SessionID) bool
- func (l *Default) Steer(ctx context.Context, msg agentkit.ModelMessage) error
- func (l *Default) SupersedePendingForInbound(event agentkit.MessageEvent)
- func (l *Default) TryDeliverPermission(event agentkit.MessageEvent) bool
- type Deps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// DefaultAgent is agent id used when the event names none; defaults to the single configured agent.
DefaultAgent agentkit.AgentID `json:"defaultAgent"`
// FollowUpMode is how follow-up messages are drained after a turn ends.
FollowUpMode agentkit.FollowUpMode `json:"followUpMode"`
}
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
Control holds steer / follow-up queues and step-cancel state for one session. Loop owns one Control per SessionID; Agent reads step-level hooks via ctx.Value(agentkit.KeySessionControl).
func NewControl ¶
func NewControl() *Control
func (*Control) Await ¶
func (c *Control) Await(ctx context.Context, req permission.Request) (permission.Result, error)
func (*Control) ClearTurnCancel ¶
func (c *Control) ClearTurnCancel()
func (*Control) DeliverPermissionReply ¶
func (*Control) DrainFollowUps ¶
func (c *Control) DrainFollowUps(_ context.Context, mode agentkit.FollowUpMode) ([]agentkit.ModelMessage, error)
func (*Control) HasSteering ¶ added in v0.1.10
func (*Control) PermissionCapability ¶
func (c *Control) PermissionCapability() permission.Capability
func (*Control) PopCancelReason ¶
func (*Control) PopSteering ¶
func (c *Control) PopSteering() []agentkit.ModelMessage
type Default ¶
type Default struct {
// contains filtered or unexported fields
}
func (*Default) Agents ¶ added in v0.1.6
Agents returns configured agent instances in arbitrary order.
func (*Default) IsSessionBusy ¶ added in v0.1.10
IsSessionBusy reports whether a turn is currently executing for the session.
func (*Default) SupersedePendingForInbound ¶
func (l *Default) SupersedePendingForInbound(event agentkit.MessageEvent)
func (*Default) TryDeliverPermission ¶
func (l *Default) TryDeliverPermission(event agentkit.MessageEvent) bool
Click to show internal directories.
Click to hide internal directories.