Documentation
¶
Index ¶
- Variables
- type AssignedTicket
- type ClaimResponse
- type Client
- func (c *Client) AckInput(ticketID string, inputID uint) error
- func (c *Client) ClaimRevision(id string) (*ClaimResponse, error)
- func (c *Client) ClaimTicket(id string) (*ClaimResponse, error)
- func (c *Client) Deregister() error
- func (c *Client) GetAssigned() ([]AssignedTicket, error)
- func (c *Client) GetAvailable(repo string) (*string, error)
- func (c *Client) GetPendingApproval(ticketID string) (*PendingInput, error)
- func (c *Client) GetPendingFeedback(ticketID string) (*PendingInput, error)
- func (c *Client) GetPendingInput(ticketID string) (*PendingInput, error)
- func (c *Client) GetResumable() ([]*ClaimResponse, error)
- func (c *Client) PostApprovalRequest(ticketID string, prompt string) error
- func (c *Client) PostCheckpoint(ticketID string, phase, sha string) error
- func (c *Client) PostDocumentFile(ticketID string, entryType, fromRole, filePath string) (uint, error)
- func (c *Client) PostLog(ticketID string, p LogPayload) (uint, error)
- func (c *Client) PostPhase(ticketID string, phase string) error
- func (c *Client) Register(name string, repos []string) (uint, error)
- type LogPayload
- type PendingInput
- type WSClient
Constants ¶
This section is empty.
Variables ¶
var ErrNotAvailable = errors.New("ticket not available")
ErrNotAvailable is returned when a ticket claim fails with 409 Conflict.
var ErrNotOwner = errors.New("ticket not owned by this shem")
ErrNotOwner is returned when a phase update is rejected because this shem no longer owns the ticket (e.g. after a requeue).
Functions ¶
This section is empty.
Types ¶
type AssignedTicket ¶
type AssignedTicket struct {
TicketID string `json:"ticket_id"`
Phase string `json:"phase"`
RepoRemote string `json:"repo_remote"`
}
AssignedTicket is a lightweight summary of a ticket assigned to this shem.
type ClaimResponse ¶
type ClaimResponse struct {
TicketID string `json:"ticket_id"`
Branch string `json:"branch"`
Title string `json:"title"`
RepoRemote string `json:"repo_remote"`
Description string `json:"description"`
CheckpointPhase *string `json:"checkpoint_phase"`
CheckpointSHA *string `json:"checkpoint_sha"`
LogEntries []db.LogEntry `json:"log_entries"`
}
ClaimResponse is the response from claiming a ticket.
type Client ¶
type Client struct {
RetryInitial time.Duration
RetryFactor float64
RetryMax time.Duration
RetryAttempts int
// contains filtered or unexported fields
}
Client is the HTTP client for orchestrator API calls.
func (*Client) ClaimRevision ¶
func (c *Client) ClaimRevision(id string) (*ClaimResponse, error)
ClaimRevision resumes work on a ticket already assigned to this shem that is in the revising phase (triggered by a ticket_revise push). A 409 (already picked up, or requeued in the meantime) maps to ErrNotAvailable, same log-and-skip semantics as ClaimTicket.
func (*Client) ClaimTicket ¶
func (c *Client) ClaimTicket(id string) (*ClaimResponse, error)
ClaimTicket claims a ticket for this shem.
func (*Client) Deregister ¶
Deregister deregisters this shem from the orchestrator.
func (*Client) GetAssigned ¶
func (c *Client) GetAssigned() ([]AssignedTicket, error)
GetAssigned returns all tickets currently assigned to this shem (any active phase).
func (*Client) GetAvailable ¶
GetAvailable retrieves the first available ticket for a repo.
func (*Client) GetPendingApproval ¶
func (c *Client) GetPendingApproval(ticketID string) (*PendingInput, error)
GetPendingApproval retrieves the oldest pending approval for a ticket. Returns nil, nil if no pending approval exists.
func (*Client) GetPendingFeedback ¶
func (c *Client) GetPendingFeedback(ticketID string) (*PendingInput, error)
GetPendingFeedback retrieves the oldest unresolved feedback for a ticket. Returns nil, nil if none exists.
func (*Client) GetPendingInput ¶
func (c *Client) GetPendingInput(ticketID string) (*PendingInput, error)
GetPendingInput retrieves the oldest unresolved human input for a ticket. Returns nil, nil if none exists.
func (*Client) GetResumable ¶
func (c *Client) GetResumable() ([]*ClaimResponse, error)
GetResumable returns tickets assigned to this shem that have a checkpoint and were mid-execution when the shem last died.
func (*Client) PostApprovalRequest ¶
PostApprovalRequest posts an approval request for a ticket.
func (*Client) PostCheckpoint ¶
PostCheckpoint records a checkpoint for a ticket.
func (*Client) PostDocumentFile ¶
func (c *Client) PostDocumentFile(ticketID string, entryType, fromRole, filePath string) (uint, error)
PostDocumentFile streams a file to the orchestrator as a document log entry. The file is sent as a raw body (no JSON wrapping); metadata travels in headers.
func (*Client) PostLog ¶
func (c *Client) PostLog(ticketID string, p LogPayload) (uint, error)
PostLog logs a message to a ticket.
type LogPayload ¶
type LogPayload struct {
EntryType string `json:"entry_type"`
FromRole string `json:"from_role"`
ToRole string `json:"to_role"`
Message string `json:"message"`
Model string `json:"model"`
Backend string `json:"backend"`
}
LogPayload is the request body for logging.
type PendingInput ¶
type PendingInput struct {
ID uint `json:"id"`
TicketID string `json:"ticket_id"`
Kind string `json:"kind"`
Prompt string `json:"prompt"`
CreatedAt time.Time `json:"created_at"`
}
PendingInput represents a pending human input.
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
WSClient is a WebSocket client for the orchestrator push channel.