client

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package client is the Go client of the daemon's API, over its Unix socket.

Index

Constants

View Source
const (

	// ReadTimeout outlasts the daemon's start-up reconcile, which holds
	// UserAPI for up to 30 seconds.
	ReadTimeout = 45 * time.Second
)

Variables

View Source
var DaemonLabel = brand.LaunchAgent()

DaemonLabel is the launchd label of the daemon's LaunchAgent.

View Source
var ErrDown = fmt.Errorf(brand.Name+"'s daemon is not running; start it with `%s` (installed by `"+brand.Command+" app install`), or run `"+brand.Command+" serve` in a terminal", Kickstart())

ErrDown is a daemon that does not listen on the socket.

Functions

func Kickstart

func Kickstart() string

Kickstart is the command that starts the installed daemon.

func UnixTransport

func UnixTransport(socket string) *http.Transport

UnixTransport sends every request to the daemon's Unix socket.

Types

type Client

type Client struct {

	// Manager names the workspace manager of the agent session the client
	// calls for, "" when unknown; it goes with every call that names a handle.
	Manager string
	// contains filtered or unexported fields
}

Client talks to the daemon over its Unix socket.

func New

func New(socket string) *Client

func (*Client) ActOnPlan

func (c *Client) ActOnPlan(ctx context.Context, req api.PlanActRequest) (api.PlanResponse, error)

ActOnPlan acts on plan items and returns them as the action left them, with an error line per item it could not act on.

func (*Client) Action

func (c *Client) Action(ctx context.Context, u unit.Unit, action string, req api.ActionRequest) ([]string, error)

Action returns the lines the action reported.

func (*Client) Actions

func (c *Client) Actions(ctx context.Context) (api.ActionsResponse, error)

func (*Client) Ask

func (c *Client) Ask(ctx context.Context, u unit.Unit, action string, req api.ActionRequest) (api.ActionResult, error)

Ask runs the action and returns the daemon's answer whole: the intake that accepted it, for a review, an address or a run.

func (*Client) Capture

func (c *Client) Capture(ctx context.Context, req api.CaptureRequest) (api.EntryView, error)

Capture files an entry in the Inbox.

func (*Client) Catalog

func (c *Client) Catalog(ctx context.Context) (api.CatalogResponse, error)

Catalog is the served views, facets and situations.

func (*Client) Counters

func (c *Client) Counters(ctx context.Context, area string) (api.Counters, error)

Counters are the counters of area, "" for every area.

func (*Client) CreateDraft

func (c *Client) CreateDraft(ctx context.Context, req api.DraftCreate) (api.Draft, error)

CreateDraft holds a draft the user wrote in the Outbox, or approves it at once with req.Send.

func (*Client) Digest

func (c *Client) Digest(ctx context.Context, day string) (api.Digest, error)

Digest is the daily digest of day, "YYYY-MM-DD".

func (*Client) Doctor

func (c *Client) Doctor(ctx context.Context, q api.DoctorQuery) (api.DoctorReport, error)

Doctor runs doctor's checks that read the loop's state.

func (*Client) Draft

func (c *Client) Draft(ctx context.Context, id int64) (api.Draft, error)

func (*Client) DraftDo

func (c *Client) DraftDo(ctx context.Context, id int64, action string, req api.DraftAction) (api.Draft, error)

DraftDo runs action, one of api.DraftActions, on draft id.

func (*Client) Drafts

func (c *Client) Drafts(ctx context.Context, states ...string) ([]api.Draft, error)

Drafts are the drafts in states, newest first; no state lists the proposed and failed ones.

func (*Client) DryRunTurn

func (c *Client) DryRunTurn(ctx context.Context, req api.DryRunTurnRequest) (api.DryRunTurn, error)

DryRunTurn has the daemon store the review turn of a profile try.

func (*Client) EndTurn

func (c *Client) EndTurn(ctx context.Context, handle string, req api.TurnEndRequest) (api.TurnEnded, error)

func (*Client) EntriesSince

func (c *Client) EntriesSince(ctx context.Context, q EntryQuery, since api.Since) (api.EntriesPage, error)

EntriesSince is q's page since: every entry when since is zero or the daemon answers Full, else the entries changed after it and the ids that left the view.

func (*Client) Entry

func (c *Client) Entry(ctx context.Context, id string) (api.EntryView, error)

Entry is entry id with its cards and items.

func (*Client) EntryDo

func (c *Client) EntryDo(ctx context.Context, id, verb string, req api.EntryRequest) (api.EntryResult, error)

EntryDo runs verb on entry id.

func (*Client) EntryDrafts

func (c *Client) EntryDrafts(ctx context.Context, entry string) ([]api.Draft, error)

EntryDrafts are the drafts made for entry in any state, newest first.

func (*Client) Events

func (c *Client) Events(ctx context.Context, client string, since api.Since) (<-chan api.Change, error)

Events delivers each change the daemon publishes, those not yet received merged into one, and closes the channel when the stream ends, goes silent or ctx is done. A non-zero since resumes from there: the first change says what was missed. The daemon knows the subscriber by client.

func (*Client) Explore

func (c *Client) Explore(ctx context.Context, query string) (api.ExploreResult, error)

func (*Client) Facts

func (c *Client) Facts(ctx context.Context, ref pr.Ref) (api.Facts, error)

Facts are what the pull request's guide is matched against.

func (*Client) GTD

func (c *Client) GTD(ctx context.Context) (api.GTDCatalog, error)

GTD is the views, areas, contexts and verbs the daemon serves.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (api.Health, error)

func (*Client) Intake

func (c *Client) Intake(ctx context.Context, seq int64, after int, wait time.Duration) (api.Intake, error)

Intake reads intake seq with its log lines past after, waiting up to wait for a new line or its end.

func (*Client) IntakeCancel

func (c *Client) IntakeCancel(ctx context.Context, seq int64) error

func (*Client) IntakeWithout

func (c *Client) IntakeWithout(ctx context.Context, seq int64) error

IntakeWithout starts a waiting intake without the brief.

func (*Client) Keys

func (c *Client) Keys(ctx context.Context, surface string) (api.KeysResponse, error)

Keys is the keyboard map of surface: web, tui or menubar.

func (*Client) Meter

func (c *Client) Meter(ctx context.Context) (api.MeterReport, error)

Meter is the metered cost of every scope since the daemon started.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) Plan

func (c *Client) Plan(ctx context.Context, q api.PlanQuery) (api.PlanResponse, error)

Plan is the workflows' plan: with q.Trigger, what an evaluation of that trigger would decide now, changing nothing; without it, the stored plan.

func (*Client) Plugins

func (c *Client) Plugins(ctx context.Context) ([]api.Plugin, error)

Plugins is every compiled-in plugin the daemon serves, enabled or not.

func (*Client) Probe

func (c *Client) Probe(ctx context.Context, req api.ProbeRequest) (api.ProbeResult, error)

Probe has the daemon send a probe turn; it waits on the loop like an action.

func (*Client) Prompt

func (c *Client) Prompt(ctx context.Context, handle string, req api.PromptRequest) error

func (*Client) RecordGitAccess

func (c *Client) RecordGitAccess(ctx context.Context, r api.GitAccessRecord) error

RecordGitAccess has the daemon keep a git access outcome this process saw.

func (*Client) ReportApp

func (c *Client) ReportApp(ctx context.Context, st api.AppStatus) error

func (*Client) Review

func (c *Client) Review(ctx context.Context) (api.Review, error)

Review is the current weekly Review.

func (*Client) ReviewStepDone

func (c *Client) ReviewStepDone(ctx context.Context, step string) (api.Review, error)

ReviewStepDone marks step done in the current Review.

func (*Client) Rows

func (c *Client) Rows(ctx context.Context) ([]api.Row, error)

Rows is every row.

func (*Client) RowsSince

func (c *Client) RowsSince(ctx context.Context, since api.Since) (api.RowsPage, error)

RowsSince is the page of rows since: every row when since is zero or the daemon answers Full, else the rows changed after it and the units that left.

func (*Client) SessionStart

func (c *Client) SessionStart(ctx context.Context, handle string, req api.SessionStartRequest) error

func (*Client) SetPause

func (c *Client) SetPause(ctx context.Context, req api.PauseRequest) error

func (*Client) StartTurn

func (c *Client) StartTurn(ctx context.Context, handle string, req api.TurnStartRequest) (api.TurnText, error)

StartTurn starts the stored turn of a round on the handle's session and returns its instructions.

func (*Client) Stop

func (c *Client) Stop(ctx context.Context, handle string, req api.StopRequest) (api.StopAnswer, error)

func (*Client) Timings

func (c *Client) Timings(ctx context.Context, days int) (api.TimingsReport, error)

Timings is what the loop recorded over the last days.

func (*Client) Trigger

func (c *Client) Trigger(ctx context.Context, job string) error

func (*Client) TurnAnswer

func (c *Client) TurnAnswer(ctx context.Context, handle, arg string) (api.TurnText, error)

TurnAnswer reads the newest answer to the caller's turn on the unit arg names: a pull request URL or "<provider>:<key>".

func (*Client) TurnBook

func (c *Client) TurnBook(ctx context.Context, ref pr.Ref) (api.TurnBook, error)

TurnBook is the pull request's turns with their instructions and events.

func (*Client) TurnByHand

func (c *Client) TurnByHand(ctx context.Context, handle string, req api.ByHandRequest) (api.ByHandResult, error)

TurnByHand has the daemon run a turn the user asked for in the handle's session; it waits on the loop like an action.

type EntryQuery

type EntryQuery struct {
	View     string
	Area     string
	Contexts []string
}

EntryQuery selects a view's entries; Contexts must all match, and the Inbox ignores Area.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL