Documentation
¶
Overview ¶
Package api is the schema every client of the daemon speaks: its version, its headers and the wire types it decodes.
Index ¶
- Constants
- Variables
- func BucketOf(buckets []Bucket, now, t time.Time) string
- func BuiltinWhy(id string) string
- func CompareRows(a, b Row) int
- func CompareUnits(a, b unit.Unit) int
- func DraftPath(id int64, rest ...string) string
- func EntryMatches(e EntryView, terms []string) bool
- func EntryPath(id string, rest ...string) string
- func Fold(s string) string
- func Major(v string) string
- func NotificationID(cat Category, entry string, token string) string
- func PluginCan(ps []Plugin, id unit.ProviderID, c string) bool
- func RefuseCase(i int) string
- func RefuseCaseIndex(code string) (int, bool)
- func ReviewStepPath(step string) string
- func SessionHandle(v string) (string, error)
- func UnitPath(u unit.Unit, rest ...string) string
- type ActionRequest
- type ActionResult
- type ActionSpec
- type ActionState
- type ActionsResponse
- type ActivityItem
- type AppStatus
- type Attention
- type AttentionAction
- type Brief
- type BriefStatus
- type BriefSummary
- type BriefTimings
- type BriefView
- type BriefsHealth
- type Bucket
- type ByHandRequest
- type ByHandResult
- type Candidate
- type CaptureRequest
- type CardView
- type CatalogResponse
- type Category
- type Change
- type ChangeFailure
- type CheckDetail
- type CheckFacts
- type ClosedSession
- type Counters
- type Detail
- type Digest
- type DoctorCheck
- type DoctorQuery
- type DoctorReport
- type Draft
- type DraftAction
- type DraftApproval
- type DraftCreate
- type DraftOrigin
- type DraftWould
- type DraftsResponse
- type DryRunTurn
- type DryRunTurnRequest
- type EntriesPage
- type EntryRequest
- type EntryResult
- type EntryView
- type Event
- type ExploreRequest
- type ExploreResult
- type Facet
- type FacetSpec
- type Fact
- type Facts
- type GTDCatalog
- type GTDVerb
- type GTDView
- type Gain
- type GitAccess
- type GitAccessOutcome
- type GitAccessRecord
- type Health
- type HomeFinding
- type Info
- type InputSpec
- type Intake
- type ItemApplied
- type ItemProposal
- type ItemRefused
- type ItemView
- type ItemsResult
- type JobStatus
- type Kept
- type KeyBinding
- type KeyView
- type KeysResponse
- type Kind
- type Load
- type MenubarSection
- type Message
- type MeterReport
- type MeterScope
- type MeterStat
- type MeterWindow
- type Notice
- type Notification
- type ObserveMode
- type Operation
- type Override
- type PRTimes
- type PauseRequest
- type PendingRound
- type PlanActRequest
- type PlanItem
- type PlanQuery
- type PlanResponse
- type Plugin
- type PluginUI
- type ProbeRequest
- type ProbeResult
- type PromptRequest
- type Quantiles
- type QuestionView
- type RateLimit
- type ReconcileReport
- type RemoveDoneResult
- type Review
- type ReviewStep
- type Row
- type RowFacts
- type RowItem
- type RowsPage
- type RunnerState
- type SavedView
- type SessionStartRequest
- type Since
- type SituationSpec
- type SourceHealth
- type StopAnswer
- type StopRequest
- type StoreStatus
- type Summary
- type TagCount
- type TimingsReport
- type TokenCounts
- type Turn
- type TurnAnswer
- type TurnBook
- type TurnEndRequest
- type TurnEnded
- type TurnFacts
- type TurnRecord
- type TurnShown
- type TurnStartRequest
- type TurnText
- type TurnTimes
- type TurnView
- type UnitWorkflow
- type Upcoming
- type VerbState
- type ViewSpec
- type WaitShare
- type WaitingPerson
- type WaitingView
- type WebView
- type Why
- type Workspace
Constants ¶
const ( DoctorOK = "ok" DoctorMissing = "missing" DoctorInfo = "info" )
Doctor marks.
const ( AgentPrefix = "/api/agent/" AgentTurnsStart = "/api/agent/turns/start" AgentTurnsByHand = "/api/agent/turns/by-hand" AgentTurnsEnd = "/api/agent/turns/end" AgentSessionsStart = "/api/agent/sessions/start" AgentSessionsStop = "/api/agent/sessions/stop" AgentSessionsPrompt = "/api/agent/sessions/prompt" AgentAnswer = "/api/agent/answer" )
AgentAPI paths, served on the Unix socket only. The caller's session is the SessionHeader.
const ( Header = "X-Loop-API" // SessionHeader carries the handle the workspace manager gave the calling // agent's process; the daemon resolves it to the loop's session. SessionHeader = "X-Loop-Session" // ManagerHeader names the manager that gave SessionHeader's handle, when // the caller knows it: a hook does, an MCP request does not. ManagerHeader = "X-Loop-Manager" // MCPKeyHeader carries the per-install secret the MCP endpoint requires. MCPKeyHeader = "X-Loop-Key" )
const ( AdminPrefix = "/api/admin/" AdminDryRunTurn = "/api/admin/dry-run-turn" AdminDoctor = "/api/admin/doctor" // AdminTurn takes the pull request's URL in the query parameter pr. AdminTurn = "/api/admin/turn" // AdminProbe sends a probe turn: the loop's self-test of an agent home. AdminProbe = "/api/admin/probe" // AdminGitAccess records a git access outcome another process saw. AdminGitAccess = "/api/admin/git-access" // AdminMeter is the metered cost of every scope since the daemon started. AdminMeter = "/api/admin/meter" )
AdminAPI paths: the daemon's answers to diagnostics and dry runs, served on the Unix socket only, like AgentAPI.
const ( Drafts = "/api/drafts" DraftDetail = Drafts + "/{id}" DraftActionPath = DraftDetail + "/{action}" )
The Outbox's routes: Drafts lists drafts (query parameters state, a comma list, and entry) and, posted a DraftCreate, holds a draft the user wrote; DraftDetail reads one and DraftActionPath runs one of DraftActions on it with a DraftAction body.
const ( DraftReply = "reply" DraftReact = "react" )
The kinds of draft the user writes: a reply in the unit's conversation (a comment on a pull request) and a reaction to it.
const ( GTDPath = "/api/gtd" EntriesPath = "/api/entries" EntryDetail = EntriesPath + "/{id}" EntryVerb = EntryDetail + "/{verb}" CountersPath = "/api/counters" DigestPath = "/api/digest" )
The entries' routes: GTDPath serves the GTDCatalog, EntriesPath lists a view (query parameters view, area, context as "a,b" and since, a Since's String) and takes a capture, EntryVerb runs a verb, CountersPath serves the counters of the query parameter area (narrowed to the entries holding each CountersTerm), DigestPath the daily digest of the query parameter day (YYYY-MM-DD).
const ( Intakes = "/api/intakes/{seq}" IntakeWithout = "/api/intakes/{seq}/without" IntakeCancel = "/api/intakes/{seq}/cancel" )
Intake paths. Intakes answers ?after=<n>&wait=<seconds>: the log lines past the n-th, once there are any or the intake ends, waiting at most IntakeWaitMax seconds.
const ( IntakeAccepted = "accepted" IntakeBriefing = "briefing" IntakeStarting = "starting" IntakeStarted = "started" IntakeFailed = "failed" IntakeCanceled = "canceled" )
The states of an intake.
const ( // CapabilityCheckouts: a session on a unit runs in a checkout of the // unit's own repository. CapabilityCheckouts = "checkouts" // CapabilityBriefs: the brief queue briefs the plugin's units. CapabilityBriefs = "briefs" // CapabilityPublishes: the plugin posts approved drafts. CapabilityPublishes = "publishes" // CapabilityReacts: the plugin posts reactions. CapabilityReacts = "reacts" // CapabilityItems: the plugin's rows derive items. CapabilityItems = "items" // CapabilityDetail: the cockpit shows a detail of the plugin's units, // which a client opens in place of the unit's link. CapabilityDetail = "detail" )
The capabilities a plugin serves in Plugin.Capabilities.
const ( ReviewPath = "/api/review" ReviewStepDone = ReviewPath + "/steps/{step}/done" )
The Review's routes: ReviewPath serves the current Review, ReviewStepDone marks one of its steps done.
const ( // AdminTimings takes the days to look back in the query parameter since. AdminTimings = "/api/admin/timings" // AdminFacts takes the pull request's URL in the query parameter pr. AdminFacts = "/api/admin/facts" )
const ( MilestoneReviewWait = "request_to_my_review" MilestoneToApproval = "opened_to_approved" MilestoneToMerge = "opened_to_merged" MilestoneMineToMerge = "mine_opened_to_merged" MilestoneInLoop = "followed_to_unfollowed" MilestoneLeadTime = "first_push_to_merged" MilestoneMineLead = "mine_first_push_to_merged" )
The keys of TimingsReport.Milestones.
const ( WaitingOnMe = "me" WaitingOnOthers = "others" WaitingOnLoop = "loop" )
The keys of TimingsReport.Waiting: who a followed pull request waited on, by its situation events.
const ( TurnStartWait = "sent_to_started" TurnBriefWait = "brief_wanted_to_sent" )
The keys of TimingsReport.Turns beyond the intents: the wait from sent to started, and an automated first turn's wait for its brief, from brief_wanted to the turn's send.
const ( ViewNeedsMe = "needs-me" ViewStalled = "stalled" ViewMine = "mine" ViewLoop = "loop" ViewAll = "all" ViewDone = "done" // ViewApproved holds open pull requests that wait on nothing of mine, // whose workspace may go before the merge. ViewApproved = "approved" )
const ( UpcomingGate = "gate" UpcomingUnmute = "unmute" UpcomingBriefRetry = "brief_retry" )
const ( AttentionDraftForMe = "gtd:delegate:headless" AttentionReply = "reply:save" AttentionSendReply = "reply:send" )
AttentionAction ids are catalog ids, gtd:<verb> (gtd:<verb>:<mode> with the delegate's mode) for an entry's verb, answer:option:<id>, answer:yes, answer:no and answer:text for the answer's choices, and reply:save and reply:send for a reply typed in the notification. The actions of an Inbox entry's notification: Draft for me delegates it headless, Reply saves the typed text to the Outbox as a reply on its unit and Send reply sends it at once.
const ( StoreOK = "ok" StoreBusy = "busy" StoreNeedsMigration = "needs-migration" StoreTooNew = "too-new" StoreFailed = "failed" )
The states of StoreStatus: StoreOK is open; the others leave the store closed until a command fixes it or, for StoreBusy, the command finishes.
const Actions = "/api/actions"
Actions is the route of the action specs.
const AnswerQueued = "answer queued; it is typed into the agent session when the agent stops"
ActionResult carries, for an action an intake runs, the intake that accepted it instead of the action's output. AnswerQueued is the output line of an answer that waits for its busy agent to stop.
const Catalog = "/api/catalog"
Catalog is the route of the served presentation.
const CountersTerm = "term"
CountersTerm is the query parameter of CountersPath, repeated, that counts only the entries holding every term, as EntryMatches reads them.
const IntakeWaitMax = 25
const Keys = "/api/keys"
Keys serves the keyboard map of a surface: GET takes the query parameter surface (web, tui or menubar).
const Plan = "/api/plan"
Plan is the workflows' plan: GET takes a PlanQuery's fields as query parameters, POST a PlanActRequest.
const PluginAssets = "/plugins/{id}/{path...}"
PluginAssets serves an enabled plugin's WebAssets; 404 while it is disabled.
const Plugins = "/api/plugins"
Plugins is the route of every compiled-in plugin: GET -> []Plugin.
const RefusalNotOffered = "not_offered"
RefusalNotOffered is the refusal code of an action the row does not offer.
const Rows = "/api/rows"
Rows takes the query parameters view, person and since, a Since's String.
const UnitDetail = "/api/units/{provider}/{key}"
UnitDetail is a unit's detail; its checks and actions are under it.
const Version = "1"
Version is the API this binary speaks, a major only. A client of another major is refused; a change older clients can ignore, such as a new field, keeps it.
Variables ¶
var DraftActions = []string{"approve", "edit", "discard", "retry"}
DraftActions are the actions DraftActionPath takes.
var ErrSessionHandle = errors.New(SessionHeader + " is missing or not a process handle: this session does not run under one of " + brand.Name + "'s workspace managers, so " + brand.Name + " cannot tell which turn it records")
var ErrUnknownSession = errors.New(SessionHeader + " names a process no session of " + brand.Name + " took: start the session from " + brand.Name + ", or let its SessionStart hook run")
ErrUnknownSession is a handle no session of the loop took.
var Operations = []Operation{ {"GET", "/api/health"}, {"GET", Rows}, {"GET", Catalog}, {"GET", UnitDetail}, {"GET", UnitDetail + "/checks"}, {"POST", "/api/jobs/{name}"}, {"POST", UnitDetail + "/{action}"}, {"GET", Actions}, {"GET", Keys}, {"GET", "/api/events"}, {"GET", "/api/activity"}, {"POST", "/api/explore"}, {"GET", "/api/explore/recent"}, {"POST", "/api/pause"}, {"POST", "/api/app"}, {"POST", "/api/workspaces/remove-done"}, {"GET", Intakes}, {"POST", IntakeWithout}, {"POST", IntakeCancel}, {"GET", Plan}, {"POST", Plan}, {"GET", Plugins}, {"GET", PluginAssets}, {"GET", GTDPath}, {"GET", EntriesPath}, {"POST", EntriesPath}, {"GET", EntryDetail}, {"POST", EntryVerb}, {"GET", CountersPath}, {"GET", Drafts}, {"POST", Drafts}, {"GET", DraftDetail}, {"POST", DraftActionPath}, {"GET", DigestPath}, {"GET", ReviewPath}, {"POST", ReviewStepDone}, {"POST", AgentTurnsStart}, {"POST", AgentTurnsByHand}, {"POST", AgentTurnsEnd}, {"POST", AgentSessionsStart}, {"POST", AgentSessionsStop}, {"POST", AgentSessionsPrompt}, {"GET", AgentAnswer}, {"POST", AdminDryRunTurn}, {"GET", AdminDoctor}, {"GET", AdminTurn}, {"POST", AdminProbe}, {"POST", AdminGitAccess}, {"GET", AdminTimings}, {"GET", AdminFacts}, {"GET", AdminMeter}, }
Operations is every route the daemon serves, UserAPI, AgentAPI and AdminAPI; the daemon routes each exactly once and no other.
Functions ¶
func BucketOf ¶
Bucket is the id of the first bucket whose Within is above now - t, the one with Within "" catching the rest; "" when no bucket takes t.
func BuiltinWhy ¶ added in v0.2.0
BuiltinWhy is the refusal code of a built-in action disabled by its actions.toml why: "<id>.why".
func CompareRows ¶
CompareRows orders rows as every client lists them: stalled first, then the oldest since, then by unit.
func CompareUnits ¶
CompareUnits orders units by provider, then key.
func EntryMatches ¶ added in v0.2.0
EntryMatches says whether every term is in one of e's Texts, ignoring case and accents.
func Fold ¶ added in v0.2.0
Fold lowers s and drops its accents, a decomposed "é" (e and U+0301) included, the way the filters compare text.
func NotificationID ¶
NotificationID is "<category>|<entry-id>|<token>".
func PluginCan ¶ added in v0.2.0
func PluginCan(ps []Plugin, id unit.ProviderID, c string) bool
PluginCan says whether the plugin of provider id is enabled and serves capability c.
func RefuseCase ¶ added in v0.2.0
RefuseCase is the refusal code of an intent's action disabled by its [[action.refuse]] case i: "action.refuse[<i>]".
func RefuseCaseIndex ¶ added in v0.2.0
RefuseCaseIndex is the case a RefuseCase code names.
func ReviewStepPath ¶
ReviewStepPath is the path that marks step done.
func SessionHandle ¶
SessionHandle validates the value of SessionHeader.
Types ¶
type ActionRequest ¶
type ActionRequest struct {
Until string `json:"until"`
UntilState bool `json:"until_state"`
Guidance string `json:"guidance"`
AgentHome string `json:"agent_home,omitempty"`
Force bool `json:"force,omitempty"`
// Basis is the action state's basis the client saw; the daemon refuses
// the action when the row no longer rests on it.
Basis string `json:"basis,omitempty"`
// Inputs are the intent's declared inputs, by name.
Inputs map[string]any `json:"inputs,omitempty"`
// OptionID, Yes, No and Source answer a question; Guidance is the
// answer's text, a note to an option, yes or no. Source is cockpit,
// notification, tui or terminal.
OptionID string `json:"option_id,omitempty"`
Yes bool `json:"yes,omitempty"`
No bool `json:"no,omitempty"`
Source string `json:"source,omitempty"`
// NoBrief starts a review, address or run without waiting for the
// brief.
NoBrief bool `json:"no_brief,omitempty"`
// Items and Entry tie what the action's turn drafts to the item ids of the unit and the entry it
// was asked from.
Items []string `json:"items,omitempty"`
Entry string `json:"entry,omitempty"`
}
type ActionResult ¶
type ActionSpec ¶
type ActionSpec struct {
ID string `json:"id"`
Label string `json:"label"`
Summary string `json:"summary,omitempty"` // what pressing it does, from the profile
Group string `json:"group"` // start | turn | control | workspace | brief | intake; draft and plan for theirs
Key string `json:"key,omitempty"` // TUI key
Surfaces []string `json:"surfaces"` // row, detail, tui, menubar, notification, cli, explore
Input *InputSpec `json:"input,omitempty"`
Intake bool `json:"intake,omitempty"`
Toggle string `json:"toggle,omitempty"` // paired id sharing the key: hold<->release
Source string `json:"source"` // "builtin" or the manifest path
Scope string `json:"scope,omitempty"` // "unit" (default), "item" or "draft"
Verb string `json:"verb,omitempty"` // GTD verb it fulfills: "next", "waiting", "delegate", "done", "dismiss", "approve", "snooze"; scope draft also "edit", "retry"
Plugin string `json:"plugin,omitempty"` // provider id, from the intent's Def.Provider; "" is core
}
ActionSpec is an action the daemon may offer on a row, as GET /api/actions serves it.
type ActionState ¶
type ActionState struct {
ID string `json:"id"`
Enabled bool `json:"enabled"`
// Reason is why a disabled action is off: the profile's why.
Reason string `json:"reason,omitempty"`
// Refusal names the profile text Reason is, which a client recognizes
// a refusal by: BuiltinWhy or RefuseCase; "" for another reason.
Refusal string `json:"refusal,omitempty"`
// Note is what an enabled action would do on this row.
Note string `json:"note,omitempty"`
Label string `json:"label,omitempty"`
Primary bool `json:"primary,omitempty"`
Confirm string `json:"confirm,omitempty"`
Basis string `json:"basis,omitempty"`
// Warning is shown under an enabled action.
Warning string `json:"warning,omitempty"`
}
ActionState is one action as offered on a row now.
type ActionsResponse ¶
type ActionsResponse struct {
Version string `json:"version"`
Specs []ActionSpec `json:"specs"`
// Plan are the actions a plan item may offer.
Plan []ActionSpec `json:"plan"`
}
ActionsResponse is the answer of GET /api/actions; a row's specs_version names the Version its actions follow.
type ActivityItem ¶
type Attention ¶
type Attention struct {
ID string `json:"id"`
Category string `json:"category"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
Body string `json:"body"`
Image string `json:"image,omitempty"`
Actions []AttentionAction `json:"actions"`
}
Attention is a notification as the daemon decides it; ID is stable for as long as what it notifies lasts.
type AttentionAction ¶
type Brief ¶
type Brief struct {
Goal string `json:"goal"`
Context string `json:"context"`
Kind string `json:"kind"`
Size string `json:"size"`
Risk string `json:"risk"`
RiskWhy string `json:"risk_why"`
OpenQuestions []string `json:"open_questions"`
Tags []string `json:"tags,omitempty"`
// Extra are the brief intent's extra fields, by name; ExtraVersions the
// version of each the brief holds.
Extra map[string]any `json:"extra,omitempty"`
ExtraVersions map[string]string `json:"extra_versions,omitempty"`
}
type BriefStatus ¶
type BriefSummary ¶
type BriefSummary struct {
Kind string `json:"kind"`
Size string `json:"size"`
Risk string `json:"risk"`
Goal string `json:"goal"`
OpenQuestions int `json:"open_questions"`
Tags []string `json:"tags,omitempty"`
// Extra are the brief intent's extra fields, by name.
Extra map[string]any `json:"extra,omitempty"`
}
type BriefTimings ¶
type BriefTimings struct {
Call Quantiles `json:"call"`
Failed int `json:"failed"`
// Reused counts the runs that carried the brief in use over.
Reused int `json:"reused"`
CostUSD float64 `json:"cost_usd"`
Outages int `json:"outages"`
// Unrecorded counts the runs started before recording began, which the
// figures leave out.
Unrecorded int `json:"unrecorded"`
}
BriefTimings are the brief runs of the window: the call time of the ok ones, the failed and the reused ones, their cost and the breaker's openings.
type BriefsHealth ¶
type BriefsHealth struct {
Open bool `json:"open"`
Since time.Time `json:"since,omitzero"`
Error string `json:"error,omitempty"`
Next time.Time `json:"next,omitzero"`
}
BriefsHealth is the brief breaker: Open while briefs are unavailable, since Since for Error, with the next trial at Next. Unavailable says why the daemon runs no brief at all while brief.enabled is set.
type ByHandRequest ¶
type ByHandRequest struct {
Intent string `json:"intent"`
URL string `json:"url,omitempty"`
// Inputs are the intent's declared inputs, by name.
Inputs map[string]any `json:"inputs,omitempty"`
Agent string `json:"agent,omitempty"`
Guidance string `json:"guidance,omitempty"`
Cwd string `json:"cwd"`
Pane string `json:"pane,omitempty"`
AgentSession string `json:"agent_session,omitempty"`
Home string `json:"home,omitempty"`
}
ByHandRequest is a turn the user starts by hand from the session that calls, described by that session's environment.
type ByHandResult ¶
type Candidate ¶
type Candidate struct {
Ref pr.Ref `json:"ref"`
Unit unit.Unit `json:"unit"`
URL string `json:"url"`
Title string `json:"title"`
Author string `json:"author"`
State string `json:"state"`
IsDraft bool `json:"draft"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changed_files"`
HeadBranch string `json:"head"`
BaseBranch string `json:"base"`
ReviewDecision string `json:"review_decision"`
ReviewRequests []string `json:"review_requests"` // logins and team:org/slug
ChecksState string `json:"checks"`
Comments int `json:"comments"`
// MyReview is the viewer's latest review state, "" when none.
MyReview string `json:"my_review"`
MyReviewOnHead bool `json:"my_review_on_head"`
Brief *BriefView `json:"brief,omitempty"`
// Actions are what the pull request offers now, as its row would.
Actions []ActionState `json:"actions"`
}
Candidate is a pull request Explore found, with what deciding whether to help on it needs.
type CaptureRequest ¶
type CatalogResponse ¶
type CatalogResponse struct {
Version string `json:"version"` // changes when any list changes; rows do not carry it
Views []ViewSpec `json:"views"`
Facets []FacetSpec `json:"facets"`
Situations []SituationSpec `json:"situations"`
}
func (CatalogResponse) KindLabel ¶
func (c CatalogResponse) KindLabel(r Row) string
KindLabel is the label of a row's kind, the kind itself when the catalog has none.
func (CatalogResponse) Situation ¶
func (c CatalogResponse) Situation(provider string, k Kind) (SituationSpec, bool)
Situation is the spec of a provider's kind; ok is false for an unknown one.
func (CatalogResponse) ViewsOn ¶
func (c CatalogResponse) ViewsOn(surface string) []ViewSpec
ViewsOn are the views a surface shows, in order.
type Category ¶
type Category string
Category is the first part of a notification id: Q<record-id>, INBOX, OUTBOX, HELD, DIGEST or NOTE.
const ( CategoryInbox Category = "INBOX" CategoryOutbox Category = "OUTBOX" // CategoryHeld's token is the local day, so it is posted once a day. CategoryHeld Category = "HELD" // CategoryDigest's entry is "-" and its token the day. CategoryDigest Category = "DIGEST" CategoryNote Category = "NOTE" )
func ParseNotificationID ¶
ParseNotificationID reads an id NotificationID wrote.
func QuestionCategory ¶
QuestionCategory is the category of the question of turn record record.
type Change ¶
type Change struct {
Type string `json:"type"` // "changed" or "notify"
Epoch string `json:"epoch"`
Rev uint64 `json:"rev"`
Units []unit.Unit `json:"units,omitempty"`
All bool `json:"all,omitempty"`
Health bool `json:"health,omitempty"`
Notices []Notice `json:"notices,omitempty"`
// Counters are the Area "" counters, on every "changed" change after a TopicEntries or TopicDrafts note.
Counters *Counters `json:"counters,omitempty"`
}
Change says the rows moved: the units whose row changed or left since the previous change, or All when too much moved to list. A "notify" change carries the notices a workflow raised for the user.
type ChangeFailure ¶
type ChangeFailure struct {
Merged int `json:"merged"`
Briefed int `json:"briefed"`
Failed int `json:"failed"`
Tagged int `json:"tagged"`
// Recent counts the briefed merges younger than Days, left out of
// Briefed until a fix had the time to come.
Recent int `json:"recent"`
Days int `json:"days"`
Definition string `json:"definition"`
}
ChangeFailure is the share of the window's merges a later fix or revert changed again: Failed of Briefed, the merges at least Days old whose brief listed their changed files; Recent are younger ones, left out. Tagged counts the merges whose own brief tags them change:fix or change:revert.
type CheckDetail ¶
type CheckFacts ¶
type ClosedSession ¶
type ClosedSession struct {
Session string `json:"session"`
At time.Time `json:"at"`
Reason string `json:"reason"`
Resume string `json:"resume,omitempty"`
}
ClosedSession is a session closed with the line that resumes it.
type Detail ¶
type Detail struct {
Row Row `json:"row"`
Events []Event `json:"events"`
Brief *BriefView `json:"brief,omitempty"`
// ProfileChain names the review profile layers a round here reads.
ProfileChain string `json:"profile_chain"`
Turn *TurnView `json:"turn,omitempty"`
// Card and Items are the unit card's (#unit-card).
Card *card.Snapshot `json:"card,omitempty"`
Items []items.Item `json:"items"`
}
type DoctorCheck ¶
type DoctorCheck struct {
Mark string `json:"mark"`
Name string `json:"name"`
Info string `json:"info,omitempty"`
Fix string `json:"fix,omitempty"`
}
DoctorCheck is one line of `doctor`; Fix is printed for a missing check.
type DoctorQuery ¶
DoctorQuery narrows the state `profile show` reads to one repository or, with PR, one pull request.
type DoctorReport ¶
type DoctorReport struct {
Checks []DoctorCheck `json:"checks"`
// BundledChanged are the intents whose bundled guide changed since the
// queried repository's last round.
BundledChanged []string `json:"bundled_changed,omitempty"`
// Reconcile is the start-up reconcile's report; nil while it runs.
Reconcile *ReconcileReport `json:"reconcile,omitempty"`
// Workflows are the checks of the workflows the daemon runs.
Workflows []DoctorCheck `json:"workflows,omitempty"`
}
DoctorReport is doctor's checks that read the loop's state.
type Draft ¶
type Draft struct {
ID int64 `json:"id"`
Unit string `json:"unit"` // "<provider>/<key>"
Items []string `json:"items"`
Entry string `json:"entry,omitempty"`
Kind string `json:"kind"`
// Purpose is what the draft is for, Delivery how it is posted (message,
// reaction or comment) and Effects what posting it applies.
Purpose string `json:"purpose"`
Delivery string `json:"delivery"`
Effects []string `json:"effects"`
Target string `json:"target"`
// Where names the conversation or person the draft posts to; "" when its publisher could not tell.
Where string `json:"where"`
Text string `json:"text"`
Reaction string `json:"reaction"`
Original string `json:"original"`
Edited bool `json:"edited"`
Origin DraftOrigin `json:"origin"`
Approval DraftApproval `json:"approval"`
Deadline *time.Time `json:"deadline"`
State string `json:"state"`
Error string `json:"error"`
Reason string `json:"reason"`
Permalink string `json:"permalink"`
Would DraftWould `json:"would"`
// Actions are the draft actions of the catalog as they stand on the draft.
Actions []ActionState `json:"actions"`
// Rev is the stored draft's version; approve and retry send the one they showed.
Rev int64 `json:"rev"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Label, Title and Link present the unit as its row does; with no row, Label is the unit's own.
Label string `json:"label,omitempty"`
Title string `json:"title,omitempty"`
Link string `json:"link,omitempty"`
// Names are the display names of the people Text mentions, by mention key ("slack:U0123"), as the
// unit's items know them; the draft routes fill them and the item details, the Outbox entries do not.
Names map[string]string `json:"names,omitempty"`
// ItemDetails are the items the draft is about, with their summaries.
ItemDetails []ItemView `json:"item_details,omitempty"`
}
type DraftAction ¶
type DraftAction struct {
Text *string `json:"text,omitempty"`
Reason string `json:"reason,omitempty"`
// Confirm lets retry post a draft that may have been posted already.
Confirm bool `json:"confirm,omitempty"`
// Rev is the draft's version the caller showed (a new draft's is 0); a draft changed since answers 409.
// Approve and retry take it; approve posts Text when given, else the text at Rev.
Rev *int64 `json:"rev,omitempty"`
}
type DraftApproval ¶
type DraftCreate ¶
type DraftCreate struct {
Unit unit.Unit `json:"unit"`
Entry string `json:"entry,omitempty"`
Items []string `json:"items,omitempty"`
Kind string `json:"kind,omitempty"`
Text string `json:"text,omitempty"`
Reaction string `json:"reaction,omitempty"`
Send bool `json:"send,omitempty"`
Source string `json:"source"`
}
DraftCreate is a draft the user writes on Unit, for Entry and its Items when set: Kind DraftReply with Text, or DraftReact with Reaction. It waits in the Outbox for approval, unless Send approves it at once to go out through the same publisher. Source is cockpit, notification, tui or terminal.
type DraftOrigin ¶
type DraftWould ¶
type DraftsResponse ¶
type DraftsResponse struct {
Drafts []Draft `json:"drafts"`
}
type DryRunTurn ¶
type DryRunTurn struct {
ID string `json:"id"`
Prompt string `json:"prompt"`
// Why is the why section the instructions rendered; empty without one.
Why string `json:"why,omitempty"`
}
DryRunTurn is the stored dry-run turn the command line runs the agent on.
type DryRunTurnRequest ¶
DryRunTurnRequest asks for the review turn of a `profile try`.
type EntriesPage ¶
type EntryRequest ¶
type EntryRequest struct {
Args map[string]string `json:"args,omitempty"`
Source string `json:"source"`
}
EntryRequest args: waiting {on, resurface}; schedule {until (RFC3339 or YYYY-MM-DD), on_activity "true"}; project {id | title (creates one)}; context {set "a,b"}; area {set}; answer: as ActionRequest fields; delegate {guidance, mode "headless" | "session"}; reply {text | reaction, kind "reply" | "react", send "now"}.
type EntryResult ¶
type EntryView ¶
type EntryView struct {
ID string `json:"id"`
Kind string `json:"kind"`
State string `json:"state"`
Title string `json:"title"`
Notes string `json:"notes,omitempty"`
Focus bool `json:"focus"`
FocusAuto string `json:"focus_auto,omitempty"`
Contexts []string `json:"contexts"`
Area string `json:"area,omitempty"`
Project string `json:"project,omitempty"`
ProjectTitle string `json:"project_title,omitempty"`
Deadline time.Time `json:"deadline,omitzero"`
SnoozeUntil time.Time `json:"snooze_until,omitzero"`
SnoozeOnActivity bool `json:"snooze_on_activity,omitempty"`
Muted bool `json:"muted,omitempty"`
Waiting *WaitingView `json:"waiting,omitempty"`
Changed bool `json:"changed,omitempty"`
Units []unit.Unit `json:"units"`
UnitLabels []string `json:"unit_labels,omitempty"` // Units as a person reads them, in order
Items []ItemView `json:"items"`
Cards []CardView `json:"cards,omitempty"` // detail only
Verbs []VerbState `json:"verbs"`
Attention *Attention `json:"attention,omitempty"`
Message *Message `json:"message,omitempty"`
Draft *Draft `json:"draft,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
// A project's: its next action's id, its open actions, and its review.
Sequential bool `json:"sequential,omitempty"`
NextAction string `json:"next_action,omitempty"`
NextActionTitle string `json:"next_action_title,omitempty"`
OpenActions int `json:"open_actions,omitempty"`
ReviewEvery string `json:"review_every,omitempty"` // a Go duration
ReviewedAt time.Time `json:"reviewed_at,omitzero"`
ReviewDue bool `json:"review_due,omitempty"`
}
type ExploreRequest ¶
type ExploreRequest struct {
Query string `json:"query"`
}
type ExploreResult ¶
type ExploreResult struct {
Query string `json:"query"` // what GitHub was asked
Read string `json:"read"` // how the input was read
Empty string `json:"empty,omitempty"`
Total int `json:"total"`
Candidates []Candidate `json:"candidates"`
Cost int `json:"cost"`
RateLimit RateLimit `json:"rate_limit"`
Recent []string `json:"recent"`
}
type Facet ¶
type Facet struct {
ID string `json:"id"`
Label string `json:"label"`
Field string `json:"field"`
Values []string `json:"values,omitempty"`
}
Facet: Field is "row.*", "item.*" or "<provider>.*".
type FacetSpec ¶
type FacetSpec struct {
ID string `json:"id"` // "repo", "author", "kind", ...
Label string `json:"label"`
Provider string `json:"provider"` // "" applies to every row
Group bool `json:"group"`
Sort string `json:"sort,omitempty"` // "", "rank", "text", "time" (RFC 3339 values)
Rank []string `json:"rank,omitempty"`
Labels map[string]string `json:"labels,omitempty"` // value -> shown text
Empty string `json:"empty,omitempty"`
Match string `json:"match,omitempty"` // "exact" (default), "suffix" (repo), "prefix" (tag), "team"
Menu bool `json:"menu"`
Buckets []Bucket `json:"buckets,omitempty"` // Sort "time" only: the client buckets now - value
}
type Facts ¶
type Facts struct {
Owner string `json:"owner"`
Repo string `json:"repo"`
Author string `json:"author"`
Association string `json:"association"`
Base string `json:"base"`
Teams []string `json:"teams,omitempty"`
Labels []string `json:"labels,omitempty"`
Kind string `json:"kind,omitempty"`
Size string `json:"size,omitempty"`
Risk string `json:"risk,omitempty"`
Goal string `json:"goal,omitempty"`
Context string `json:"context,omitempty"`
RiskWhy string `json:"risk_why,omitempty"`
Tags []string `json:"tags,omitempty"`
Files []string `json:"files,omitempty"`
HasBrief bool `json:"has_brief"`
}
Facts are what a pull request's guide is matched against: GitHub's read, the requested teams and, with a brief, its kind, size, risk, tags and files, with the goal, context and risk reason its turn text shows.
type GTDCatalog ¶
type GitAccess ¶
type GitAccess struct {
Host string `json:"host"`
Last GitAccessOutcome `json:"last"`
LastOK *GitAccessOutcome `json:"last_ok,omitempty"`
}
GitAccess is the latest git network operation the daemon ran against a host and its latest success; LastOK is nil when none succeeded yet.
type GitAccessOutcome ¶
type GitAccessOutcome struct {
At time.Time `json:"at"`
Op string `json:"op"`
Error string `json:"error,omitempty"`
}
GitAccessOutcome is one git network operation: when, which (such as "fetch of acme/widget#7") and its error, "" when it succeeded.
type GitAccessRecord ¶
type GitAccessRecord struct {
Host string `json:"host"`
GitAccessOutcome
}
GitAccessRecord is an outcome another process saw against Host, such as doctor --git's ls-remote, for the daemon to keep with its own.
type Health ¶
type Health struct {
Version string `json:"version"`
// Build names the cockpit the daemon serves; a page that loaded another
// reloads.
Build string `json:"build"`
Jobs []JobStatus `json:"jobs"`
Warnings []string `json:"warnings"`
RateLimit RateLimit `json:"rate_limit"`
SlowSync bool `json:"slow_sync"`
Viewer string `json:"viewer"`
Paused bool `json:"paused"`
PausedAt time.Time `json:"paused_at,omitzero"`
App *AppStatus `json:"app,omitempty"`
Brief *BriefStatus `json:"brief,omitempty"`
// Briefs is the brief breaker; nil when briefs are off.
Briefs *BriefsHealth `json:"briefs,omitempty"`
// Notifier is whether the menu bar follows the daemon's events.
Notifier bool `json:"notifier"`
// StalledReviewHours is stalled.review, for a client that judges a pull
// request the inventory does not hold.
StalledReviewHours float64 `json:"stalled_review_hours"`
// WorkspaceManagers name the workspace managers the daemon runs on, in
// their configured order, such as "Claude Desktop" and "Orca".
WorkspaceManagers []string `json:"workspace_managers,omitempty"`
// GitAccess is, per remote host, how the daemon's own git network
// operations went, sorted by host.
GitAccess []GitAccess `json:"git_access,omitempty"`
// Store is the store's schema version and state; nil from a daemon that
// predates it.
Store *StoreStatus `json:"store,omitempty"`
}
type HomeFinding ¶
type HomeFinding struct {
Home string `json:"home"`
Entry string `json:"entry"`
Problem string `json:"problem"`
Fix string `json:"fix,omitempty"`
}
HomeFinding is one entry an agent home lacks or holds wrong; Fix is the command that repairs it, "" when none does.
func (HomeFinding) Warning ¶
func (f HomeFinding) Warning() string
Warning is the finding as a line of Health.Warnings.
type InputSpec ¶
type InputSpec struct {
Kind string `json:"kind"` // text | duration | answer
Required bool `json:"required,omitempty"`
Label string `json:"label,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Default string `json:"default,omitempty"`
UntilState bool `json:"until_state,omitempty"`
Max int `json:"max,omitempty"`
}
type Intake ¶
type Intake struct {
Seq int64 `json:"seq"`
PR string `json:"pr"`
Intent string `json:"intent"`
Source string `json:"source"`
State string `json:"state"`
Brief string `json:"brief,omitempty"`
Note string `json:"note,omitempty"`
Attempt int `json:"attempt,omitempty"`
LastError string `json:"last_error,omitempty"`
Next time.Time `json:"next,omitzero"`
Error string `json:"error,omitempty"`
Joined bool `json:"joined,omitempty"`
Log []string `json:"log,omitempty"`
LogLen int `json:"log_len"`
}
Intake is a turn a user asked for, waiting for its pull request's brief or started. Log holds the lines past the asked index and LogLen counts every line; Attempt and LastError are the brief attempt it waits on and the failure of the one before.
type ItemApplied ¶
type ItemProposal ¶
type ItemRefused ¶
type ItemsResult ¶
type ItemsResult struct {
Applied []ItemApplied `json:"applied"`
Proposed []ItemProposal `json:"proposed"`
Refused []ItemRefused `json:"refused"`
}
ItemsResult is what the items ledger did with a turn record's ops.
type KeyBinding ¶
type KeyBinding struct {
Key string `json:"key"`
Action string `json:"action"`
Surface string `json:"surface,omitempty"`
}
KeyBinding: Surface is web, tui or menubar.
type KeyView ¶
type KeyView struct {
Key string `json:"key"`
Action string `json:"action"`
Context string `json:"context"`
Owner string `json:"owner"`
Help string `json:"help"`
// Summary is what an action's key does, from its spec; "" for a core key.
Summary string `json:"summary,omitempty"`
}
KeyView is one key of a surface. Owner is "core", a plugin id or "intent:<name>"; Action is a core action or an action spec's id.
type KeysResponse ¶
type KeysResponse struct {
Bindings []KeyView `json:"bindings"`
}
KeysResponse is the answer of GET /api/keys: the core bindings of the surface, then every served action key.
type Kind ¶
type Kind string
Kind is a row's provider-scoped situation; its labels come from CatalogResponse.Situations.
type Load ¶
type Load struct {
Since time.Time `json:"since"`
Stats []MeterStat `json:"stats"`
// CLIOps are the workspace manager's operations that spawned its CLI,
// per op.
CLIOps []MeterStat `json:"cli_ops,omitempty"`
// Fallbacks is how many calls went to the CLI because the manager's
// runtime drifted; nil when the manager does not count them.
Fallbacks *int64 `json:"fallbacks,omitempty"`
}
Load is the daemon's cost since Since, per resource (Op is empty).
type MenubarSection ¶
type Message ¶
type Message struct {
ID int64 `json:"id"`
EntryID string `json:"entry_id"`
Unit unit.Unit `json:"unit"`
Kind string `json:"kind"`
Text string `json:"text"`
Options []record.Option `json:"options,omitempty"`
Recommend string `json:"recommend,omitempty"`
Confirm bool `json:"confirm,omitempty"`
Origin string `json:"origin"`
State string `json:"state"`
CreatedAt time.Time `json:"created_at"`
}
type MeterReport ¶
type MeterReport struct {
Since time.Time `json:"since"`
At time.Time `json:"at"`
Load Load `json:"load"`
Scopes []MeterScope `json:"scopes"`
Recent *MeterWindow `json:"recent,omitempty"`
}
MeterReport is every scope's metered cost since the daemon started, sorted by name, and the same for the last minutes in Recent.
type MeterScope ¶
type MeterScope struct {
Name string `json:"name"`
Runs int64 `json:"runs"`
WallMS int64 `json:"wall_ms"`
Stats []MeterStat `json:"stats"`
Last []MeterStat `json:"last,omitempty"`
LastAt time.Time `json:"last_at,omitzero"`
LastWall int64 `json:"last_wall_ms,omitempty"`
}
MeterScope is the cost of one scope since the daemon started. For a job or a loop that has phases, Stats holds the scope and its phases together and each phase is listed under its own "<scope>/<phase>" name with its own samples only.
type MeterStat ¶
type MeterStat struct {
Res string `json:"res"`
Op string `json:"op,omitempty"`
Calls int64 `json:"calls"`
Spawns int64 `json:"spawns,omitempty"`
Errors int64 `json:"errors,omitempty"`
NotModified int64 `json:"not_modified,omitempty"`
Points int64 `json:"points,omitempty"`
Bytes int64 `json:"bytes,omitempty"`
Rows int64 `json:"rows,omitempty"`
DurMS int64 `json:"dur_ms,omitempty"`
MaxMS int64 `json:"max_ms,omitempty"`
}
MeterStat is the metered cost of one resource, or of one operation of it when Op is set.
type MeterWindow ¶
type MeterWindow struct {
Since time.Time `json:"since"`
Scopes []MeterScope `json:"scopes"`
}
MeterWindow is what each scope spent since Since, a recent minute, with MeterScope's roll-up of phases; Last and its fields are left out.
type Notice ¶
type Notice struct {
ID string `json:"id"`
Workflow string `json:"workflow"`
Unit unit.Unit `json:"unit"`
Label string `json:"label,omitempty"` // Unit as a person reads it
Text string `json:"text"`
}
Notice is a notification a workflow's notify.self step raised; ID is unique per raise.
type Notification ¶
type Notification struct {
ID string `json:"id"`
On string `json:"on"`
Title string `json:"title"`
Body string `json:"body"`
}
Notification: On is "item:<kind>" or "row:<kind>"; Body a text/template over the row or item.
type ObserveMode ¶ added in v0.2.0
type ObserveMode bool
ObserveMode is a plan item's observe flag: its workflow only plans, and a person applies the item by hand.
type Operation ¶
type Operation struct{ Method, Path string }
Operation is one route of the daemon's API.
type Override ¶
type Override struct {
MutedUntil time.Time `json:"muted_until"`
MuteUntilStateChange bool `json:"mute_until_state_change"`
MutedKind string `json:"muted_kind"`
MutedWaitingOn string `json:"muted_waiting_on"`
Hold bool `json:"hold"`
Adopted bool `json:"adopted"`
Tracked bool `json:"tracked"`
NextGuidance string `json:"next_guidance"`
}
Override is what the user set on a unit; the zero Override leaves the wire.
type PRTimes ¶
type PRTimes struct {
PR string `json:"pr"`
Title string `json:"title,omitempty"`
Author string `json:"author,omitempty"`
Opened time.Time `json:"opened,omitzero"`
Followed time.Time `json:"followed,omitzero"`
FirstRequest time.Time `json:"first_request,omitzero"`
FirstReview time.Time `json:"first_review,omitzero"`
Approved time.Time `json:"approved,omitzero"`
Merged time.Time `json:"merged,omitzero"`
Turns int `json:"turns"`
Briefs int `json:"briefs"`
}
PRTimes are a pull request's milestones, zero when it has not reached one, with its turns and brief runs in the window.
type PauseRequest ¶
type PauseRequest struct {
Paused bool `json:"paused"`
Repos []string `json:"repos,omitempty"` // owner/repo
PRs []string `json:"prs,omitempty"` // owner/repo#n
}
PauseRequest pauses or resumes the repositories in Repos and the pull requests in PRs; naming neither pauses or resumes everything.
type PendingRound ¶
type PendingRound struct {
Intent string `json:"intent"`
Reason string `json:"reason"`
Since time.Time `json:"since"`
Deadline time.Time `json:"deadline"`
}
PendingRound is an automatic round waiting for the user's answer; a client counts down to Deadline itself.
type PlanActRequest ¶
type PlanItem ¶
type PlanItem struct {
ID string `json:"id"`
Workflow string `json:"workflow"`
Decision string `json:"decision"`
Reason string `json:"reason,omitempty"`
Default string `json:"default,omitempty"`
Observe ObserveMode `json:"observe"`
Error string `json:"error,omitempty"`
Unit unit.Unit `json:"unit"`
Label string `json:"label"` // Unit as a person reads it
Title string `json:"title,omitempty"` // Unit's row title
Link string `json:"link,omitempty"` // Unit's row link
Steps []string `json:"steps"`
Deadline time.Time `json:"deadline,omitzero"`
Gain Gain `json:"gain"`
Why Why `json:"why"`
Attempts int `json:"attempts,omitempty"`
Actions []ActionState `json:"actions"` // built by internal/catalog only
}
PlanItem is one item of the workflows' plan.
type PlanQuery ¶
type PlanQuery struct {
Workflow string `json:"workflow,omitempty"`
Provider string `json:"provider,omitempty"`
Trigger string `json:"trigger,omitempty"`
// Closed asks for the sessions closed in the last day with the stored
// plan.
Closed bool `json:"closed,omitempty"`
// Unit, provider:key, asks what every workflow decides for that unit
// now; the other fields are then ignored.
Unit string `json:"unit,omitempty"`
}
type PlanResponse ¶
type PlanResponse struct {
Items []PlanItem `json:"items"`
Errors []string `json:"errors"`
Closed []ClosedSession `json:"closed,omitempty"`
// Unit is the unit a Unit query explained, as its provider lists it.
Unit string `json:"unit,omitempty"`
Label string `json:"label,omitempty"` // Unit as a person reads it
Title string `json:"title,omitempty"` // Unit's row title
Workflows []UnitWorkflow `json:"workflows,omitempty"`
}
type Plugin ¶
type Plugin struct {
ID unit.ProviderID `json:"id"`
Name string `json:"name"` // the service as a person reads it, such as "GitHub"
Enabled bool `json:"enabled"`
// Reacts: the plugin's publisher posts reactions (drafts of kind react); only when enabled.
Reacts bool `json:"reacts,omitempty"`
UI *PluginUI `json:"ui,omitempty"` // only when enabled
// Capabilities are what the plugin can do, so a client asks what a
// provider does, never which it is: checkouts, briefs, publishes, reacts,
// items; only when enabled.
Capabilities []string `json:"capabilities,omitempty"`
}
type PluginUI ¶
type PluginUI struct {
Facets []Facet `json:"facets,omitempty"` // qualifiers over row and item facts
Views []SavedView `json:"views,omitempty"` // listed under the plugin in navigation
Notifications []Notification `json:"notifications,omitempty"` // templates keyed by item kind or row kind
Keys []KeyBinding `json:"keys,omitempty"` // checked with keys.Check when the catalog loads
Web *WebView `json:"web,omitempty"` // tier c
TUIViews []string `json:"tui_views,omitempty"` // ids of compiled tui.PluginView
Menubar []MenubarSection `json:"menubar,omitempty"`
}
type ProbeRequest ¶
type ProbeResult ¶
type ProbeResult struct {
PR string `json:"pr"`
Turn string `json:"turn"`
Session string `json:"session"`
}
ProbeResult names the probe's pull request, the id of its turn and the session the turn was sent to.
type PromptRequest ¶
type PromptRequest struct {
Prompt string `json:"prompt"`
}
PromptRequest is the prompt the caller's session took.
type Quantiles ¶
type Quantiles struct {
Count int `json:"count"`
P50MS int64 `json:"p50_ms"`
P90MS int64 `json:"p90_ms"`
}
Quantiles are a duration's nearest-rank median and 90th percentile over Count samples.
type QuestionView ¶
type QuestionView struct {
RecordID int64 `json:"record_id"`
State string `json:"state"`
Kind string `json:"kind"`
Text string `json:"text"`
Options []record.Option `json:"options,omitempty"`
Recommend string `json:"recommend,omitempty"`
Publishes bool `json:"publishes,omitempty"`
Verdict string `json:"verdict,omitempty"`
Blocking int `json:"blocking"`
NonBlocking int `json:"non_blocking"`
LastMessage string `json:"last_message,omitempty"`
}
QuestionView is a turn that waits on the user: asked, failed or unrecorded, with its last record's question and outcome.
type ReconcileReport ¶
type ReconcileReport struct {
// Unrecorded are the pull requests whose turn ended without a record.
Unrecorded []pr.Ref `json:"unrecorded"`
// Closed are the pull requests whose asked turn my review closed.
Closed []pr.Ref `json:"closed"`
GoneSessions []string `json:"gone_sessions"`
// Rewritten counts the view items the sinks were brought back to.
Rewritten int `json:"rewritten"`
At time.Time `json:"at"`
}
ReconcileReport is what the daemon found and repaired when it started, before it served UserAPI.
type RemoveDoneResult ¶
type Review ¶
type Review struct {
ID string `json:"id"`
Steps []ReviewStep `json:"steps"`
StartedAt time.Time `json:"started_at"`
Done bool `json:"done"`
}
Review is the weekly Review. ID is empty when nothing was left to review as it started.
type ReviewStep ¶
type ReviewStep struct {
ID string `json:"id"`
Label string `json:"label"`
View string `json:"view"`
Query map[string]string `json:"query"`
Count int `json:"count"`
Done bool `json:"done"`
}
ReviewStep is a step of the Review: the entries of Query (GET /api/entries with these parameters), their count, and whether the step is done. Step ids: inbox, outbox, waiting, projects, someday, focus.
type Row ¶
type Row struct {
Unit unit.Unit `json:"unit"`
// Link and Label are the server's presentation of the unit, such as
// its pull request's URL and "owner/repo#12".
Link string `json:"link"`
Label string `json:"label"`
Title string `json:"title"`
Kind Kind `json:"kind"`
Summary Summary `json:"summary"`
Views []string `json:"views"`
Facets map[string][]string `json:"facets"` // facet id -> values; Values[0] is the group and sort key
// Actions are what the row offers now, in the order of the specs.
Actions []ActionState `json:"actions"`
// SpecsVersion is the version of GET /api/actions the actions follow.
SpecsVersion string `json:"specs_version"`
// Question is the open question or stop of the turn the situation
// comes from.
Question *QuestionView `json:"question,omitempty"`
Pending *PendingRound `json:"pending,omitempty"`
Items []RowItem `json:"items,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Row is one unit's row: the generic part every surface reads, the served facet values, and the provider's payload, opaque to the core.
type RowFacts ¶
type RowFacts struct {
CreatedAt time.Time `json:"created_at,omitzero"`
ChangedFiles int `json:"changed_files"`
Checks CheckFacts `json:"checks"`
Turns TurnFacts `json:"turns"`
// Next is sorted by At and holds only future instants.
Next []Upcoming `json:"next,omitempty"`
}
RowFacts are a row's numbers for the backlog panels.
type RowsPage ¶
type RowsPage struct {
Epoch string `json:"epoch"`
Rev uint64 `json:"rev"`
Full bool `json:"full"`
Rows []Row `json:"rows"`
Removed []unit.Unit `json:"removed"`
Counters *Counters `json:"counters,omitempty"`
}
RowsPage is a view's rows at Rev: every row when Full, else the rows that changed since the asked revision and the units that left the view.
type RunnerState ¶ added in v0.2.0
type RunnerState struct {
Runner string `json:"runner"`
Enabled bool `json:"enabled"`
Reason string `json:"reason,omitempty"`
}
RunnerState is a runner a delegate runs on; a session is disabled when the unit has nowhere to run one.
type SavedView ¶
type SavedView struct {
ID string `json:"id"`
Label string `json:"label"`
View string `json:"view"`
Group string `json:"group,omitempty"`
}
SavedView: View is a ViewSpec id served by the generic rows (rows or custom).
type SessionStartRequest ¶
type SessionStartRequest struct {
Pane string `json:"pane,omitempty"`
WorktreeID string `json:"worktree_id,omitempty"`
AgentSession string `json:"agent_session,omitempty"`
Source string `json:"source,omitempty"`
Cwd string `json:"cwd,omitempty"`
Home string `json:"home,omitempty"`
// Agent is the hook's agent and Transcript the session's transcript
// file, "" when the agent's payload names none.
Agent string `json:"agent,omitempty"`
Transcript string `json:"transcript,omitempty"`
}
type Since ¶
Since is a client's position in the rows: the epoch and revision it last merged. The zero Since asks for every row.
func ParseSince ¶
ParseSince reads a since parameter; "" and "0" are the zero Since.
type SituationSpec ¶
type SourceHealth ¶
type SourceHealth struct {
Provider unit.ProviderID `json:"provider"`
Warnings []string `json:"warnings"`
Detail json.RawMessage `json:"detail,omitempty"`
}
type StopAnswer ¶
type StopRequest ¶
type StopRequest struct {
AgentSession string `json:"agent_session,omitempty"`
PromptID string `json:"prompt_id,omitempty"`
LastMessage string `json:"last_message,omitempty"`
// Agent and Transcript are as in SessionStartRequest.
Agent string `json:"agent,omitempty"`
Transcript string `json:"transcript,omitempty"`
}
type StoreStatus ¶ added in v0.2.0
type StoreStatus struct {
// Version is the store's schema version and Reads the one this release
// creates and migrates to.
Version uint32 `json:"version"`
Reads uint32 `json:"reads"`
// State is one of the Store* states.
State string `json:"state"`
Message string `json:"message,omitempty"`
Fix string `json:"fix,omitempty"`
// LastBackup is the newest copy of the store in the backups directory.
LastBackup string `json:"last_backup,omitempty"`
LastBackupAt time.Time `json:"last_backup_at,omitzero"`
}
StoreStatus is the store as the daemon found it. A daemon whose store is not open answers only its health, with State saying why and Fix the command that gets past it.
type Summary ¶
type Summary struct {
WaitsOn string `json:"waits_on"` // "me", a login, "loop", "nobody", ...
Since time.Time `json:"since"`
Stalled bool `json:"stalled"`
Closed bool `json:"closed"` // replaces Kind == "done" in Row.In
OpenItems int `json:"open_items"`
Reason string `json:"reason"` // one sentence: why it waits
Line string `json:"line"` // the short status every client shows (menu bar, TUI list)
}
type TimingsReport ¶
type TimingsReport struct {
Since time.Time `json:"since"`
RecordedSince time.Time `json:"recorded_since,omitzero"`
// Viewer is the login the report counts as mine, "" when the daemon
// does not know it yet.
Viewer string `json:"viewer,omitempty"`
Milestones map[string]Quantiles `json:"milestones"`
Waiting map[string]WaitShare `json:"waiting"`
ChangeFailure ChangeFailure `json:"change_failure"`
Briefs BriefTimings `json:"briefs"`
Intakes Quantiles `json:"intakes"`
Turns map[string]Quantiles `json:"turns"`
Tokens map[string]TokenCounts `json:"tokens"`
Tags map[string][]TagCount `json:"tags,omitempty"`
Dropped []string `json:"dropped,omitempty"`
PRs []PRTimes `json:"prs"`
TurnList []TurnTimes `json:"turn_list"`
}
TimingsReport is what the loop recorded in the window since Since; RecordedSince is when recording began. Milestones are pull request durations that start and end in the window; Turns are the durations of the turns that ended in it by intent, plus TurnStartWait.
type TokenCounts ¶
type Turn ¶
type Turn struct {
Seq int64 `json:"seq"`
Intent string `json:"intent"`
ID string `json:"id"`
Trigger string `json:"trigger"`
Guidance string `json:"guidance"`
Head string `json:"head"`
SentTo string `json:"sent_to"`
Session string `json:"session"`
State string `json:"state"`
SentAt time.Time `json:"sent_at"`
StartedAt time.Time `json:"started_at,omitzero"`
EndedAt time.Time `json:"ended_at,omitzero"`
ResumeOf int64 `json:"resume_of,omitempty"`
ReplacedBy int64 `json:"replaced_by,omitempty"`
Before string `json:"before,omitempty"`
// Agent is the agent that ran the turn, BriefRun the brief run its
// instructions carried and AgentSession the agent session that started it.
Agent string `json:"agent,omitempty"`
BriefRun int64 `json:"brief_run,omitempty"`
AgentSession string `json:"agent_session,omitempty"`
// Runner is "" for a session turn; Workflow the workflow that started it;
// Role the role its intent held.
Runner string `json:"runner,omitempty"`
Workflow string `json:"workflow,omitempty"`
Role string `json:"role,omitempty"`
}
type TurnAnswer ¶
type TurnAnswer struct {
ID int64 `json:"id"`
TurnSeq int64 `json:"turn_seq"`
Text string `json:"text"`
OptionID string `json:"option_id,omitempty"`
Yes bool `json:"yes"`
No bool `json:"no,omitempty"`
Source string `json:"source"`
Route string `json:"route"`
Session string `json:"session,omitempty"`
At time.Time `json:"at"`
}
type TurnEndRequest ¶
type TurnEndRequest struct {
Turn string `json:"turn"`
// PR is the pull request the command line names, "" for none.
PR string `json:"pr,omitempty"`
Record json.RawMessage `json:"record"`
AgentSession string `json:"agent_session,omitempty"`
// WrittenAt is when the record's file was last written; zero when the
// record came from no file.
WrittenAt time.Time `json:"written_at,omitzero"`
}
type TurnEnded ¶
type TurnEnded struct {
PR string `json:"pr"`
State string `json:"state"`
Added bool `json:"added"`
// Note tells the agent its record changes nothing.
Note string `json:"note,omitempty"`
Ledger *ItemsResult `json:"ledger,omitempty"`
}
type TurnFacts ¶
type TurnFacts struct {
Count int `json:"count"`
Open int `json:"open"`
LastIntent string `json:"last_intent,omitempty"`
Tokens int64 `json:"tokens"`
CostUSD float64 `json:"cost_usd"`
}
TurnFacts counts every turn of the pull request; Open is those sent, started or asked, and CostUSD counts an unreported cost as 0.
type TurnRecord ¶
type TurnShown ¶
type TurnShown struct {
Turn turn.Turn `json:"turn"`
Instructions string `json:"instructions,omitempty"`
Records []turn.Record `json:"records"`
Answers []turn.Answer `json:"answers"`
}
TurnShown is one turn with its stored instructions and its events: the records and the answers it got.
type TurnStartRequest ¶
type TurnText ¶
type TurnText struct {
Text string `json:"text"`
}
TurnText is a turn's stored instructions, or the newest answer of the caller's turn.
type TurnTimes ¶
type TurnTimes struct {
PR string `json:"pr"`
Seq int64 `json:"seq"`
Intent string `json:"intent"`
Trigger string `json:"trigger"`
State string `json:"state"`
Agent string `json:"agent,omitempty"`
Sent time.Time `json:"sent"`
Started time.Time `json:"started,omitzero"`
Ended time.Time `json:"ended,omitzero"`
DurationMS int64 `json:"duration_ms,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
}
TurnTimes is one turn of the window, for --turns.
type TurnView ¶
type TurnView struct {
Turn Turn `json:"turn"`
Records []TurnRecord `json:"records"`
Answers []TurnAnswer `json:"answers"`
LastMessage string `json:"last_message,omitempty"`
}
TurnView is the pull request's newest turn with its records and answers.
type UnitWorkflow ¶
type UnitWorkflow struct {
Workflow string `json:"workflow"`
Trigger string `json:"trigger"`
Outcome string `json:"outcome"`
Reason string `json:"reason,omitempty"`
Facts []Fact `json:"facts,omitempty"`
}
UnitWorkflow is a workflow of the explained unit's provider that gives the unit no item: Outcome is "not_matched", "matched", "waits" or "error", Facts the facts its `when` read.
type VerbState ¶
type VerbState struct {
Verb string `json:"verb"`
Enabled bool `json:"enabled"`
Reason string `json:"reason,omitempty"`
// Runners are, on an enabled delegate, the runners of the action it runs: headless, session or both.
Runners []RunnerState `json:"runners,omitempty"`
}
type ViewSpec ¶
type ViewSpec struct {
ID string `json:"id"` // "needs-me", ...; unique across providers
Label string `json:"label"`
Provider string `json:"provider"` // "" for a core view
Rows bool `json:"rows"` // a list of rows filtered by Row.Views; false: a custom view the client knows (plan, dash, explore, recent)
Order int `json:"order"`
Surfaces []string `json:"surfaces"` // "web", "tui", "menubar"
// Unit names the view's rows, such as "Pull request"; "" for a view whose rows mix providers.
Unit string `json:"unit,omitempty"`
// UnitSort is the facet the unit column sorts by, such as "repo"; "" sorts by "repo".
UnitSort string `json:"unit_sort,omitempty"`
}
type WaitShare ¶
type WaitShare struct {
}
WaitShare is the time followed pull requests spent waiting on one party in the window: the total, and the spans between situation changes. OpenMS is the part of the total in spans still open at the report's time, which Spans leaves out.
type WaitingPerson ¶
type WaitingView ¶
type Workspace ¶
type Workspace struct {
// Manager owns the workspace; ID is its id there.
Manager string `json:"manager,omitempty"`
ID string `json:"id"`
DisplayName string `json:"display_name"`
Status string `json:"status"`
IsReview bool `json:"is_review"`
AgentStates []string `json:"agent_states"`
Comment string `json:"comment"`
// IsMain is the repository's main checkout on the pull request's branch,
// which the loop never removes.
IsMain bool `json:"is_main"`
}