client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 1 module, 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 a workspace held by the Blitz service, reached over its socket: an api.Backend, so front ends drive it exactly as they drive a local *engine.Workspace.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownProvider = errors.New("unknown provider")
	ErrInvalidProfile  = errors.New("invalid profile")
	ErrNoTool          = errors.New("the vendor's tool isn't installed")
)

A sign-in's errors that the caller can't fix by trying again: the provider isn't one Blitz signs in to, the profile isn't a name, or the vendor's tool isn't installed (the message says where to get it).

Functions

func Release added in v0.3.1

func Release(ctx context.Context, sock, dir string) error

Release asks the service on sock to close dir's workspace, so another process can open it: refused (an error) while a turn runs there; nothing to do when it isn't open (WorkspaceService.CloseWorkspace).

Types

type Background

type Background struct {
	// contains filtered or unexported fields
}

Background reaches the service's background runs, in every workspace (blitz agents, logs, stop).

func AttachBackground

func AttachBackground(sock string) *Background

AttachBackground reaches the background runs of the service listening on sock.

func AttachBackgroundHTTP

func AttachBackgroundHTTP(hc connect.HTTPClient, baseURL string) *Background

AttachBackgroundHTTP is AttachBackground over any HTTP client.

func (*Background) Find

func (b *Background) Find(ctx context.Context, id string) (api.BackgroundRun, error)

Find returns the run with the ID (api.ErrUnknownRun).

func (*Background) List

func (b *Background) List(ctx context.Context) ([]api.BackgroundRun, error)

List returns the runs, newest first (SessionService.ListBackground).

func (*Background) Logs

func (b *Background) Logs(ctx context.Context, id string, follow bool, on func(api.Event)) (api.TurnResult, bool, error)

Logs passes a run's events so far to on, and with follow those to come until it ends; it doesn't answer the run's requests. It returns the run's result once it has ended (SessionService.WatchBackground).

func (*Background) Stop

func (b *Background) Stop(ctx context.Context, id string) (api.BackgroundRun, error)

Stop stops a run and returns it as it ended (SessionService.StopBackground).

type Branding added in v0.9.1

type Branding struct {
	Name, ShortName, Support, About string
	Documents                       []OrgDocument
}

Branding is what the organization says about itself (spec_053 EN-52): its name, about text, support link and documents. The zero value: none published (Blitz's own look).

type ConfigChange added in v1.3.0

type ConfigChange struct {
	Path       string
	ModelError string
	Problems   []string
}

ConfigChange is what a settings change did: the file written, and what the open workspaces couldn't take up.

type GoingServiceRun added in v0.9.1

type GoingServiceRun struct {
	Run                            ServiceRun
	JobID, JobName, Workspace, Dir string
}

GoingServiceRun is a run going now on the organization's service, with its job and workspace (EN-42).

type KeyCheck added in v1.3.0

type KeyCheck struct {
	Works  bool
	Error  string
	Models []string
}

KeyCheck is whether a provider took an API key, why not, and the models it reaches.

type ListedModel added in v0.3.1

type ListedModel struct {
	ID                          string
	HasPrice                    bool
	InputPerMTok, OutputPerMTok float64
	// DisplayName, Default and Caps are the organization's, for its models
	// (EN-21); Caps is nil when it says nothing of what one can do.
	DisplayName string
	Default     bool
	Caps        *pb.ModelCapabilities
}

ListedModel is a model with the price Blitz knows for it, in dollars per million tokens (HasPrice false when it knows none).

type OrgDocument added in v0.9.1

type OrgDocument struct {
	Document, Version, Text, URL string
}

OrgDocument is one of the organization's documents: its terms of service ("terms") or privacy notice ("privacy"), as text or a link.

type OrgSync added in v0.9.0

type OrgSync struct {
	State, Error string
	Pairs        [][2]string
	Failed       bool
}

OrgSync is an organization workspace's sync on this computer (EN-64): State is saved, saving, offline, signed_out, conflicts or refused ("" when no sync keeps the workspace in step); Error is why it's offline, signed out or refused, in Git's words; Pairs are the files with both versions kept (the shared one, this person's); Failed is whether the service hasn't got this computer's saves, as the service says.

type OrgUsage added in v0.9.0

type OrgUsage = *pb.GetOrgUsageResponse

OrgUsage is the person's own use of the organization's models (spec_053 EN-24; ConfigService.GetOrgUsage), as blitzd gives it.

type OrgWorkspace added in v0.9.0

type OrgWorkspace struct {
	Handle, Name, Role string
	Sync               bool
	// Dir is where it is, or would be, cloned; Cloned whether it is.
	Dir    string
	Cloned bool
}

OrgWorkspace is one of the organization's workspaces (EN-60).

type Organization added in v0.9.0

type Organization struct {
	// URL is the service's address; "" when not connected.
	URL          string
	Name         string
	Version      string
	Capabilities []string
	SignedIn     bool
	Email        string
	PersonName   string
	Roles        []string
	// Renews is when the access token is next renewed; zero until one is
	// asked for.
	Renews time.Time
	// Terms is a version of the organization's terms to accept, if any.
	Terms string
	// Checked says the service was asked; Reachable whether it answered,
	// and Error why not.
	Checked   bool
	Reachable bool
	Error     string
	// Managed says the machine-wide settings set it (EN-10): it can't be
	// changed or disconnected here.
	Managed bool
}

Organization is the organization's service this computer connects to, and who is signed in to it (spec_053_enterprise EN-10 to EN-14).

type OrganizationPrompt added in v0.9.0

type OrganizationPrompt struct {
	URL, Code string
}

OrganizationPrompt is what to do to sign in: open URL, and enter Code there when there is one.

type OrganizationTerms added in v0.9.0

type OrganizationTerms struct {
	Version   string
	Accepted  bool
	Text, URL string
}

OrganizationTerms are the organization's terms in force: their version ("" for none), whether they're accepted, and the text or its link.

type ProviderModels added in v0.3.1

type ProviderModels struct {
	Provider, Note, Err string
	Models              []ListedModel
}

ProviderModels are one provider's models, or why they couldn't be listed (Err), and what the list is when it isn't the provider's own.

type Remote

type Remote struct {
	// contains filtered or unexported fields
}

Remote is one workspace in the service.

func Attach

func Attach(ctx context.Context, sock, dir string, warn func(string)) (*Remote, error)

Attach opens dir (made absolute) in the service listening on sock.

func AttachHTTP

func AttachHTTP(ctx context.Context, hc connect.HTTPClient, baseURL, dir string, warn func(string)) (*Remote, error)

AttachHTTP is Attach over any HTTP client, e.g. in tests.

func (*Remote) ActiveAgent

func (r *Remote) ActiveAgent() api.AgentInfo

ActiveAgent is the agent in use (from ListAgents).

func (*Remote) ActiveAgentTools

func (r *Remote) ActiveAgentTools() api.AgentTools

ActiveAgentTools lists the tools the active agent can call (WorkspaceService.ListTools) (on failure, warn is told and it returns nothing).

func (*Remote) ActiveSession

func (r *Remote) ActiveSession() (api.SessionInfo, bool)

ActiveSession returns the session in use and whether there is one (SessionService.GetActiveSession) (on failure, warn is told and it returns nothing).

func (*Remote) AddImage

func (r *Remote) AddImage(name string, data []byte) (*images.Image, error)

AddImage prepares an image from its bytes (a paste) for a prompt (WorkspaceService.AddImage).

func (*Remote) AddMemory

func (r *Remote) AddMemory(ctx context.Context, text string) (string, error)

AddMemory appends a note to the project's memory file and returns the file (WorkspaceService.AddMemory).

func (*Remote) AddPermissionRule

func (r *Remote) AddPermissionRule(effect, rule string, save api.Scope) (api.PermissionChange, error)

AddPermissionRule adds a rule with its effect (allow, ask or deny), for the session or, with save, in the configuration (WorkspaceService.AddPermissionRule).

func (*Remote) AllModelSettings

func (r *Remote) AllModelSettings() map[string]config.ModelSettings

AllModelSettings returns every model's generation settings from the configuration (WorkspaceService.GetModelSettings) (on failure, warn is told and it returns nothing).

func (*Remote) AnswerTaskRequest

func (r *Remote) AnswerTaskRequest(id string, decision api.Decision, answer string) error

AnswerTaskRequest answers one of them (SessionService.Answer for a question, when answer is set; else Approve).

func (*Remote) ApproveSpec added in v0.9.4

func (r *Remote) ApproveSpec(ctx context.Context, path string, force bool) (api.SpecApproved, error)

ApproveSpec approves a saved spec (WorkspaceService.ApproveSpec).

func (*Remote) AuditShell

func (r *Remote) AuditShell(command string, exitCode int, startErr error)

AuditShell records a command the user ran here directly in the workspace's audit log (WorkspaceService.AuditShell).

func (*Remote) AvailableLocales

func (r *Remote) AvailableLocales() ([]api.LocaleInfo, string)

AvailableLocales lists the languages the model can reply in, and the folder of extra translations (WorkspaceService.ListLocales) (on failure, warn is told and it returns nothing).

func (*Remote) ClearApprovals

func (r *Remote) ClearApprovals() (int, error)

ClearApprovals revokes every standing approval and returns how many went, and which stay saved (WorkspaceService.RevokeApprovals).

func (*Remote) ClearGoal

func (r *Remote) ClearGoal() error

ClearGoal removes it (SessionService.ClearGoal).

func (*Remote) Close

func (r *Remote) Close() error

Close leaves the workspace open in the service, for other clients.

func (*Remote) Compact

func (r *Remote) Compact(ctx context.Context, focus string) (api.CompactResult, error)

Compact summarizes the session's older events to free context, focusing the summary on focus if given (SessionService.Compact).

func (*Remote) Context

func (r *Remote) Context(parts bool) (api.ContextInfo, error)

Context describes how full the active session's context is (from SessionService.GetUsage).

func (*Remote) DataConnections added in v0.9.7

func (r *Remote) DataConnections(ctx context.Context) ([]api.DataConnection, error)

DataConnections are the workspace's database connections and their saved queries (WorkspaceService.ListDataConnections, spec_059_data DAT-45).

func (*Remote) DeletePictureSession added in v0.9.7

func (r *Remote) DeletePictureSession(ctx context.Context, id string) error

DeletePictureSession deletes session id and its pictures (not what was saved into the workspace).

func (*Remote) Dir

func (r *Remote) Dir() string

Dir is the workspace's directory.

func (*Remote) ExportSession

func (r *Remote) ExportSession(id string) (string, error)

ExportSession is a session as Markdown (SessionService.ExportSession).

func (*Remote) FollowBackground

func (r *Remote) FollowBackground(ctx context.Context, id string, on func(api.Event)) (api.TurnResult, error)

FollowBackground shows a background run from its start until it ends, answering its waiting requests through the UI set with SetUI, and returns its result (blitz attach).

func (*Remote) ForgetNote

func (r *Remote) ForgetNote(name string) error

ForgetNote deletes one (WorkspaceService.ForgetNote).

func (*Remote) ForgetProjectTrust added in v0.3.1

func (r *Remote) ForgetProjectTrust() error

ForgetProjectTrust forgets the decision about the project settings in the service, which reopens the workspace without them unless a turn is running there (WorkspaceService.ForgetProjectTrust).

func (*Remote) ForkSession

func (r *Remote) ForkSession(ctx context.Context, turn int) (api.SessionInfo, error)

ForkSession starts a copy of the active session (SessionService.ForkSession).

func (*Remote) GitDiff

func (r *Remote) GitDiff(ctx context.Context, color bool) (string, error)

GitDiff is `git diff` of the workspace, with color if asked (WorkspaceService.GetDiff).

func (*Remote) Goal

func (r *Remote) Goal() (api.Goal, error)

Goal is the active session's goal (SessionService.GetGoal).

func (*Remote) ImagesEnabled

func (r *Remote) ImagesEnabled() bool

ImagesEnabled reports whether the workspace accepts images (its images settings, from GetSettings).

func (*Remote) ImpactSpec added in v0.9.4

func (r *Remote) ImpactSpec(ctx context.Context, path string, judge, estimate bool) (api.SpecImpact, error)

ImpactSpec scans a spec's changes' impact (WorkspaceService.ImpactSpec).

func (*Remote) ListAgents

func (r *Remote) ListAgents() []api.AgentInfo

ListAgents lists the agents the workspace offers, marking the active one (WorkspaceService.ListAgents) (on failure, warn is told and it returns nothing).

func (*Remote) ListApprovals

func (r *Remote) ListApprovals() []api.Approval

ListApprovals lists the standing approvals the user gave (WorkspaceService.ListApprovals) (on failure, warn is told and it returns nothing).

func (*Remote) ListCheckpoints

func (r *Remote) ListCheckpoints() []api.Checkpoint

ListCheckpoints lists the turns that changed files, newest first (WorkspaceService.ListCheckpoints) (on failure, warn is told and it returns nothing).

func (*Remote) ListCommands

func (r *Remote) ListCommands() []api.CommandInfo

ListCommands lists the workspace's custom slash commands (WorkspaceService.ListCommands) (on failure, warn is told and it returns nothing).

func (*Remote) ListEnvs

func (r *Remote) ListEnvs() ([]api.Env, error)

ListEnvs lists the Python environments skills' scripts use (WorkspaceService.ListEnvs).

func (*Remote) ListHooks

func (r *Remote) ListHooks() []api.HookInfo

ListHooks are the workspace's hooks in the service (WorkspaceService.ListHooks); on failure warn is told and there are none.

func (*Remote) ListMCPServers

func (r *Remote) ListMCPServers() []api.MCPServer

ListMCPServers lists the configured MCP servers and their state (WorkspaceService.ListMCPServers) (on failure, warn is told and it returns nothing).

func (*Remote) ListModels added in v0.9.6

func (r *Remote) ListModels(ctx context.Context, refresh bool) (api.ModelList, error)

ListModels is every chat model of every provider the workspace sets up, as the service lists them (spec_061_models MOD-01).

func (*Remote) ListNotes

func (r *Remote) ListNotes() ([]api.Note, error)

ListNotes are the notes the agent saved in the workspace (WorkspaceService.ListNotes).

func (*Remote) ListPermissionRules

func (r *Remote) ListPermissionRules() []api.PermissionRule

ListPermissionRules lists the allow, ask and deny rules in effect (WorkspaceService.ListPermissionRules) (on failure, warn is told and it returns nothing).

func (*Remote) ListPersonalities added in v1.0.0

func (r *Remote) ListPersonalities() []api.Personality

ListPersonalities are the personalities (ConfigService.ListPersonalities), the workspace's marked active; on failure warn is told and there are none.

func (*Remote) ListSessions

func (r *Remote) ListSessions(all bool) ([]api.SessionInfo, error)

ListSessions lists the workspace's sessions, or every workspace's with all (SessionService.ListSessions).

func (*Remote) ListSkills

func (r *Remote) ListSkills() []api.SkillInfo

ListSkills lists the skills the workspace offers (WorkspaceService.ListSkills).

func (*Remote) ListSpecs added in v0.9.4

func (r *Remote) ListSpecs() ([]api.SpecSummary, error)

ListSpecs is the project's specification, in order (WorkspaceService.ListSpecs).

func (*Remote) ListStyles

func (r *Remote) ListStyles() []api.StyleInfo

ListStyles are the output styles (WorkspaceService.ListStyles); on failure warn is told and there are none.

func (*Remote) ListTasks

func (r *Remote) ListTasks() []api.TaskInfo

ListTasks are the service's background tasks started in this client's turns (WorkspaceService.ListTasks), oldest first.

func (*Remote) LoadAttachments

func (r *Remote) LoadAttachments(paths []string, prompt string, warn func(string)) ([]*images.Image, error)

LoadAttachments loads image files (failures are errors naming the path) and @image mentions in prompt (failures are warnings), as the local workspace does.

func (*Remote) LoadImage

func (r *Remote) LoadImage(path string) (*images.Image, error)

LoadImage prepares the image at path (in the workspace) for a prompt (WorkspaceService.LoadImage).

func (*Remote) LoadSession

func (r *Remote) LoadSession(ref string) (api.SessionInfo, bool, error)

LoadSession makes the session ref names active: an ID, or a snapshot's name, which starts a new session copied from it (reported as branched) (SessionService.LoadSession).

func (*Remote) MakePicture added in v0.9.7

func (r *Remote) MakePicture(ctx context.Context, req *pb.MakePictureRequest) (*pb.MakePictureResponse, error)

MakePicture makes req's turn in the workspace (its Workspace is set).

func (*Remote) MemoryFiles

func (r *Remote) MemoryFiles() []string

MemoryFiles lists the project memory files loaded (AGENTS.md and the like) (WorkspaceService.ReloadMemory) (on failure, warn is told and it returns nothing).

func (*Remote) Model

func (r *Remote) Model() api.ModelInfo

Model describes the model in use, and why it's unavailable if it is (WorkspaceService.GetModel) (on failure, warn is told and it returns nothing).

func (*Remote) ModelErr

func (r *Remote) ModelErr() error

ModelErr is why the workspace's model was unavailable when attaching (nil if it worked).

func (*Remote) ModelSettings

func (r *Remote) ModelSettings(ref string) (api.ModelSettingsInfo, error)

ModelSettings returns one model's generation settings, with the global ones they fall back to (WorkspaceService.GetModelSettings).

func (*Remote) MoveSession

func (r *Remote) MoveSession(id string) (api.SessionInfo, error)

MoveSession carries session id into this client's workspace in the service and makes it active there (SessionService.MoveSession, /cd).

func (*Remote) NewSession

func (r *Remote) NewSession() (api.SessionInfo, error)

NewSession starts a new session and makes it active (SessionService.NewSession).

func (*Remote) OpenSession

func (r *Remote) OpenSession(resume string, cont bool) (api.SessionInfo, bool, error)

OpenSession picks the session to use, as the CLI does at start: the one resume names (an ID, or a snapshot to start from), the latest when cont is set, else a new one. It reports whether a session was resumed (SessionService.OpenSession).

func (*Remote) PendingTaskRequests

func (r *Remote) PendingTaskRequests() []api.TaskRequest

PendingTaskRequests are the approval requests and questions of this client's tasks waiting for an answer (WorkspaceService.ListTaskRequests).

func (*Remote) PictureModels added in v0.9.7

func (r *Remote) PictureModels(ctx context.Context) (*pb.ListPictureModelsResponse, error)

PictureModels are the image models the workspace offers, the images model marked default, and the folder pictures are saved in.

func (*Remote) PictureSession added in v0.9.7

func (r *Remote) PictureSession(ctx context.Context, id string) (*pb.PictureSession, error)

PictureSession is session id.

func (*Remote) PictureSessions added in v0.9.7

func (r *Remote) PictureSessions(ctx context.Context) ([]*pb.PictureSession, error)

PictureSessions are the workspace's Pictures sessions, newest first.

func (*Remote) PinModel

func (r *Remote) PinModel(ctx context.Context, agent, ref string) (api.PinResult, error)

PinModel runs agent on the model ref from now on, and saves the pin in the configuration (WorkspaceService.PinModel).

func (*Remote) PlanSpec added in v0.9.4

func (r *Remote) PlanSpec(path string) (api.SpecPlan, error)

PlanSpec is how a spec would be implemented (WorkspaceService.PlanSpec).

func (*Remote) PreviewSessionModel added in v0.9.2

func (r *Remote) PreviewSessionModel(ctx context.Context, id, ref string) (api.ModelPreview, error)

PreviewSessionModel says what moving conversation id to ref would mean (SessionService.PreviewSessionModel).

func (*Remote) ProcessOutputIn added in v0.8.5

func (r *Remote) ProcessOutputIn(workspace string, id int) (string, api.ProcessInfo, error)

ProcessOutputIn is background process id's captured output in workspace, whichever session started it.

func (*Remote) Processes

func (r *Remote) Processes() api.Processes

Processes are the service's background processes started in this client's turns (WorkspaceService.ListProcesses and KillProcess): the ones to wait for or stop when it exits. Others' stay.

func (*Remote) ProjectSettings

func (r *Remote) ProjectSettings() api.ProjectSettings

ProjectSettings are the workspace's project settings in the service (WorkspaceService.GetProjectSettings); on failure warn is told and they are empty, in state TrustUnknown (not "nothing to trust").

func (*Remote) PruneEnvs

func (r *Remote) PruneEnvs() (api.PruneResult, error)

PruneEnvs deletes the skill environments no skill needs any more (WorkspaceService.PruneEnvs).

func (*Remote) Reasoning added in v1.3.0

func (r *Remote) Reasoning(id string, turn int) (api.Reasoning, error)

Reasoning is session id's turns and one turn's reasoning graph (SessionService.GetReasoning).

func (*Remote) RecordSpecChange added in v0.9.4

func (r *Remote) RecordSpecChange(ctx context.Context, path string) (api.SpecRecorded, error)

RecordSpecChange records a saved change to an approved spec (WorkspaceService.RecordSpecChange).

func (*Remote) Reflection added in v0.8.3

func (r *Remote) Reflection() (api.Reflection, error)

Reflection is what the harness has to learn (WorkspaceService.GetReflection).

func (*Remote) Reindex added in v0.3.0

func (r *Remote) Reindex() error

Reindex starts a scan for search (WorkspaceService.Reindex).

func (*Remote) Reload added in v0.6.5

func (r *Remote) Reload(ctx context.Context) (api.ReloadResult, error)

Reload reads the agents, skills, instruction files and rules again (WorkspaceService.ReloadAgentFiles).

func (*Remote) ReloadMemory

func (r *Remote) ReloadMemory(ctx context.Context) ([]string, error)

ReloadMemory reads the project memory files again and lists them (WorkspaceService.ReloadMemory).

func (*Remote) RemoveEnv

func (r *Remote) RemoveEnv(key string) error

RemoveEnv deletes one skill environment by key (WorkspaceService.RemoveEnv).

func (*Remote) RemovePermissionRule

func (r *Remote) RemovePermissionRule(rule string, save api.Scope) (api.PermissionChange, error)

RemovePermissionRule removes a rule, from the session or, with save, from the configuration (WorkspaceService.RemovePermissionRule).

func (*Remote) RenameSession

func (r *Remote) RenameSession(title string) (api.SessionInfo, error)

RenameSession gives the active session a title (SessionService.RenameSession).

func (*Remote) RepoCodeTrust added in v1.2.0

func (r *Remote) RepoCodeTrust() (string, []string, error)

RepoCodeTrust is whether the workspace's language servers may run its own code, and what it is (spec_037 VE-43a; LanguageService GetLanguageStatus): "" when they'd run none.

func (*Remote) ReviewSpec added in v0.9.4

func (r *Remote) ReviewSpec(ctx context.Context, path, text string, judge bool) (api.SpecReview, error)

ReviewSpec reviews a spec as edited (WorkspaceService.ReviewSpec).

func (*Remote) RevokeApprovals

func (r *Remote) RevokeApprovals(keys ...string) (int, error)

RevokeApprovals revokes the approvals with keys and returns how many went, and which stay saved (WorkspaceService.RevokeApprovals).

func (*Remote) Rewind

func (r *Remote) Rewind(ctx context.Context, index int, mode api.RewindMode, force bool) (api.RewindResult, error)

Rewind takes the active session back to one of its prompts.

func (*Remote) RewindPoints

func (r *Remote) RewindPoints() ([]api.RewindPoint, error)

RewindPoints lists the active session's prompts.

func (*Remote) Run

func (r *Remote) Run(ctx context.Context, sessionID string, t api.Turn, on func(api.Event)) (api.TurnResult, error)

Run runs a turn in the service, answering its approval requests and questions through the UI set with SetUI. OnFinished runs when the turn's last event arrives, after the service has collected unread steer messages; a message sent later waits for the agent's next turn.

func (*Remote) RunBlitzCommand added in v0.9.6

func (r *Remote) RunBlitzCommand(ctx context.Context, command, argsJSON string, confirm bool, secrets map[string]string) (*pb.RunBlitzCommandResponse, error)

RunBlitzCommand runs one of Blitz's own commands in the service (the CLI's blitz do, spec_060_blitz_tools DRV-02).

func (*Remote) RunDataQuery added in v0.9.7

func (r *Remote) RunDataQuery(ctx context.Context, q api.DataQuery) (api.DataTable, error)

RunDataQuery runs q read-only on the workspace's connection it names (WorkspaceService.RunConnectorQuery with connection_name, DAT-45); the service's problem is the error.

func (*Remote) RunEval added in v0.7.1

func (r *Remote) RunEval(ctx context.Context, name string, o api.EvalOptions) (api.EvalRun, error)

RunEval runs the workspace's eval name (WorkspaceService.RunEval), telling o of the run's start and each result as they stream in.

func (*Remote) RunGitHook added in v1.1.0

func (r *Remote) RunGitHook(ctx context.Context, event, input string) ([]api.HookResult, error)

RunGitHook runs the workflows that run on the git hook event on input (WorkspaceService.RunGitHook, spec_043 WF-32).

func (*Remote) RunningProcesses added in v0.8.5

func (r *Remote) RunningProcesses(everywhere bool) ([]api.WorkspaceProcess, error)

RunningProcesses are the agents' background processes still running, whichever session started them (/processes, spec_052_processes): this workspace's, or every open workspace's when everywhere.

func (*Remote) SandboxSummary

func (r *Remote) SandboxSummary() []string

SandboxSummary describes the workspace's file, command and OS sandbox policy, a line each (WorkspaceService.GetSandbox) (on failure, warn is told and it returns nothing).

func (*Remote) SavePicture added in v0.9.7

func (r *Remote) SavePicture(ctx context.Context, session, picture, path string) (string, error)

SavePicture writes session's picture into the workspace at path ("" for its name in the pictures folder), returning where it went.

func (*Remote) SaveSnapshot

func (r *Remote) SaveSnapshot(name string, force bool) (api.SessionInfo, error)

SaveSnapshot saves the active session as the named snapshot; force replaces one of that name (SessionService.SaveSnapshot).

func (*Remote) Search added in v0.3.0

func (r *Remote) Search(ctx context.Context, q api.SearchQuery) (api.SearchResult, error)

Search searches the workspace's index (WorkspaceService.SearchWorkspace).

func (*Remote) SearchProvider

func (r *Remote) SearchProvider() (string, error)

SearchProvider names the web search provider the workspace uses (WorkspaceService.GetSearchProvider).

func (*Remote) SearchSession

func (r *Remote) SearchSession(terms string) (int, string)

SearchSession searches the session's history for terms and returns the number of passages found and a prompt with them (SessionService.SearchSession) (on failure, warn is told and it returns nothing).

func (*Remote) SearchSkills

func (r *Remote) SearchSkills(query string) []api.SkillInfo

SearchSkills lists the skills matching query (WorkspaceService.ListSkills).

func (*Remote) SearchStatus added in v0.3.0

func (r *Remote) SearchStatus() api.SearchStatus

SearchStatus is how the workspace's search index is (WorkspaceService.GetSearchStatus); on failure, warn is told and it's the zero status.

func (*Remote) SearchWeb

func (r *Remote) SearchWeb(ctx context.Context, terms string) (api.WebSearch, error)

SearchWeb searches the web for terms and returns the links and the prompt that hands them to the agent (WorkspaceService.SearchWeb).

func (*Remote) SessionDiff

func (r *Remote) SessionDiff() string

SessionDiff is a unified diff of the files the session's turns changed (WorkspaceService.GetDiff) (on failure, warn is told and it returns nothing).

func (*Remote) SessionLedger added in v0.9.2

func (r *Remote) SessionLedger() ([]api.Call, api.Totals, error)

SessionLedger is the active session's calls and their totals by model and purpose (SessionService.GetUsage with calls).

func (*Remote) SessionLedgerOf added in v0.9.2

func (r *Remote) SessionLedgerOf(id string) ([]api.Call, api.Totals, error)

SessionLedgerOf is SessionLedger for saved session id ("": the active one).

func (*Remote) SessionUsage

func (r *Remote) SessionUsage() (api.Usage, error)

SessionUsage is the active session's token use and cost (SessionService.GetUsage).

func (*Remote) Set

func (r *Remote) Set(ctx context.Context, key, value string) (string, error)

Set changes one run setting (such as effort or agency) and returns its key as applied (WorkspaceService.SetSetting).

func (*Remote) SetAgent

func (r *Remote) SetAgent(ctx context.Context, name string) (api.AgentInfo, error)

SetAgent switches the workspace to the named agent (WorkspaceService.SetAgent).

func (*Remote) SetGoal

func (r *Remote) SetGoal(condition string) (api.Goal, error)

SetGoal gives the active session a goal (SessionService.SetGoal).

func (*Remote) SetLocale

func (r *Remote) SetLocale(ctx context.Context, input string) (api.LocaleChange, error)

SetLocale sets the language the model replies in from input (a tag or a name) (WorkspaceService.SetLocale).

func (*Remote) SetModel

func (r *Remote) SetModel(ctx context.Context, ref string) (string, error)

SetModel switches the workspace's model to ref ("provider/model" or a model); it returns the agent's pin that now overrides it, if any (WorkspaceService.SetModel).

func (*Remote) SetPermissionMode

func (r *Remote) SetPermissionMode(mode string) (string, error)

SetPermissionMode sets the permission mode (default, accept-edits, plan, auto, dont-ask or bypass) and returns it (WorkspaceService.SetPermissionMode).

func (*Remote) SetSessionModel added in v0.9.2

func (r *Remote) SetSessionModel(ctx context.Context, id, ref string) (api.ModelPreview, error)

SetSessionModel moves conversation id to ref from its next turn (SessionService.SetSessionModel).

func (*Remote) SetUI

func (r *Remote) SetUI(approve api.Approver, ask api.UserPromptFunc)

SetUI sets how Run asks the user: approve for approval requests, ask for the agent's questions.

func (*Remote) Settings

func (r *Remote) Settings() api.Settings

Settings returns the workspace's run settings: agent, model, mode, effort, agency, language (WorkspaceService.GetSettings).

func (*Remote) Skill

func (r *Remote) Skill(name string) (api.SkillInfo, bool)

Skill returns the named skill, and whether it exists (WorkspaceService.GetSkill).

func (*Remote) StartBackground

func (r *Remote) StartBackground(ctx context.Context, t api.Turn) (api.BackgroundRun, error)

StartBackground starts t in a new session of the workspace, run by the service with no client attached (SessionService.StartBackground).

func (*Remote) Steer

func (r *Remote) Steer(ctx context.Context, sessionID, text string) error

Steer adds text to the turn running in sessionID, which the agent reads before its next step (SessionService.Steer).

func (*Remote) StopProcessIn added in v0.8.5

func (r *Remote) StopProcessIn(workspace string, id int) (api.ProcessInfo, error)

StopProcessIn stops background process id in workspace, whichever session started it: the user's own stop.

func (*Remote) StopTask

func (r *Remote) StopTask(id string) (api.TaskInfo, error)

StopTask stops one of this client's tasks (WorkspaceService.StopTask).

func (*Remote) TakeProcessNotices

func (r *Remote) TakeProcessNotices(session string) []string

TakeProcessNotices are what the session's watched processes reported while it was idle (WorkspaceService.TakeProcessNotices).

func (*Remote) Task

func (r *Remote) Task(id string) (api.TaskInfo, []string, error)

Task is one of this client's tasks with its latest events (WorkspaceService.GetTask).

func (*Remote) TraceSpecs added in v0.9.4

func (r *Remote) TraceSpecs(path string) ([]api.SpecRequirement, error)

TraceSpecs is a spec's requirements as traced (WorkspaceService.TraceSpecs).

func (*Remote) TrustProject

func (r *Remote) TrustProject(hash string, trusted bool) error

TrustProject records the decision in the service, which reopens the workspace with it unless a turn is running there (WorkspaceService.TrustProject).

func (*Remote) TrustRepoCode added in v1.2.0

func (r *Remote) TrustRepoCode(trusted bool) error

TrustRepoCode records whether the workspace's language servers may run its own code (LanguageService.TrustLanguageCode).

func (*Remote) Undo

func (r *Remote) Undo(sessionID string, force bool) (api.UndoResult, error)

Undo restores the files sessionID's last turn changed ("": the active session's); force overwrites files changed since (WorkspaceService.Undo).

func (*Remote) Unpin

func (r *Remote) Unpin(ctx context.Context, agent string) (api.PinResult, error)

Unpin returns agent to the workspace's model (WorkspaceService.UnpinModel).

func (*Remote) UpdateModelSettings

func (r *Remote) UpdateModelSettings(ref string, reset bool, changes []api.Setting) (api.ModelSettingsChange, error)

UpdateModelSettings changes a model's generation settings, or with reset clears them, and saves them (WorkspaceService.UpdateModelSettings).

func (*Remote) ValidateAssets added in v1.1.0

func (r *Remote) ValidateAssets(ctx context.Context) ([]api.AssetFinding, error)

ValidateAssets checks the workspace's assets (WorkspaceService.ValidateAssets, spec_065 PK-14).

func (*Remote) VerifySpec added in v0.9.4

func (r *Remote) VerifySpec(ctx context.Context, path string, judge, estimate bool) (api.SpecVerification, error)

VerifySpec verifies a saved spec (WorkspaceService.VerifySpec).

type RuleCheck added in v0.3.1

type RuleCheck struct {
	Error, Rule, Kind, Pattern, Form, Redirect string
	Tested, Matches                            bool
}

RuleCheck is a permission rule checked without saving it: Error says why it's invalid; otherwise its canonical form, kind, pattern and how the pattern matches (prefix, glob, regex, path or name), and, for a sample, whether it applies (Tested, Matches) and a file the sample writes through a redirection (an allow rule still asks).

type ServiceFile added in v0.9.0

type ServiceFile struct {
	URN, Path string
	Size      int64
}

ServiceFile is one of a run's files.

type ServiceJob added in v0.9.0

type ServiceJob struct {
	ID, Name, Schedule string
	// Workspace is its handle; Dir where it's cloned here.
	Workspace, Dir string
	Enabled        bool
	NextRun        time.Time // zero when none
}

ServiceJob is a job the organization's service runs (spec_053 EN-42).

type ServiceJobMissing added in v0.9.0

type ServiceJobMissing struct {
	Reason, Detail, SyncState string
}

ServiceJobMissing is why the organization's service hasn't got a job: Reason is outside, not_pushed, saving (SyncState says how sync stands), not_service or not_read; Detail says more (the path the service reads, or the service's why).

type ServiceRequest added in v0.9.0

type ServiceRequest struct{ Tool, Kind, Detail string }

ServiceRequest is what a paused run asks for.

type ServiceRun added in v0.9.0

type ServiceRun struct {
	ID, Trigger, Status, Note, Output string
	CostUSD                           float64
	Created                           time.Time
	Branch                            string
	// Merged is whether its changes are on main too; MergeNote why not.
	Merged    bool
	MergeNote string
	// Artifacts names its files; Pending what a paused run asks for.
	Artifacts string
	Pending   *ServiceRequest
	// JobName and Workspace (its handle) are given with a run waiting
	// for the person's answer.
	JobName, Workspace string
}

ServiceRun is one of a service job's runs.

type Settings added in v0.3.1

type Settings struct {
	// contains filtered or unexported fields
}

Settings is the service's ConfigService for a front end that has no workspace open: the providers and their models, the settings files, permission rules, sign-in and the organization (enterprise).

func AttachSettings added in v0.3.1

func AttachSettings(sock string) *Settings

AttachSettings reaches the settings of the service listening on sock.

func AttachSettingsHTTP added in v0.3.1

func AttachSettingsHTTP(hc connect.HTTPClient, baseURL string) *Settings

AttachSettingsHTTP is AttachSettings over any HTTP client.

func (*Settings) AcceptTerms added in v0.9.0

func (s *Settings) AcceptTerms(ctx context.Context, version string) (Organization, error)

AcceptTerms records that the person accepted version of the terms (ConfigService.AcceptTerms).

func (*Settings) AnswerServiceRun added in v0.9.0

func (s *Settings) AnswerServiceRun(ctx context.Context, run string, approve bool, note string) (ServiceRun, error)

AnswerServiceRun approves or denies what a paused run asks for.

func (*Settings) Branding added in v0.9.1

func (s *Settings) Branding(ctx context.Context, refresh bool) (b Branding, why string, err error)

Branding is the organization's branding (ConfigService.GetBranding), asking its service first when refresh is set; why is the reason its service couldn't be asked then (the kept copy is answered all the same).

func (*Settings) CheckAPIKey added in v1.3.0

func (s *Settings) CheckAPIKey(ctx context.Context, dir, provider, key string) (KeyCheck, error)

CheckAPIKey asks provider whether it takes key, before it's saved (ConfigService.CheckApiKey; spec_067_cli_parity CLP-41).

func (*Settings) CheckPermission added in v0.3.1

func (s *Settings) CheckPermission(ctx context.Context, effect, rule, sample string) (RuleCheck, error)

CheckPermission checks rule as effect (allow, ask or deny), and tries it on sample unless that's "" (ConfigService.CheckPermission).

func (*Settings) Connect added in v0.9.0

func (s *Settings) Connect(ctx context.Context, url string) (Organization, error)

Connect connects to the organization's service at url, after checking it's one, or disconnects with "" (ConfigService.ConnectEnterprise).

func (*Settings) ConnectorConsent added in v1.1.0

func (s *Settings) ConnectorConsent(ctx context.Context) (*pb.GetConnectorConsentResponse, error)

ConnectorConsent is which shared connectors query as the person, whether they've allowed it, and where (ConfigService.GetConnectorConsent, spec_053 EN-76).

func (*Settings) CreateOrgWorkspace added in v0.9.0

func (s *Settings) CreateOrgWorkspace(ctx context.Context, name, handle string, personal bool) (OrgWorkspace, error)

CreateOrgWorkspace makes a workspace of the organization's (ConfigService.CreateOrgWorkspace).

func (*Settings) GitCredential added in v0.9.0

func (s *Settings) GitCredential(ctx context.Context, protocol, host string) (user, password string, ok bool, err error)

GitCredential is Git's credential for host, asked over protocol (ConfigService.GitCredential): ok false when the service has none for it.

func (*Settings) ListChatModels added in v0.9.6

func (s *Settings) ListChatModels(ctx context.Context, dir string, providers ...string) ([]ProviderModels, error)

ListChatModels is ListModels with only the models that hold a conversation, each provider's newest first (spec_061_models MOD-21).

func (*Settings) ListModels added in v0.3.1

func (s *Settings) ListModels(ctx context.Context, dir string, providers ...string) ([]ProviderModels, error)

ListModels lists the models of the providers named, or of every one configured for the workspace in dir ("" for the user's settings) (ConfigService.ListModels).

func (*Settings) ListSubmissions added in v1.1.0

func (s *Settings) ListSubmissions(ctx context.Context) (*pb.ListSubmissionsResponse, error)

ListSubmissions is the person's submissions, their own assets and the kinds the organization takes (ConfigService.ListSubmissions, EN-95).

func (*Settings) OpenOrgWorkspace added in v0.9.0

func (s *Settings) OpenOrgWorkspace(ctx context.Context, handle string) (dir string, cloned bool, err error)

OpenOrgWorkspace clones an organization workspace the first time, and gives its folder (ConfigService.OpenOrgWorkspace).

func (*Settings) OrgItems added in v0.9.0

func (s *Settings) OrgItems(ctx context.Context, dir, kind string) (*pb.ListOrgItemsResponse, error)

OrgItems are the organization's assets the person is offered (its agents, skills, workflows, rules and guardrails; EN-80), of one kind or every one, with who decided each (ConfigService.ListOrgItems).

func (*Settings) OrgNotices added in v0.9.0

func (s *Settings) OrgNotices(ctx context.Context) (*pb.OrgNotices, error)

OrgNotices are how the person hears of their jobs' runs on the organization's service (ConfigService.GetOrgNotices).

func (*Settings) OrgSync added in v0.9.0

func (s *Settings) OrgSync(ctx context.Context, dir string) (OrgSync, error)

OrgSync is the sync of the workspace at dir.

func (*Settings) OrgUsage added in v0.9.0

func (s *Settings) OrgUsage(ctx context.Context) (OrgUsage, error)

OrgUsage asks blitzd for the person's usage and limits.

func (*Settings) OrgWorkspaces added in v0.9.0

func (s *Settings) OrgWorkspaces(ctx context.Context) ([]OrgWorkspace, string, error)

OrgWorkspaces are the organization's workspaces the person has a role in, and the organization's name (ConfigService.ListOrgWorkspaces).

func (*Settings) Organization added in v0.9.0

func (s *Settings) Organization(ctx context.Context, check bool) (Organization, error)

Organization is the organization's service and the sign-in to it; with check, after asking the service (ConfigService.GetEnterprise).

func (*Settings) Policy added in v1.1.0

func (s *Settings) Policy(ctx context.Context) ([]*pb.PolicySetting, error)

Policy is the person's effective policy from their organization, each setting with who decided it (EnterpriseState.policy, spec_053 EN-39).

func (*Settings) PushServiceJob added in v0.9.0

func (s *Settings) PushServiceJob(ctx context.Context, dir, name string) (*ServiceJobMissing, error)

PushServiceJob commits the job's folder, pushes the workspace at dir to its main and has the service read it; nil when the service has it now.

func (*Settings) RefreshOrganization added in v1.1.0

func (s *Settings) RefreshOrganization(ctx context.Context) (bool, error)

RefreshOrganization fetches the organization's catalog and the person's policy now, saying whether either changed (ConfigService.RefreshEnterprise, spec_053 EN-38a).

func (*Settings) RevokeConnectorConsent added in v1.1.0

func (s *Settings) RevokeConnectorConsent(ctx context.Context) error

RevokeConnectorConsent forgets the person's consent (ConfigService.RevokeConnectorConsent).

func (*Settings) RunServiceJob added in v0.9.0

func (s *Settings) RunServiceJob(ctx context.Context, id string) (ServiceRun, error)

RunServiceJob starts a run of a service job now.

func (*Settings) SaveOrgSync added in v0.9.0

func (s *Settings) SaveOrgSync(ctx context.Context, dir string) (OrgSync, error)

SaveOrgSync saves the workspace at dir's changes and sends what waits now, and is its sync after.

func (*Settings) SaveServiceRunFile added in v0.9.0

func (s *Settings) SaveServiceRunFile(ctx context.Context, urn string) (string, error)

SaveServiceRunFile saves one of a run's files in Downloads, answering where.

func (*Settings) ServiceApprovals added in v0.9.0

func (s *Settings) ServiceApprovals(ctx context.Context) ([]ServiceRun, error)

ServiceApprovals are the runs paused for the person's answer (EN-43).

func (*Settings) ServiceJobRuns added in v0.9.0

func (s *Settings) ServiceJobRuns(ctx context.Context, dir, name string) ([]ServiceRun, error)

ServiceJobRuns are a service job's latest runs, by the folder its workspace is cloned in and its name (ConfigService.GetServiceJob).

func (*Settings) ServiceJobs added in v0.9.0

func (s *Settings) ServiceJobs(ctx context.Context) ([]ServiceJob, error)

ServiceJobs are the jobs the organization's service runs in the person's workspaces (ConfigService.ListServiceJobs).

func (*Settings) ServiceRunFiles added in v0.9.0

func (s *Settings) ServiceRunFiles(ctx context.Context, artifacts string) ([]ServiceFile, error)

ServiceRunFiles are the files a run left, by its artifacts' name.

func (*Settings) SetConfigValue added in v1.3.0

func (s *Settings) SetConfigValue(ctx context.Context, dir, key, value string) (ConfigChange, error)

SetConfigValue sets one settings key, globally (dir "") or for the workspace in dir, and applies it to the workspaces open in the service (ConfigService.SetConfigValue; spec_067_cli_parity CLP-40).

func (*Settings) SetOrgItem added in v1.1.0

func (s *Settings) SetOrgItem(ctx context.Context, kind, name string, on bool) (*pb.OrgItem, error)

SetOrgItem switches one of the organization's available assets on or off for the person (ConfigService.SetOrgItem, spec_053 EN-83).

func (*Settings) SetOrgNotices added in v0.9.0

func (s *Settings) SetOrgNotices(ctx context.Context, n *pb.OrgNotices) (*pb.OrgNotices, error)

SetOrgNotices keeps them (ConfigService.SetOrgNotices).

func (*Settings) SetServiceJobEnabled added in v0.9.0

func (s *Settings) SetServiceJobEnabled(ctx context.Context, id string, on bool) error

SetServiceJobEnabled switches a service job on or off.

func (*Settings) ShareOwnItem added in v1.1.0

func (s *Settings) ShareOwnItem(ctx context.Context, kind, name, note string) (*pb.Submission, error)

ShareOwnItem submits one of the person's own assets to share with the organization (ConfigService.ShareOwnItem, EN-95).

func (*Settings) ShareWithOrganization added in v0.9.0

func (s *Settings) ShareWithOrganization(ctx context.Context, dir, name, handle string, personal bool) (OrgWorkspace, []string, error)

ShareWithOrganization shares the folder dir with the organization where it is (ConfigService.ShareWithOrganization, EN-66): the workspace, and what the person should know.

func (*Settings) SignIn added in v0.3.1

func (s *Settings) SignIn(ctx context.Context, dir, provider, profile string, on func(SignInEvent)) (SignInStatus, error)

SignIn runs provider's sign-in in the service, calling on with each line its tool prints, and returns the provider's sign-in after it (ConfigService.SignIn). Cancelling ctx stops it.

func (*Settings) SignInOrganization added in v0.9.0

func (s *Settings) SignInOrganization(ctx context.Context, device bool, on func(OrganizationPrompt)) (Organization, error)

SignInOrganization signs in to the organization's service: in a browser on the service's computer, or with a code (device), calling on with what to open (ConfigService.EnterpriseSignIn). Cancelling ctx stops it.

func (*Settings) SignIns added in v0.3.1

func (s *Settings) SignIns(ctx context.Context, dir, provider, profile string) ([]SignInStatus, error)

SignIns are the providers' sign-ins (one provider's, or all when provider is ""), for the workspace in dir ("" for the user's settings) (ConfigService.GetSignIn).

func (*Settings) SignOut added in v0.3.1

func (s *Settings) SignOut(ctx context.Context, dir, provider, profile string) (SignInStatus, error)

SignOut signs out of provider in the service and returns its sign-in after (ConfigService.SignOut).

func (*Settings) SignOutOrganization added in v0.9.0

func (s *Settings) SignOutOrganization(ctx context.Context) (Organization, error)

SignOutOrganization signs out of the organization's service (ConfigService.EnterpriseSignOut).

func (*Settings) SyncOwnItems added in v1.1.0

func (s *Settings) SyncOwnItems(ctx context.Context) (*pb.SyncOwnItemsResponse, error)

SyncOwnItems syncs the person's own assets with the organization now (ConfigService.SyncOwnItems, spec_053 EN-93).

func (*Settings) TakeServiceRun added in v0.9.0

func (s *Settings) TakeServiceRun(ctx context.Context, dir, jobID, runID string) (ServiceRun, error)

TakeServiceRun adds a service run's changes, on its branch, to the main of the workspace cloned at dir, which takes them in.

func (*Settings) Terms added in v0.9.0

func (s *Settings) Terms(ctx context.Context) (OrganizationTerms, error)

Terms are the organization's terms in force (ConfigService.GetTerms).

func (*Settings) WatchServiceRuns added in v0.9.1

func (s *Settings) WatchServiceRuns(ctx context.Context, on func([]GoingServiceRun)) error

WatchServiceRuns calls on with every run going now on the service, at once and again each time one changes (ConfigService.WatchServiceRuns), until ctx ends (nil) or the stream fails.

func (*Settings) WhyNotServiceJob added in v0.9.0

func (s *Settings) WhyNotServiceJob(ctx context.Context, dir, name string) (*ServiceJobMissing, error)

WhyNotServiceJob says why the service hasn't got the job name in the workspace cloned at dir (nil when it has it), having it read main.

type SignInEvent added in v0.3.1

type SignInEvent struct {
	Line, URL, Code string
}

SignInEvent is a line the vendor's tool printed during a sign-in, with the sign-in page's URL and a device code when it has them.

type SignInStatus added in v0.3.1

type SignInStatus struct {
	Provider, Tool, Install string
	ToolFound, SignedIn     bool
	Detail                  string
}

SignInStatus is a provider's sign-in: its vendor's tool (whether it's installed, and where to get it), and whether its credentials work now, with what they are.

type Workers

type Workers struct {
	// contains filtered or unexported fields
}

Workers are one workspace's workers in the service.

func AttachWorkers

func AttachWorkers(sock, dir string) *Workers

AttachWorkers reaches the workers of the workspace dir (absolute) in the service listening on sock.

func AttachWorkersHTTP

func AttachWorkersHTTP(hc connect.HTTPClient, baseURL, dir string) *Workers

AttachWorkersHTTP is AttachWorkers over any HTTP client.

func (*Workers) DeleteWorker added in v1.3.0

func (w *Workers) DeleteWorker(name string) error

DeleteWorker removes the named worker: its folder and whether it's on; one running is refused (WorkerService.DeleteWorker).

func (*Workers) DisableWorker

func (w *Workers) DisableWorker(name string) (api.WorkerInfo, error)

DisableWorker stops the named worker's schedule (WorkerService.DisableWorker).

func (*Workers) EnableWorker

func (w *Workers) EnableWorker(name, hash string) (api.WorkerInfo, error)

EnableWorker enables the named worker as shown: hash is its content's, so an edit since it was shown is refused (WorkerService.EnableWorker).

func (*Workers) ListWorkers

func (w *Workers) ListWorkers() ([]api.WorkerInfo, error)

ListWorkers lists the workspace's workers with their state and schedule (WorkerService.ListWorkers).

func (*Workers) MoveToService added in v0.9.0

func (w *Workers) MoveToService(ctx context.Context, name string, force bool) (problems []string, moved bool, err error)

MoveToService moves a job to the organization's service (WorkerService.MoveWorkerToService): what keeps it from running there, and whether it moved (only with none, or force).

func (*Workers) RunWorker

func (w *Workers) RunWorker(ctx context.Context, name string, on func(api.Event)) (api.Run, error)

RunWorker runs the worker now in the service, passes its events to on while it runs, and returns its record when it finishes.

func (*Workers) RunningWorkerRuns added in v0.6.4

func (w *Workers) RunningWorkerRuns() ([]api.Run, error)

RunningWorkerRuns returns the runs going now in this workspace, oldest first (WorkerService.ListRunningWorkerRuns).

func (*Workers) StopWorkerRun added in v0.6.4

func (w *Workers) StopWorkerRun(runID string) error

StopWorkerRun stops a run going now (WorkerService.StopWorkerRun).

func (*Workers) UndoWorkerRun

func (w *Workers) UndoWorkerRun(runID string, force bool) ([]string, error)

UndoWorkerRun restores the files a run changed (WorkerService.UndoWorkerRun).

func (*Workers) WorkerRuns

func (w *Workers) WorkerRuns(name string, limit int) ([]api.Run, error)

WorkerRuns lists the named worker's latest runs, at most limit, newest first (WorkerService.ListWorkerRuns).

Jump to

Keyboard shortcuts

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