Documentation
¶
Overview ¶
Package remote is the client of a registry's Writing Voice routes (the core's docs/voice.md): read the account's voice, put a new version for review, and set the account's always-attach flag, for the account a session token or a personal access token with voice:read and voice:write speaks for. The CLI and the desktop both use it.
The text travels in the clear over TLS and the registry seals it at rest: unlike a knowledge pack, a voice is read by the registry to be reviewed before it is live, so a client seal would protect nothing the registry does not open.
Index ¶
Constants ¶
const MaxScore = 3
MaxScore is the top of the scale AI Review scores a question on (0–3).
const VerdictIncomplete = "incomplete"
VerdictIncomplete is a review report whose stage or judge did not finish: the version stays in review and the registry asks again.
Variables ¶
var ( // ErrSignedOut is a registry with no credential, or one that refused // it: the knowledge store's own, so a caller tests one value for both. ErrSignedOut = store.ErrSignedOut // ErrNoAccountVoice is an account that keeps no Writing Voice (this // computer keeping none is voice.ErrNoVoice). ErrNoAccountVoice = errors.New("your account keeps no Writing Voice") // ErrUnconfigured is a registry that keeps no voices: no key to seal // them with, or no AI Review judge to review them. ErrUnconfigured = errors.New("this registry keeps no Writing Voices") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
AlwaysAttach bool `json:"alwaysAttach"`
Live *Version `json:"live,omitempty"`
Pending *Version `json:"pending,omitempty"`
Previous *Version `json:"previous,omitempty"`
QuestionSet string `json:"questionSet"`
}
Account is the account's voice: the always-attach flag, and the live, pending and previous versions, any of which may be missing.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is one registry, as one account.
func New ¶
New is the client of the registry at regURL (no trailing slash) with token as its bearer credential. hc carries every request (nil: http.DefaultClient, which has no timeout; callers pass their own).
func (*Client) SetAlwaysAttach ¶
SetAlwaysAttach sets whether runs In Agentry attach the account's live voice by default: PUT /voice/settings.
type Finding ¶
type Finding struct {
Scanner string `json:"scanner"`
Severity string `json:"severity"`
Title string `json:"title"`
Line int `json:"line,omitempty"`
Question string `json:"question,omitempty"`
Score int `json:"score,omitempty"`
Flags bool `json:"flags"`
}
Finding is one thing AI Review found in a version: a rule stage's finding at a line, or a question of the voice set and its score. Flags says whether it is what keeps the version from going live.
type Review ¶
type Review string
Review is where a version is in its review.
The review states (the core's VoiceVersion.review).
type Version ¶
type Version struct {
ID string `json:"id"`
Review Review `json:"review"`
Source string `json:"source"`
Digest string `json:"digest"`
Bytes int `json:"bytes"`
Text string `json:"-"`
Verdict string `json:"verdict,omitempty"`
Findings []Finding `json:"findings,omitempty"`
Failure string `json:"failure,omitempty"`
QuestionSet string `json:"questionSet,omitempty"`
CreatedAt time.Time `json:"createdAt"`
ReviewedAt *time.Time `json:"reviewedAt,omitempty"`
}
Version is one version of the account's voice. Source is the registry's word (build, ai-edit, edit, upload, restore), not this computer's voice.Source.