1package agent
2
3import (
4 "context"
5 "errors"
6)
7
8var (
9 ErrRequestCancelled = errors.New("request canceled by user")
10 ErrSessionBusy = errors.New("session is currently processing another request")
11 ErrEmptyPrompt = errors.New("prompt is empty")
12 ErrSessionMissing = errors.New("session id is missing")
13 ErrHookExecutionStop = errors.New("hook stopped execution")
14 ErrHookDenied = errors.New("hook denied execution")
15)
16
17func isCancelledErr(err error) bool {
18 return errors.Is(err, context.Canceled) || errors.Is(err, ErrRequestCancelled)
19}