hook

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ Config, deps Deps) (agentkit.HookProvider, error)

New registers hook/before-step: Run compaction services before each model step; contributes /compact.

Best practices:

  • Attach the same services here and to the agent's compaction dep: this hook covers the periodic check, the agent covers overflow recovery.

func NewTurnContinue

func NewTurnContinue(cfg TurnContinueConfig, deps TurnContinueDeps) (agentkit.HookProvider, error)

NewTurnContinue registers hook/turn-continue: Decide whether an autonomous turn continues or stops; contributes /status.

Best practices:

  • Useless without tool/todo and tool/finish: with no completion signal it can only stop on budget or stall.
  • Decision order is finish, then stall, then budget, then segment limit, then pending work.

Types

type Config

type Config struct{}

type Deps

type Deps struct {
	Services     []compaction.Service  `json:"services"`
	SessionStore agentkit.SessionStore `json:"sessionStore"`
}

type Provider

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

func (*Provider) Commands

func (p *Provider) Commands() []agentkit.Command

func (*Provider) Hooks

func (p *Provider) Hooks() []agentkit.Hook

type TurnContinueConfig

type TurnContinueConfig struct {
	// MaxContinuations is segments this hook will ask for. The agent's budget.maxContinuations is the hard ceiling and always wins.
	MaxContinuations int `json:"maxContinuations"`
	// ContinuePrompt is text injected to start another segment.
	ContinuePrompt string `json:"continuePrompt"`
	// WrapUpPrompt is injected instead of ContinuePrompt once the budget is softly exhausted.
	WrapUpPrompt string `json:"wrapUpPrompt"`
	// RequireFinish keeps going until tool/finish is called, even with no pending todos.
	RequireFinish *bool `json:"requireFinish"`
	// RequireTodosDone keeps going while todos are still pending.
	RequireTodosDone *bool `json:"requireTodosDone"`
	// StallLimit stops after this many repeats of the same tool call signature.
	StallLimit int `json:"stallLimit"`
}

type TurnContinueDeps

type TurnContinueDeps struct {
	SessionStore agentkit.SessionStore `json:"sessionStore"`
}

Jump to

Keyboard shortcuts

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