Documentation
¶
Index ¶
- Constants
- Variables
- type ActionType
- type Adapter
- type Approval
- type Authorizer
- type Decision
- type Guide
- type PermissionAuthorizer
- type Proposal
- type ProposalBinder
- type ProposalInput
- type ProposalResult
- type ProposalTool
- type ReadTargetResolver
- type Registry
- type Result
- type Risk
- type Service
- func (service *Service) Approvals(ctx context.Context, pendingOnly bool) ([]Approval, error)
- func (service *Service) Approve(ctx context.Context, approvalID, nonce, approver string) (Approval, error)
- func (service *Service) Available() bool
- func (service *Service) Propose(ctx context.Context, input ProposalInput) (ProposalResult, error)
- func (service *Service) Reject(ctx context.Context, approvalID, reason, approver string) (Approval, error)
- type TargetRef
- type TargetResolver
- type Verification
Constants ¶
Variables ¶
View Source
var ErrActionDenied = errors.New("action denied")
View Source
var ErrReadOnlyApproval = errors.New("created before the upgrade; propose again")
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
type Approval ¶
type Approval struct {
ReadOnly bool `json:"read_only,omitempty"`
ID string `json:"id"`
Proposal Proposal `json:"proposal"`
State string `json:"state"`
Approver string `json:"approver,omitempty"`
ExpiresAt time.Time `json:"expires_at"`
ClaimedAt time.Time `json:"claimed_at,omitempty"`
ReconciliationRequired bool `json:"reconciliation_required,omitempty"`
ExecutedAt time.Time `json:"executed_at,omitempty"`
VerifiedAt time.Time `json:"verified_at,omitempty"`
Result *Result `json:"result,omitempty"`
Verified *Verification `json:"verification,omitempty"`
}
type PermissionAuthorizer ¶
type PermissionAuthorizer struct{}
type Proposal ¶
type Proposal struct {
ID string `json:"id"`
RunID string `json:"run_id"`
Type ActionType `json:"type"`
Target TargetRef `json:"target"`
Params json.RawMessage `json:"params"`
ParamsHash string `json:"params_hash"`
BindingHash string `json:"binding_hash"`
DryRun string `json:"dry_run"`
Risk Risk `json:"risk"`
Reason string `json:"reason"`
ProposedBy string `json:"proposed_by"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
type ProposalBinder ¶
type ProposalInput ¶
type ProposalInput struct {
Type ActionType `json:"type"`
Target TargetRef `json:"target"`
Params json.RawMessage `json:"params"`
Reason string `json:"reason"`
}
type ProposalResult ¶
type ProposalTool ¶
type ProposalTool struct {
Service *Service
}
func (ProposalTool) ArgsSchema ¶
func (ProposalTool) ArgsSchema() map[string]any
func (ProposalTool) Description ¶
func (ProposalTool) Description() string
func (ProposalTool) Invoke ¶
func (tool ProposalTool) Invoke(ctx context.Context, args json.RawMessage) (*core.ToolResult, error)
func (ProposalTool) Name ¶
func (ProposalTool) Name() string
type ReadTargetResolver ¶ added in v1.4.31
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
type Result ¶
type Result struct {
Summary string `json:"summary,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewServiceWithScope ¶ added in v1.4.31
func (*Service) Propose ¶
func (service *Service) Propose(ctx context.Context, input ProposalInput) (ProposalResult, error)
type TargetResolver ¶ added in v1.4.31
type Verification ¶
Click to show internal directories.
Click to hide internal directories.