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 ¶
- Variables
- func Release(ctx context.Context, sock, dir string) error
- type Background
- func (b *Background) Find(ctx context.Context, id string) (api.BackgroundRun, error)
- func (b *Background) List(ctx context.Context) ([]api.BackgroundRun, error)
- func (b *Background) Logs(ctx context.Context, id string, follow bool, on func(api.Event)) (api.TurnResult, bool, error)
- func (b *Background) Stop(ctx context.Context, id string) (api.BackgroundRun, error)
- type ListedModel
- type ProviderModels
- type Remote
- func (r *Remote) ActiveAgent() api.AgentInfo
- func (r *Remote) ActiveAgentTools() api.AgentTools
- func (r *Remote) ActiveSession() (api.SessionInfo, bool)
- func (r *Remote) AddImage(name string, data []byte) (*images.Image, error)
- func (r *Remote) AddMemory(ctx context.Context, text string) (string, error)
- func (r *Remote) AddPermissionRule(effect, rule string, save api.Scope) (api.PermissionChange, error)
- func (r *Remote) AllModelSettings() map[string]config.ModelSettings
- func (r *Remote) AnswerTaskRequest(id string, decision api.Decision, answer string) error
- func (r *Remote) AuditShell(command string, exitCode int, startErr error)
- func (r *Remote) AvailableLocales() ([]api.LocaleInfo, string)
- func (r *Remote) ClearApprovals() (int, error)
- func (r *Remote) ClearGoal() error
- func (r *Remote) Close() error
- func (r *Remote) Compact(ctx context.Context, focus string) (api.CompactResult, error)
- func (r *Remote) Context(parts bool) (api.ContextInfo, error)
- func (r *Remote) Dir() string
- func (r *Remote) ExportSession(id string) (string, error)
- func (r *Remote) FollowBackground(ctx context.Context, id string, on func(api.Event)) (api.TurnResult, error)
- func (r *Remote) ForgetNote(name string) error
- func (r *Remote) ForgetProjectTrust() error
- func (r *Remote) ForkSession(ctx context.Context, turn int) (api.SessionInfo, error)
- func (r *Remote) GitDiff(ctx context.Context, color bool) (string, error)
- func (r *Remote) GitStatus(ctx context.Context) (api.GitStatus, error)
- func (r *Remote) Goal() (api.Goal, error)
- func (r *Remote) ImagesEnabled() bool
- func (r *Remote) ListAgents() []api.AgentInfo
- func (r *Remote) ListApprovals() []api.Approval
- func (r *Remote) ListCheckpoints() []api.Checkpoint
- func (r *Remote) ListCommands() []api.CommandInfo
- func (r *Remote) ListEnvs() ([]api.Env, error)
- func (r *Remote) ListHooks() []api.HookInfo
- func (r *Remote) ListMCPServers() []api.MCPServer
- func (r *Remote) ListNotes() ([]api.Note, error)
- func (r *Remote) ListPermissionRules() []api.PermissionRule
- func (r *Remote) ListSessions(all bool) ([]api.SessionInfo, error)
- func (r *Remote) ListSkills() []api.SkillInfo
- func (r *Remote) ListStyles() []api.StyleInfo
- func (r *Remote) ListTasks() []api.TaskInfo
- func (r *Remote) LoadAttachments(paths []string, prompt string, warn func(string)) ([]*images.Image, error)
- func (r *Remote) LoadImage(path string) (*images.Image, error)
- func (r *Remote) LoadSession(ref string) (api.SessionInfo, bool, error)
- func (r *Remote) MemoryFiles() []string
- func (r *Remote) Model() api.ModelInfo
- func (r *Remote) ModelErr() error
- func (r *Remote) ModelSettings(ref string) (api.ModelSettingsInfo, error)
- func (r *Remote) MoveSession(id string) (api.SessionInfo, error)
- func (r *Remote) NewSession() (api.SessionInfo, error)
- func (r *Remote) OpenSession(resume string, cont bool) (api.SessionInfo, bool, error)
- func (r *Remote) PendingTaskRequests() []api.TaskRequest
- func (r *Remote) PinModel(ctx context.Context, agent, ref string) (api.PinResult, error)
- func (r *Remote) ProcessOutputIn(workspace string, id int) (string, api.ProcessInfo, error)
- func (r *Remote) Processes() api.Processes
- func (r *Remote) ProjectSettings() api.ProjectSettings
- func (r *Remote) PruneEnvs() (api.PruneResult, error)
- func (r *Remote) Reflection() (api.Reflection, error)
- func (r *Remote) Reindex() error
- func (r *Remote) Reload(ctx context.Context) (api.ReloadResult, error)
- func (r *Remote) ReloadMemory(ctx context.Context) ([]string, error)
- func (r *Remote) RemoveEnv(key string) error
- func (r *Remote) RemovePermissionRule(rule string, save api.Scope) (api.PermissionChange, error)
- func (r *Remote) RenameSession(title string) (api.SessionInfo, error)
- func (r *Remote) RevokeApprovals(keys ...string) (int, error)
- func (r *Remote) Rewind(ctx context.Context, index int, mode api.RewindMode, force bool) (api.RewindResult, error)
- func (r *Remote) RewindPoints() ([]api.RewindPoint, error)
- func (r *Remote) Run(ctx context.Context, sessionID string, t api.Turn, on func(api.Event)) (api.TurnResult, error)
- func (r *Remote) RunEval(ctx context.Context, name string, o api.EvalOptions) (api.EvalRun, error)
- func (r *Remote) RunningProcesses(everywhere bool) ([]api.WorkspaceProcess, error)
- func (r *Remote) SandboxSummary() []string
- func (r *Remote) SaveSnapshot(name string, force bool) (api.SessionInfo, error)
- func (r *Remote) Search(ctx context.Context, q api.SearchQuery) (api.SearchResult, error)
- func (r *Remote) SearchProvider() (string, error)
- func (r *Remote) SearchSession(terms string) (int, string)
- func (r *Remote) SearchSkills(query string) []api.SkillInfo
- func (r *Remote) SearchStatus() api.SearchStatus
- func (r *Remote) SearchWeb(ctx context.Context, terms string) (api.WebSearch, error)
- func (r *Remote) SessionDiff() string
- func (r *Remote) SessionUsage() (api.Usage, error)
- func (r *Remote) Set(ctx context.Context, key, value string) (string, error)
- func (r *Remote) SetAgent(ctx context.Context, name string) (api.AgentInfo, error)
- func (r *Remote) SetGoal(condition string) (api.Goal, error)
- func (r *Remote) SetLocale(ctx context.Context, input string) (api.LocaleChange, error)
- func (r *Remote) SetModel(ctx context.Context, ref string) (string, error)
- func (r *Remote) SetPermissionMode(mode string) (string, error)
- func (r *Remote) SetUI(approve api.Approver, ask api.UserPromptFunc)
- func (r *Remote) Settings() api.Settings
- func (r *Remote) Skill(name string) (api.SkillInfo, bool)
- func (r *Remote) StartBackground(ctx context.Context, t api.Turn) (api.BackgroundRun, error)
- func (r *Remote) Steer(ctx context.Context, sessionID, text string) error
- func (r *Remote) StopProcessIn(workspace string, id int) (api.ProcessInfo, error)
- func (r *Remote) StopTask(id string) (api.TaskInfo, error)
- func (r *Remote) TakeProcessNotices(session string) []string
- func (r *Remote) Task(id string) (api.TaskInfo, []string, error)
- func (r *Remote) TrustProject(hash string, trusted bool) error
- func (r *Remote) Undo(force bool) (api.UndoResult, error)
- func (r *Remote) Unpin(ctx context.Context, agent string) (api.PinResult, error)
- func (r *Remote) UpdateModelSettings(ref string, reset bool, changes []api.Setting) (api.ModelSettingsChange, error)
- type RuleCheck
- type Settings
- func (s *Settings) CheckPermission(ctx context.Context, effect, rule, sample string) (RuleCheck, error)
- func (s *Settings) ListModels(ctx context.Context, dir string, providers ...string) ([]ProviderModels, error)
- func (s *Settings) SignIn(ctx context.Context, dir, provider, profile string, on func(SignInEvent)) (SignInStatus, error)
- func (s *Settings) SignIns(ctx context.Context, dir, provider, profile string) ([]SignInStatus, error)
- func (s *Settings) SignOut(ctx context.Context, dir, provider, profile string) (SignInStatus, error)
- type SignInEvent
- type SignInStatus
- type Workers
- func (w *Workers) DisableWorker(name string) (api.WorkerInfo, error)
- func (w *Workers) EnableWorker(name, hash string) (api.WorkerInfo, error)
- func (w *Workers) ListWorkers() ([]api.WorkerInfo, error)
- func (w *Workers) RunWorker(ctx context.Context, name string, on func(api.Event)) (api.Run, error)
- func (w *Workers) RunningWorkerRuns() ([]api.Run, error)
- func (w *Workers) StopWorkerRun(runID string) error
- func (w *Workers) UndoWorkerRun(runID string, force bool) ([]string, error)
- func (w *Workers) WorkerRuns(name string, limit int) ([]api.Run, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ListedModel ¶ added in v0.3.1
ListedModel is a model with the price Blitz knows for it, in dollars per million tokens (HasPrice false when it knows none).
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 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 ¶
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 ¶
AddImage prepares an image from its bytes (a paste) for a prompt (WorkspaceService.AddImage).
func (*Remote) AddMemory ¶
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 ¶
AnswerTaskRequest answers one of them (SessionService.Answer for a question, when answer is set; else Approve).
func (*Remote) AuditShell ¶
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 ¶
ClearApprovals revokes every standing approval and returns how many went, and which stay saved (WorkspaceService.RevokeApprovals).
func (*Remote) Compact ¶
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) ExportSession ¶
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 ¶
ForgetNote deletes one (WorkspaceService.ForgetNote).
func (*Remote) ForgetProjectTrust ¶ added in v0.3.1
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 ¶
ForkSession starts a copy of the active session (SessionService.ForkSession).
func (*Remote) GitDiff ¶
GitDiff is `git diff` of the workspace, with color if asked (WorkspaceService.GetDiff).
func (*Remote) GitStatus ¶
GitStatus is the workspace's git branch and how many files differ from HEAD (WorkspaceService.GetGitStatus).
func (*Remote) ImagesEnabled ¶
ImagesEnabled reports whether the workspace accepts images (its images settings, from GetSettings).
func (*Remote) ListAgents ¶
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 ¶
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 ¶
ListEnvs lists the Python environments skills' scripts use (WorkspaceService.ListEnvs).
func (*Remote) ListHooks ¶
ListHooks are the workspace's hooks in the service (WorkspaceService.ListHooks); on failure warn is told and there are none.
func (*Remote) ListMCPServers ¶
ListMCPServers lists the configured MCP servers and their state (WorkspaceService.ListMCPServers) (on failure, warn is told and it returns nothing).
func (*Remote) ListNotes ¶
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) 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 ¶
ListSkills lists the skills the workspace offers (WorkspaceService.ListSkills).
func (*Remote) ListStyles ¶
ListStyles are the output styles (WorkspaceService.ListStyles); on failure warn is told and there are none.
func (*Remote) ListTasks ¶
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 ¶
LoadImage prepares the image at path (in the workspace) for a prompt (WorkspaceService.LoadImage).
func (*Remote) LoadSession ¶
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) MemoryFiles ¶
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 ¶
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 ¶
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 ¶
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) PinModel ¶
PinModel runs agent on the model ref from now on, and saves the pin in the configuration (WorkspaceService.PinModel).
func (*Remote) ProcessOutputIn ¶ added in v0.8.5
ProcessOutputIn is background process id's captured output in workspace, whichever session started it.
func (*Remote) 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.
func (*Remote) PruneEnvs ¶
func (r *Remote) PruneEnvs() (api.PruneResult, error)
PruneEnvs deletes the skill environments no skill needs any more (WorkspaceService.PruneEnvs).
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
Reindex starts a scan for search (WorkspaceService.Reindex).
func (*Remote) Reload ¶ added in v0.6.5
Reload reads the agents, skills, instruction files and rules again (WorkspaceService.ReloadAgentFiles).
func (*Remote) ReloadMemory ¶
ReloadMemory reads the project memory files again and lists them (WorkspaceService.ReloadMemory).
func (*Remote) RemoveEnv ¶
RemoveEnv deletes one skill environment by key (WorkspaceService.RemoveEnv).
func (*Remote) RemovePermissionRule ¶
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) RevokeApprovals ¶
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) RunEval ¶ added in v0.7.1
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) 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_processes_052): this workspace's, or every open workspace's when everywhere.
func (*Remote) SandboxSummary ¶
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) SaveSnapshot ¶
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 ¶
SearchProvider names the web search provider the workspace uses (WorkspaceService.GetSearchProvider).
func (*Remote) SearchSession ¶
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 ¶
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 ¶
SearchWeb searches the web for terms and returns the links and the prompt that hands them to the agent (WorkspaceService.SearchWeb).
func (*Remote) SessionDiff ¶
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) SessionUsage ¶
SessionUsage is the active session's token use and cost (SessionService.GetUsage).
func (*Remote) Set ¶
Set changes one run setting (such as effort or agency) and returns its key as applied (WorkspaceService.SetSetting).
func (*Remote) SetAgent ¶
SetAgent switches the workspace to the named agent (WorkspaceService.SetAgent).
func (*Remote) SetLocale ¶
SetLocale sets the language the model replies in from input (a tag or a name) (WorkspaceService.SetLocale).
func (*Remote) SetModel ¶
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 ¶
SetPermissionMode sets the permission mode (default, accept-edits, plan, dont-ask or bypass) and returns it (WorkspaceService.SetPermissionMode).
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 ¶
Settings returns the workspace's run settings: agent, model, mode, effort, agency, language (WorkspaceService.GetSettings).
func (*Remote) Skill ¶
Skill returns the named skill, and whether it exists (WorkspaceService.GetSkill).
func (*Remote) StartBackground ¶
StartBackground starts t in a new session of the workspace, run by the service with no client attached (SessionService.StartBackground).
func (*Remote) Steer ¶
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
StopProcessIn stops background process id in workspace, whichever session started it: the user's own stop.
func (*Remote) TakeProcessNotices ¶
TakeProcessNotices are what the session's watched processes reported while it was idle (WorkspaceService.TakeProcessNotices).
func (*Remote) Task ¶
Task is one of this client's tasks with its latest events (WorkspaceService.GetTask).
func (*Remote) TrustProject ¶
TrustProject records the decision in the service, which reopens the workspace with it unless a turn is running there (WorkspaceService.TrustProject).
func (*Remote) Undo ¶
func (r *Remote) Undo(force bool) (api.UndoResult, error)
Undo restores the files the last turn changed; force overwrites files changed since (WorkspaceService.Undo).
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).
type RuleCheck ¶ added in v0.3.1
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 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 models the providers offer, and checking a permission rule.
func AttachSettings ¶ added in v0.3.1
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) 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) 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) 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) 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).
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
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 ¶
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) 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) RunWorker ¶
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
RunningWorkerRuns returns the runs going now in this workspace, oldest first (WorkerService.ListRunningWorkerRuns).
func (*Workers) StopWorkerRun ¶ added in v0.6.4
StopWorkerRun stops a run going now (WorkerService.StopWorkerRun).
func (*Workers) UndoWorkerRun ¶
UndoWorkerRun restores the files a run changed (WorkerService.UndoWorkerRun).