Documentation
¶
Overview ¶
Package agentops owns the provider-neutral Agent Operations V1 lifecycle.
Index ¶
- Constants
- Variables
- type Store
- func (s *Store) BindPlan(id string, plan state.PlanRecord, approvalID string, direct bool) (agentv1.Operation, error)
- func (s *Store) Cancel(clientID, id string) (agentv1.Operation, error)
- func (s *Store) Fail(id string, state agentv1.State, code, message string) (agentv1.Operation, error)
- func (s *Store) Get(clientID, id string) (agentv1.Operation, error)
- func (s *Store) GetByID(id string) (agentv1.Operation, error)
- func (s *Store) GetByIdempotency(clientID, key string) (agentv1.Operation, error)
- func (s *Store) ListUnfinished() ([]agentv1.Operation, error)
- func (s *Store) NewID() (string, error)
- func (s *Store) SetApproval(id, approvalID string) (agentv1.Operation, error)
- func (s *Store) Submit(input Submit) (agentv1.Operation, bool, error)
- func (s *Store) SubmitApprovedWithPlan(input Submit, plan state.PlanRecord) (agentv1.Operation, bool, error)
- func (s *Store) SubmitWithPlan(input Submit, plan state.PlanRecord) (agentv1.Operation, bool, error)
- func (s *Store) Succeed(id string, result json.RawMessage) (agentv1.Operation, error)
- func (s *Store) Transition(id string, state agentv1.State) (agentv1.Operation, error)
- func (s *Store) Wait(ctx context.Context, clientID, id string, after int64) (agentv1.Operation, error)
- type Submit
Constants ¶
const ( // TerminalRetention is the period during which completed operation keys // remain replayable. TerminalRetention = 30 * 24 * time.Hour )
Variables ¶
var ( ErrNotFound = errors.New("operation not found") ErrIdempotencyConflict = errors.New("operation idempotency conflict") ErrInvalidTransition = errors.New("invalid operation state transition") ErrNotCancelable = errors.New("operation is not cancelable") ErrCapacity = errors.New("operation store capacity reached") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) BindPlan ¶
func (s *Store) BindPlan(id string, plan state.PlanRecord, approvalID string, direct bool) (agentv1.Operation, error)
BindPlan atomically stores the immutable plan and binds a pending operation to either an approval request or direct execution.
func (*Store) Cancel ¶
Cancel atomically cancels a requester-owned pending or approved operation. Terminal operations are returned unchanged; executing work is not cancelable.
func (*Store) GetByIdempotency ¶
GetByIdempotency returns an existing submission for provider lifecycle services that must avoid re-resolving mutable upstream state on replay.
func (*Store) NewID ¶
NewID allocates an operation identifier for callers that bind an approval and immutable plan before inserting the operation row.
func (*Store) SetApproval ¶
func (*Store) SubmitApprovedWithPlan ¶
func (s *Store) SubmitApprovedWithPlan(input Submit, plan state.PlanRecord) (agentv1.Operation, bool, error)
SubmitApprovedWithPlan atomically persists a direct operation in its approved state so restart recovery never has to infer whether approval was required.
func (*Store) SubmitWithPlan ¶
func (s *Store) SubmitWithPlan(input Submit, plan state.PlanRecord) (agentv1.Operation, bool, error)
SubmitWithPlan atomically persists an immutable execution plan and its operation. Replays must provide the same plan digest.
func (*Store) Transition ¶
type Submit ¶
type Submit struct {
ID string
Broker string
ClientID string
IdempotencyKey string
Operation string
Target json.RawMessage
Arguments json.RawMessage
Reason string
Presentation agentv1.Presentation
PlanDigest string
}