Documentation
¶
Index ¶
- func ConfigFor(ctx context.Context, name string) (*llm.ApprovalConfig, bool)
- func IsTimedOut(row *queueread.QueueRowView, now time.Time) bool
- func MarkSource(ctx context.Context, source string)
- func MarkTool(ctx context.Context, name string, cfg *llm.ApprovalConfig)
- func NewTimedOutOutcome(row *queueread.QueueRowView, now time.Time) *api.DecideToolApprovalOutcome
- func NewTimedOutPatch(row *queueread.QueueRowView, now time.Time) *queuew.ToolApprovalQueue
- func RequiresPrompt(ctx context.Context, name string) bool
- func RequiresQueue(ctx context.Context, name string) bool
- func SourceFromContext(ctx context.Context) string
- func WithState(ctx context.Context) context.Context
- type State
- type SweepInput
- type SweepOutput
- type Sweeper
- type TimeoutLister
- type TimeoutNow
- type TimeoutPatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTimedOut ¶ added in v0.1.9
func IsTimedOut(row *queueread.QueueRowView, now time.Time) bool
IsTimedOut reports whether a queue row is still pending and its expires_at deadline has elapsed at the given instant. Rows without expires_at are never treated as timed out by the canonical producer.
func MarkSource ¶ added in v0.1.9
MarkSource records the canonical origin label for a host-mediated approval execution path. The value is stored on the shared approval state so the enqueue writer can persist it without trusting downstream callers.
func MarkTool ¶
func MarkTool(ctx context.Context, name string, cfg *llm.ApprovalConfig)
MarkTool attaches approval configuration to a tool name.
func NewTimedOutOutcome ¶ added in v0.1.9
func NewTimedOutOutcome(row *queueread.QueueRowView, now time.Time) *api.DecideToolApprovalOutcome
NewTimedOutOutcome builds the canonical timeout outcome for a queue row.
func NewTimedOutPatch ¶ added in v0.1.9
func NewTimedOutPatch(row *queueread.QueueRowView, now time.Time) *queuew.ToolApprovalQueue
NewTimedOutPatch builds the canonical queue-row patch for a timeout transition.
func RequiresPrompt ¶
RequiresPrompt reports whether a tool requires prompt-mode approval.
func RequiresQueue ¶
RequiresQueue reports whether a tool should be queued for approval.
func SourceFromContext ¶ added in v0.1.9
SourceFromContext returns the canonical source label attached to the current approval state when present.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
func StateFromContext ¶
StateFromContext returns the approval-queue state when present.
type SweepInput ¶ added in v0.1.9
SweepInput scopes a timeout sweep. All fields are optional.
type SweepOutput ¶ added in v0.1.9
type SweepOutput struct {
Outcomes []*api.DecideToolApprovalOutcome
}
SweepOutput reports canonical timed_out outcomes produced by a sweep.
type Sweeper ¶ added in v0.1.9
type Sweeper struct {
// contains filtered or unexported fields
}
Sweeper transitions due pending approvals into the canonical timed_out state.
func NewSweeper ¶ added in v0.1.9
func NewSweeper(lister TimeoutLister, patcher TimeoutPatcher, now TimeoutNow) (*Sweeper, error)
NewSweeper constructs a Sweeper.
func (*Sweeper) Sweep ¶ added in v0.1.9
func (s *Sweeper) Sweep(ctx context.Context, in *SweepInput) (*SweepOutput, error)
Sweep transitions all due pending approvals in scope and returns one canonical outcome per transitioned row.
type TimeoutLister ¶ added in v0.1.9
type TimeoutLister interface {
ListToolApprovalQueues(ctx context.Context, in *queueread.QueueRowsInput) ([]*queueread.QueueRowView, error)
}
TimeoutLister enumerates approval-queue rows. It mirrors the canonical queue-read surface so timeout production stays attached to approvalqueue semantics instead of depending on higher-level SDK wiring.
type TimeoutNow ¶ added in v0.1.9
TimeoutNow is a clock factory used by Sweeper.
type TimeoutPatcher ¶ added in v0.1.9
type TimeoutPatcher interface {
PatchToolApprovalQueue(ctx context.Context, queue *queuew.ToolApprovalQueue) error
}
TimeoutPatcher applies queue-row patches.