workspace

package
v0.3.28 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 28 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 workspace holds the mutable state of the application: the projects that are open, the tabs in each, the pane tree in each tab, and the live sessions behind those panes.

It deliberately knows nothing about rendering or key bindings, so the layout and session lifecycle can be exercised without a user interface.

A tab belongs to a project and so does a pane, and the two need not agree: a tab can show agents from more than one project side by side. The tab's project decides which tab bar draws it. The pane's project decides what the agent is told it is working in, whose summary counts it as waiting, and what stops it when a project closes — so anything grouping panes by project asks rootOf, never the tab the pane happens to sit on.

Index

Constants

View Source
const MaxTasks = maxTasks

MaxTasks is maxTasks for callers that start the agents themselves, so the limit is one number rather than one per fan-out path.

Variables

This section is empty.

Functions

func BranchNameFor

func BranchNameFor(task string) string

BranchNameFor derives a git branch name from a task description.

Letters are letters in every script. Keeping only a-z threw away every character of a task written in Cyrillic, Greek, Japanese or anything else, which left nothing at all — so each of those tasks came out as the fallback name, and a whole fan-out landed on agent/task, agent/task-2, agent/task-3, naming nothing. git takes UTF-8 in a ref, and the worktree directory derived from it keeps the same characters already.

func ExtractTasks

func ExtractTasks(text string) []string

ExtractTasks finds the work items in a plan.

A lead agent asked for a plan answers with a list, so list markers are the signal: bullets, numbers and checkboxes. Everything else is prose. The result is a suggestion the user edits before anything is started, so it is better to offer a few plausible lines than to guess cleverly.

text is read as a pane's screen, which is the harder of the two things a plan is read from; see extractTasks.

func ReapStaleWorktreeProcesses added in v0.3.26

func ReapStaleWorktreeProcesses() int

ReapStaleWorktreeProcesses ends every process a past run of Flockdeck put to work in a git worktree and never got the chance to close itself, and reports how many it found still running.

It is the backstop for the whole class of bug a leak like that is, rather than a fix for any one way it can happen: containTree's job object now sets JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, so Windows itself takes a pane's tree down within a moment of Flockdeck's own process disappearing, however that happens, and endTree falls back to walking the machine's process table itself when the job could never be made in the first place. What this still catches is whatever slips past both of those -- a version of Flockdeck built before either existed, security software that blocks a job object outright, a bug in either path this cannot yet know the shape of -- found and ended by what it was put to work in, read back from the one run that recorded it. Called once, at the start of every run, before anything looks at what is open; see New.

Nothing here asks git whether a record's path is still a worktree before ending the process in it: recordWorktreeProcess already only ever wrote one for a pane working outside its own project, and the very failure this exists for -- a process still holding a worktree's folder open -- is often exactly what has made git stop being able to answer for that folder at all (see gitx.Remove). Once a process is ended, though, whether its folder can safely be removed too is asked of git: a worktree git still has a record of is left alone, since clearing it out from under a checkout still registered is the worktree panel's own job, not this sweep's to do on its way past.

The whole sweep is skipped while another instance of Flockdeck is already running. `-solo` starts a second instance deliberately, beside one that answers, and the two keep their own panes independently -- the registry they record into is shared, since there is only ever one state directory per user, but a record in it that names a process still running is not necessarily this launch's leftover; it may be that other instance's own pane, going about its work. Only once nothing is recorded as running, or what is recorded has itself gone, can a record here be trusted to be what it looks like: something nobody is left to answer for.

Types

type Choice

type Choice struct {
	Kind  session.Kind
	Agent string
	Model string
}

Choice is what a new pane should run: a shell, or an agent and one of its models. An empty Agent means the default one, and an empty Model whatever that agent is already set to, so a caller with nothing to say passes the kind alone and gets exactly what one keystroke has always given.

type Options

type Options struct {
	// Root is the project to open first.
	Root string
	// OnWake is called whenever any session changes and the interface should
	// refresh. It may be called from any goroutine.
	OnWake func()
	// HookBinary overrides the executable agent panes invoke to report their
	// lifecycle. It defaults to this process, and exists so tests and the
	// development harness can point at a built binary.
	HookBinary string
}

Options configures a new workspace.

type Pane

type Pane struct {
	ID   string
	Kind session.Kind
	Cwd  string
	Name string
	// Agent is the id of the agent this pane runs, and Model the model it was
	// asked for. Both are empty on a shell pane. A new agent pane records what
	// its choice resolved to, so a restart and a saved layout come back as the
	// same agent; an empty Agent, which only a layout written before panes
	// could choose holds, means the catalog's default. An empty Model means
	// whatever the agent is already set to, which is not the same as naming
	// its default model.
	Agent string
	Model string
	// Routed names the routing rule that chose Model, and RoutedFrom the
	// model the pane would otherwise have run. Both are empty for a model
	// chosen by hand or by default. RoutedFromAgent names the agent
	// RoutedFrom belongs to, and is set only when routing moved the pane to
	// another agent, not only another model.
	Routed          string
	RoutedFrom      string
	RoutedFromAgent string
	// Root is the open project this pane belongs to. It is usually the project
	// of the tab the pane sits on, but need not be: a tab can show agents from
	// more than one project side by side, and this is what says which one an
	// agent is working in. Cwd may be deeper still, since a pane can be put
	// into a worktree inside its project.
	Root string
	// Branch is the git branch checked out in Cwd, shown in the pane header so
	// agents running in parallel worktrees can be told apart at a glance.
	Branch string
	// Git is a periodically refreshed summary of the checkout the pane works
	// in: whether it has uncommitted work and how it stands against upstream.
	Git gitx.Status
	// GitTimedOut is set while the last refresh of the checkout gave up before
	// git answered. Git then still holds what was read before, which is kept
	// for when git answers again but must not be shown as though it were
	// current: nothing says it still is.
	GitTimedOut bool

	// Cols and Rows are the terminal size the viewer last measured for this
	// pane. They are remembered so a restart comes back at the size the pane
	// is really being drawn at, instead of reflowing at the default until the
	// window happens to be resized again.
	Cols int
	Rows int

	Sess *session.Session
	// Err records why a pane failed to start, so the UI can show it in place
	// rather than the app dying at launch.
	Err error

	// Task is what the pane was spawned to do, kept after the opening prompt
	// has been spent so the agent can still be told why it exists — after a
	// restart, or after its context has been compacted away.
	Task string
	// Conversation is the agent's own id for the conversation the pane is in,
	// once that is no longer the pane's id; empty means the pane's id. It is
	// set from the hook goroutine, so it is only touched under the lock — read
	// it through conversationOf.
	Conversation string

	// Parent is the pane whose agent started this one with its own `flockdeck
	// spawn`, so this pane is that agent's helper rather than the user's own.
	// Empty for a pane the user started themselves -- opened by hand, or by a
	// fan-out run from the window. It is never cleared once set, even once
	// that pane closes; a reader wanting to know whether the parent is still
	// open checks separately, as internal/server's agents.go does.
	//
	// It is persisted with the layout, so a restored helper still knows whose
	// it is; see encodeNode and decodeNode.
	Parent string
	// Muted is set from a phone that would rather not be pushed to about this
	// pane's waits while it is chatty, though it still shows waiting
	// everywhere else -- the desk's markers, the phone's list, and the desk's
	// own notification. See SetPaneMuted and push.go's pushDue, which is the
	// only thing that reads it.
	//
	// It is not persisted, so it does not survive a restart of Flockdeck, and
	// there is nowhere it needs clearing when the pane closes: the Pane it
	// lives on is simply gone.
	Muted bool
	// AutoReview opts this pane into auto-review approvals: a PreToolUse call
	// is put to reviewTool before Claude Code would otherwise show its own
	// permission prompt, and one the reviewer is confident is safe is let
	// through without ever reaching that prompt or turning the pane amber.
	// See SetPaneAutoReview.
	//
	// It answers only what is already going to be asked about -- Claude
	// Code's own permission settings are never touched, and nothing here can
	// ever say "deny" -- so turning it off simply goes back to asking about
	// everything, exactly as every pane without it does today.
	//
	// It defaults to off, like every pane's, but a pane a fan-out or `flockdeck
	// spawn` starts is the exception: it is given its parent's AutoReview, on
	// or off, so a dozen children of a pane a person already trusted do not
	// each have to be found and switched on by hand. See Spawn.
	//
	// Like Muted it is not persisted: a restart starts over asking about
	// everything until the user turns it back on.
	AutoReview bool
	// AutoApproved counts the calls auto-review has let through for this pane
	// without a prompt, so a person who turned it on has something to see for
	// it. It is not persisted either.
	AutoApproved int
	// contains filtered or unexported fields
}

Pane couples a live session with the configuration needed to restart it.

func (*Pane) Alive

func (p *Pane) Alive() bool

Alive reports whether the pane has a running process.

func (*Pane) IsAgent

func (p *Pane) IsAgent() bool

IsAgent reports whether the pane runs an agent rather than a plain shell.

A pane is one or the other, so this is written as "not a shell": which agent it runs is the Spec's business, and everything the workspace does with the distinction — resuming on restart, renaming a tab after the first prompt, counting a project as waiting — is true of every agent and of none of them.

func (*Pane) Status

func (p *Pane) Status() (session.Status, string)

Status returns the pane's status and detail, accounting for panes that never started.

type PaneContext

type PaneContext struct {
	PaneID   string
	PaneName string
	Shell    bool

	Tab      string
	TabPanes int

	ProjectRoot string
	ProjectName string
	// RepoName is this pane's own repo, as it reads inside its project's
	// member list -- see Workspace.repoLabel. It differs from ProjectName
	// only when the project spans more than one repo, which is when it is
	// worth saying at all; see render.
	RepoName string
	Cwd      string
	Branch   string
	// Worktree reports that the pane works in a checkout of its own — a
	// directory outside the project altogether, which is what fan-out gives
	// each child, since Flockdeck puts a worktree beside the repository it came
	// from rather than inside it.
	Worktree bool
	// Subdirectory reports a working directory below the project root: the
	// same checkout, a directory or two down. It is not a worktree, and an
	// agent told that it is one is told to keep out of the rest of its own
	// repository.
	Subdirectory bool

	// Task is the opening prompt the pane was spawned with, when it was
	// started by a fan-out or by another agent rather than by hand. Which of
	// the two it was is not recorded, so the pane is not told either.
	Task string

	Siblings []Sibling
	// SiblingsOmitted counts the live panes left out of Siblings once the list
	// hit its limit, so the agent is told the list is partial rather than
	// assuming it has seen everyone.
	SiblingsOmitted int

	OtherProjects []string

	// Taken is when the snapshot was made. It is written out only for an agent
	// briefed through its opening prompt, because that briefing arrives once
	// and is never replaced: everything below it is true of the moment the
	// pane started and of no moment after, and an agent that is not told so
	// will read a list of other agents that has since changed as current.
	Taken time.Time

	// CanSpawn reports whether spawning helpers will work from this pane.
	CanSpawn bool
	// SpawnCommand is how Flockdeck itself is run from inside the pane: the name
	// on PATH where there is one, and the binary's own path where there is not.
	SpawnCommand string
}

PaneContext is everything an agent is told about the situation it is running in: which pane it is, which checkout it has, and who else is working.

It is a snapshot taken on the workspace's own goroutine and rendered elsewhere, so it holds values rather than pointers into live state.

func (PaneContext) OpeningPrompt

func (c PaneContext) OpeningPrompt() string

OpeningPrompt is what an agent with no hooks to answer is started with: the same briefing, fenced, and then the task.

The fence is there so the two can be told apart. Everything inside it is Flockdeck describing the pane; everything after it is what the user asked for, and an agent that reads the first as part of the second sets about documenting the window instead of doing the work. A pane started with no task gets the block on its own, which is still worth sending: knowing which checkout it has and who else is in the repository changes what the agent does with the first thing the user types.

func (PaneContext) Render

func (c PaneContext) Render() string

Render writes the context as the text handed to an agent at session start, in answer to its own lifecycle hook.

It is prose rather than JSON because it is read by the model, and it is deliberately specific about the two things an agent cannot work out for itself: that its conversation is private to one pane among several, and that the other panes may be editing other checkouts of the same repository.

type PlanSource

type PlanSource struct {
	// SessionID names the pane's transcript, when its agent keeps one, and
	// Spec is that agent, which is what knows where the transcript is.
	SessionID string
	Spec      agent.Spec
	// Screen is the pane's recent terminal output. It is the fallback: a shell
	// pane has no transcript, and neither has an agent that has not yet spoken.
	Screen string
}

PlanSource is where a fan-out looks for the work it should propose.

func (PlanSource) Tasks

func (s PlanSource) Tasks() ([]string, bool)

Tasks proposes the work items in the plan, and reports whether they came from the agent's own words rather than from the screen.

It reads from disk, so call it away from the goroutine that owns the workspace. The most recent reply that yields any work wins: an agent that has laid out a plan and then answered a follow-up should not lose the plan.

type Project

type Project struct {
	Root string
	// Name is what the switcher and picker call this project: the display
	// name chosen by hand for it (see ReloadProjectMeta), or, absent one,
	// the name derived from its directory the way it always was.
	Name    string
	Active  bool
	Tabs    int
	Waiting int
	Working int
	// Panes counts every pane in the project's tabs, idle ones included, so
	// that a split or a closed pane changes the summary as it changes the
	// agents list.
	Panes int
	// Members lists every repo in this project, root and display label --
	// see ProjectGroup. A project nobody has grouped still carries one
	// entry, itself, so the switcher's expandable member list has one thing
	// to expand into rather than a special case for a project of one.
	Members []RepoSummary
	// Archived says this project is kept out of the picker's ordinary
	// lists (see SetProjectArchived); an open project may still be, since
	// archiving one does not close it.
	Archived bool
	// contains filtered or unexported fields
}

Project is an open project and a summary of what is happening inside it.

type ProjectGroup added in v0.3.26

type ProjectGroup struct {
	ID string
	// Name is user-editable; empty means the switcher derives one the way
	// it derives every ungrouped project's name, via projectNames -- see
	// groupDisplayNames.
	Name string
	// Roots are the member repos, in the order they were added.
	Roots []string
	// Primary is which member is "home": the default cwd for a new tab, the
	// default worktree-suggestion base, and the tie-breaker for naming.
	Primary string
}

ProjectGroup is a named collection of one or more repo roots that the switcher, the command palette and an agent's own briefing treat as a single project. Every open root belongs to exactly one group; a project nobody has grouped is a group of one, created automatically the moment its root is opened (see ensureGroup) -- which is what makes this additive: a user who never groups anything sees the same switcher, the same names and the same behaviour this always had.

A repo root stays the unit git operations, the default working directory and per-directory saved layouts key off -- none of that changes. A ProjectGroup is Flockdeck-side metadata layered above it, and could be deleted with no effect on any of the repos it names. See store.ProjectGroup, which this is persisted as.

type RepoSummary added in v0.3.26

type RepoSummary struct {
	Root string
	Name string
}

RepoSummary is one repo inside a Project, as the switcher's expandable member list shows it.

type Sibling

type Sibling struct {
	Name   string
	Tab    string
	Cwd    string
	Branch string
	Status string
	Shell  bool
	Task   string
	// Agent and Model are what the pane is running: the agent's id and the
	// model it was asked for, as the pane header shows them. Which agent is in
	// the next pane changes what is worth asking of it — a plan is worth
	// handing to one, a mechanical edit to another — and neither is anything
	// the reader can work out from a directory and a branch.
	Agent string
	Model string
	// SameCheckout marks a pane working in the reader's own directory. It is
	// the one fact in the list that changes what the agent should do, and it
	// is easy to miss when it has to be read off two long paths.
	SameCheckout bool
	// Repo names the repo this sibling works in, filled in only when the
	// reader's own project spans more than one and this sibling's differs
	// from the reader's own -- see PaneContext.RepoName. A sibling in the
	// reader's own repo, which is every sibling before projects could span
	// more than one, leaves this empty and describe() reads exactly as it
	// always has.
	Repo string
}

Sibling is another pane, as described to an agent.

type SpawnOptions

type SpawnOptions struct {
	// Task is given to the agent as its opening prompt.
	Task string
	// Cwd is where it works. Empty means the parent's directory.
	Cwd string
	// Branch, when set, puts the child in its own git worktree on that branch
	// so parallel children cannot collide over one checkout.
	Branch string
	// Split places the child beside its parent instead of in a new tab.
	Split bool
	// Tab names an existing tab for the child to join, where it is arranged
	// into a grid with the panes already there. It is how a fan-out gathers a
	// dozen children into one tab rather than scattering them a tab each, and
	// it takes precedence over Split. A tab that has since been closed is
	// ignored, and the child is placed as it would have been without it.
	Tab   string
	Kind  session.Kind
	Title string
	// Agent names the agent.Spec the pane runs, and Model the model that agent
	// is asked for. Empty means the default, which is how a fan-out started
	// without a thought about either keeps running what Flockdeck already ran. An
	// empty model is not "no model": it leaves the choice to the agent, so a
	// CLI keeps whatever it was configured with.
	Agent string
	Model string
	// Routed names the routing rule that chose Model, and RoutedFrom the
	// model the child would otherwise have run. They are recorded on the pane
	// so its header says the model was routed, and why. RoutedFromAgent names
	// the agent RoutedFrom belongs to, set only when routing moved the child
	// to another agent, not only another model.
	Routed          string
	RoutedFrom      string
	RoutedFromAgent string
	// SpawnedByAgent marks a child started by its parent's own `flockdeck
	// spawn`, so the pane records the parent as its Pane.Parent -- as opposed
	// to a fan-out the user ran themselves from the window, whose children are
	// the user's own and carry no parent. Only installSpawnHandler sets it.
	SpawnedByAgent bool
}

SpawnOptions describes a child agent to start.

type Tab

type Tab struct {
	ID    string
	Root  string // the project this tab belongs to
	Title string
	Tree  *layout.Node
	Focus string
	// Zoom temporarily gives the focused pane the whole window.
	Zoom bool
	// Delegated is set on a tab Spawn has placed a fan-out's own child into
	// -- gathering several into one together, or giving a lone helper a new
	// tab of its own -- and never on one an ordinary split put a pane into.
	// It is not persisted: a restart resumes agents into tabs nothing has
	// just delegated work into, and starts each over the ordinary way.
	//
	// This is the one reliable way to tell "two or more idle agent panes
	// sharing a tab" apart from "an ordinary tab of several agents a person
	// split together by hand, which simply happen to have gone idle at the
	// same time" -- the window's own settled-tab-collapses-to-a-summary-card
	// behaviour (see webui's tabSettleInfo) must never guess at fan-out from
	// pane count alone, since a person is free to build exactly the same
	// shape by hand.
	Delegated bool
	// AutoTitle is set while the title is still the directory name the tab was
	// given automatically, so the first prompt may replace it. Renaming a tab
	// by hand clears it and the title is then left alone.
	AutoTitle bool
	// Named is set while the tab carries a name chosen by hand. The title it
	// would otherwise have goes on being kept behind that name, in auto and
	// autoOpen, so that giving the name up puts back what the tab would be
	// called had it never been renamed: renaming used to clear AutoTitle for
	// good, and a tab named once could never go back.
	Named bool
	// contains filtered or unexported fields
}

Tab is one tab: a pane tree, which pane has focus, and the project it belongs to.

type Workspace

type Workspace struct {
	// Tabs holds every tab across every open project, in creation order.
	Tabs []*Tab

	// Broadcast, when enabled, sends what is written in the prompt bar to every
	// pane in the broadcast set as well as the focused one; with it off the
	// prompt bar reaches the focused pane and any panes picked by hand, which
	// stay picked. Typing into a pane's own terminal is never copied anywhere.
	Broadcast    bool
	BroadcastSet map[string]bool
	// contains filtered or unexported fields
}

Workspace is the whole application state.

func New

func New(opts Options) (*Workspace, error)

New creates a workspace, starting the hook server that panes report to.

func (*Workspace) ActiveRoot

func (w *Workspace) ActiveRoot() string

ActiveRoot returns the project currently being shown.

func (*Workspace) ActiveTabID

func (w *Workspace) ActiveTabID() string

ActiveTabID returns the id of the focused tab.

func (*Workspace) AddRepoToGroup added in v0.3.26

func (w *Workspace) AddRepoToGroup(projectRoot, path string) error

AddRepoToGroup opens path as another repo inside the project named by projectRoot -- any of its member roots names it -- rather than as a project of its own. The same OpenProject machinery runs underneath: the same directory validation, the same restoreProject/first-tab logic -- only the newly opened root joins projectRoot's group instead of getting a singleton one. This is "Add Repo to This Project…" in the command palette.

func (*Workspace) AgentSpec

func (w *Workspace) AgentSpec(id string) (agent.Spec, error)

AgentSpec resolves the agent a pane was asked to run, and says why it cannot be run when it cannot. An empty id means the default agent of the project on screen, which is a field only the goroutine that owns the workspace may read; AgentSpecByID asks the same about an agent named by id, from anywhere.

The question asked here is about one spec rather than about Claude. A fan-out may now give four of its tasks to one agent and eight to another, and the half whose agent is installed should start whatever is true of the other half -- which it cannot while the only question Flockdeck knows how to ask is whether Claude Code is on this machine.

func (*Workspace) AgentSpecByID added in v0.3.3

func (w *Workspace) AgentSpecByID(id string) (agent.Spec, error)

AgentSpecByID is AgentSpec for an agent named by its id, and is safe to call from any goroutine. It reads the catalog, which has a lock of its own, and the claude CLI found when the workspace was made, and nothing else: not the active project, which is written on the workspace goroutine at every project switch. AgentSpec read that for every id -- empty or not, since it was an argument -- so the fan-out dialog probing agents, and a fan-out deciding which rows ask about folder trust, raced every switch. An empty id names no agent here.

func (*Workspace) Agents

func (w *Workspace) Agents() ([]agent.Spec, string)

Agents returns the catalog this workspace runs from: every agent that is not hidden, and the id of the one a pane takes when nothing has chosen.

func (*Workspace) AttentionCount

func (w *Workspace) AttentionCount() (waiting, working int)

AttentionCount returns how many panes across every open project are waiting on the user, and how many are actively working.

func (*Workspace) BroadcastTargets

func (w *Workspace) BroadcastTargets() []*Pane

BroadcastTargets returns the panes that should receive broadcast input in the active tab, always including the focused pane.

func (*Workspace) BroadcastTargetsFor added in v0.3.4

func (w *Workspace) BroadcastTargetsFor(focus string) []*Pane

BroadcastTargetsFor is BroadcastTargets with the pane named standing where the focused one does. The prompt bar sends to the pane it was opened on, which focus may have left while it was being written in.

func (*Workspace) Catalog

func (w *Workspace) Catalog() *agent.Catalog

Catalog is the agents this workspace runs from, for a caller that needs more of it than Agents reports -- the defaults a project was given, and what the user's file had to say for itself. It is safe to call from any goroutine, so that probing a catalog full of agents need not happen on the one goroutine that owns the workspace.

func (*Workspace) ClaudeAvailable

func (w *Workspace) ClaudeAvailable() bool

ClaudeAvailable reports whether the claude CLI was found.

func (*Workspace) Close

func (w *Workspace) Close()

Close terminates every session and stops the hook server.

func (*Workspace) ClosePane

func (w *Workspace) ClosePane()

ClosePane closes the focused pane. Closing the last pane in a tab closes the tab.

func (*Workspace) ClosePaneByID added in v0.3.7

func (w *Workspace) ClosePaneByID(id string) bool

ClosePaneByID closes a pane wherever its tab is, without moving the window off whatever tab or project is on screen, and reports whether the pane was there to close. Closing the last pane in its tab closes the tab.

It is what lets the control socket close a helper sitting in a tab nobody is looking at: FocusPane, which every command used to go through, only finds a pane in the tab already on screen, and refused one anywhere else as though it had already gone.

func (*Workspace) CloseProject

func (w *Workspace) CloseProject(root string) error

CloseProject saves every member repo's layout, closes their tabs and removes the whole project -- see ProjectGroup. The last open project cannot be closed, since the window would have nothing to show; naming one repo out of several closes all of them, since closing a project closes what it contains. RemoveRepoFromGroup is how one repo alone leaves a project without the rest of it closing too.

A layout that cannot be saved does not keep its repo open: closing it is what was asked for, and its agents are stopped either way. It is reported instead, one member's failure named apart from another's.

func (*Workspace) CloseTab

func (w *Workspace) CloseTab(id string)

CloseTab closes a tab and every session in it.

func (*Workspace) ClosedRoots added in v0.3.4

func (w *Workspace) ClosedRoots() []string

ClosedRoots are the projects closed during this run, in the order they were closed, under the spelling each was open with. A -new run puts back the projects that were open before it on its way out, and without these it put back the very ones the user had closed. One closed and opened again is still among them; it is in Session's list as well.

func (*Workspace) ConversationOf added in v0.2.3

func (w *Workspace) ConversationOf(paneID string) string

ConversationOf reports the conversation a pane is in, for a caller outside the package: the history panel marks a conversation as open by the conversation a pane is in, not by the id the pane was started under. It is "" for a pane that is not open.

func (*Workspace) CurrentTab

func (w *Workspace) CurrentTab() *Tab

CurrentTab returns the active tab, or nil when there is none.

func (*Workspace) FocusPane

func (w *Workspace) FocusPane(id string)

FocusPane focuses a pane by id if it is in the active tab.

func (*Workspace) FocusedPane

func (w *Workspace) FocusedPane() *Pane

FocusedPane returns the pane with focus in the active tab.

func (*Workspace) HookServer

func (w *Workspace) HookServer() *hooks.Server

HookServer is the loopback API panes call back on, so the server can install the handler that lets an agent spawn helpers.

func (*Workspace) InBroadcast

func (w *Workspace) InBroadcast(id string) bool

InBroadcast reports whether a pane receives broadcast input.

func (*Workspace) MergeTab

func (w *Workspace) MergeTab(id, targetID string, dir layout.Dir) error

MergeTab folds one tab into another, leaving a single tab holding every pane of both, side by side along dir. The tab that was merged away closes, and, as with every other move here, nothing in it is stopped: its agents come across still running, with their conversations and scrollback intact.

This is the counterpart to dragging a pane out into a tab of its own. Two agents started in separate tabs are put side by side without restarting either of them.

func (*Workspace) MergeTabsInProject

func (w *Workspace) MergeTabsInProject(targetID string, dir layout.Dir) error

MergeTabsInProject folds every other tab of a project into one, which is the quickest way from agents scattered across tabs to all of them on screen at once.

The panes come out in the order the tab bar showed them, whichever tab was gathered into: a tab that was two to the left stays two to the left. Folding each tab in on the near side and working outwards is what gets that, since each merge only ever places a tab's panes against what has already been gathered.

func (*Workspace) MovePane

func (w *Workspace) MovePane(paneID, targetID string, edge layout.Edge) error

MovePane moves a pane so that it sits on one edge of another, in whichever tab that other pane lives in.

func (*Workspace) MovePaneDir

func (w *Workspace) MovePaneDir(dir layout.Direction) error

MovePaneDir moves the focused pane past its neighbour in a direction, which is the keyboard equivalent of dragging it there.

Neighbours are chosen by geometry rather than by tree order, so that moving a pane right sends it where the user can see the space is.

func (*Workspace) MovePaneToNewTab

func (w *Workspace) MovePaneToNewTab(paneID string) error

MovePaneToNewTab pulls a pane out into a tab of its own, which is how a pane that has outgrown its split gets the room to itself.

func (*Workspace) MovePaneToTab

func (w *Workspace) MovePaneToTab(paneID, tabID string) error

MovePaneToTab moves a pane into another tab, beside that tab's focused pane.

func (*Workspace) MoveTab

func (w *Workspace) MoveTab(id, beforeID string) error

MoveTab reorders a tab within its project, placing it before the tab named by beforeID. An empty beforeID moves it to the end.

func (*Workspace) NameTab added in v0.2.10

func (w *Workspace) NameTab(id, name string)

NameTab gives a tab a name chosen by hand, which no prompt replaces. The title the tab had been giving itself is kept, for UseAutoTitle to put back.

func (*Workspace) NewGroupFrom added in v0.3.26

func (w *Workspace) NewGroupFrom(roots []string, name string) (string, error)

NewGroupFrom merges the groups of several already-open roots into one new named project -- "Group open projects…" in the command palette, for api and web already open side by side that the user only now wants treated as one. It returns the new project's own address: its Primary root, the same string every other grouping method takes.

Every root given must already be open; an unopened or unknown one is refused rather than silently dropped, since the point is naming exactly the projects the user picked. Merging a root whose own group already has other members -- itself the result of an earlier grouping -- carries those members along rather than orphaning them.

func (*Workspace) NewTab

func (w *Workspace) NewTab(kind session.Kind, cwd, title string) *Tab

NewTab appends a tab to the active project and focuses it.

The tab belongs to the active project, since that is the tab bar it is drawn on, but the pane belongs to whichever open project its directory is in — the same rule a split follows. Opening a checkout that is itself open as a project, which is how a worktree usually reaches a new tab, otherwise gave an agent working in one project every reason to think it was in another.

func (*Workspace) NewTabWith

func (w *Workspace) NewTabWith(c Choice, cwd, title string) *Tab

NewTabWith is NewTab with the agent and model to run in the new tab's pane named, which is what the agent picker asks for.

func (*Workspace) NextTab

func (w *Workspace) NextTab()

NextTab and PrevTab cycle through the active project's tabs, wrapping.

func (*Workspace) OpenConversation

func (w *Workspace) OpenConversation(id, cwd, title string) error

OpenConversation opens a stored conversation in a new tab.

The pane takes the conversation's own id, which is what makes `--resume` reattach to it and what lets the layout remember it afterwards. A conversation that is already open is focused instead of being started twice: two panes on one conversation would fight over the same transcript.

func (*Workspace) OpenConversationAs added in v0.2.3

func (w *Workspace) OpenConversationAs(id, cwd, title, agentID string) error

OpenConversationAs is OpenConversation for a conversation the history panel knows the agent of. That agent is tried ahead of the rest: every API agent keeps its transcripts in the chat client's one folder, so without it an OpenAI conversation was reopened as whichever API agent came first.

func (*Workspace) OpenProject

func (w *Workspace) OpenProject(path string) error

OpenProject opens a directory as a project and makes it active. A project that is already open is simply selected. Its saved layout is restored the first time it is opened; if it has none, a single tab is created.

func (*Workspace) OpenRootFor added in v0.3.16

func (w *Workspace) OpenRootFor(root string) (string, bool)

OpenRootFor is openRootFor for callers outside the package: it resolves a path to the open project it names, spelled as that project was opened. StartAgent uses it to refuse a root that is not an already open project, rather than open one itself -- a phone is never let create a project the person at the desk never asked for.

func (*Workspace) OpeningPrompt

func (w *Workspace) OpeningPrompt(paneID, task string, mode agent.ContextMode) string

OpeningPrompt is what the agent in a pane should be started with: the task it was given, with the briefing in front of it when the agent has no hooks to answer.

Starting a pane calls this instead of passing the task straight through, because the briefing is the same one the hook returns and there is nowhere else for it to go for an agent that cannot be asked. Any other mode gets the task untouched: an agent with hooks is briefed when it fires its first one, and one asking for no context has said so.

It is called on the goroutine that owns the workspace, like every other read of it.

func (*Workspace) Pane

func (w *Workspace) Pane(id string) *Pane

Pane returns the pane with the given id.

func (*Workspace) PaneAgentSpec added in v0.3.8

func (w *Workspace) PaneAgentSpec(paneID string) (agent.Spec, bool)

PaneAgentSpec resolves the agent a pane runs, the same way starting or restarting it does: the pane's own choice, or the project's default when it recorded none. It must run on the workspace goroutine, since the default depends on the project a pane not naming one belongs to.

A shell pane answers false, the same as one that does not exist: it runs no agent, so resolving its empty Agent field would otherwise hand back the project's default agent's spec, as though the shell were running it.

This is what the phone's chat view uses to find which transcript adapter, if any, a pane's conversation should be read with -- never a path or session id the client sends, only the pane id it already had reason to see.

func (*Workspace) PaneContext

func (w *Workspace) PaneContext(paneID string) (PaneContext, bool)

PaneContext describes the situation a pane is running in. It reports false when the pane is unknown.

Everything here comes from state the workspace already holds — no git or filesystem calls — because it is built while a pane's agent session waits on its SessionStart hook.

func (*Workspace) PlanSourceFor

func (w *Workspace) PlanSourceFor(paneID string) PlanSource

PlanSourceFor gathers what a fan-out can read from a pane.

It only touches state already in memory, so it is safe on the goroutine that owns the workspace. Opening the transcript is Tasks's job.

func (*Workspace) PrepareWorktree

func (w *Workspace) PrepareWorktree(cwd, branch string) (string, error)

PrepareWorktree creates (or reuses) a worktree for a branch and returns its path. It only runs git, so it is safe to call away from the goroutine that owns the workspace — which matters, because git is slow.

func (*Workspace) PrevTab

func (w *Workspace) PrevTab()

PrevTab moves to the previous tab.

func (*Workspace) ProjectRepos added in v0.3.26

func (w *Workspace) ProjectRepos(projectRoot string) []RepoSummary

ProjectRepos lists every repo in projectRoot's own project, root and display label, with projectRoot's own open spelling first: a project spans more than one repo once it has been grouped, and this is how the worktrees panel finds the rest of them to fan its listing out across. An unopened root gets itself back alone.

func (*Workspace) Projects

func (w *Workspace) Projects() []Project

Projects returns the open projects with a summary of each. A project spanning more than one repo -- see ProjectGroup -- is one entry here, its counts summed over every member's tabs and panes; a project nobody has grouped is a group of one and reads exactly as it always has.

An agent is counted against the project it belongs to rather than the project of the tab it is drawn on. The switcher's badge is what says a project is waiting on you, and a borrowed pane counted against the tab it sits on lights up a project that is not the one whose work has stopped — while the project that is actually blocked shows nothing.

func (*Workspace) RefreshGit

func (w *Workspace) RefreshGit(apply func(func()))

RefreshGit updates every pane's git summary.

The git calls are made off the caller's goroutine and only the results are applied, so a slow repository cannot stall the interface. Each checkout's result is handed to apply as soon as it is read, and apply must run it where mutating panes is safe. RefreshGit returns once every checkout it asked about has answered or been given up on.

It applied nothing until every checkout had answered, so one that hung -- on a network drive gone away, behind a hook that never returned -- held every pane's header at its old numbers for the twenty seconds git was given, and then its own panes went on showing numbers from before it hung as though nothing were wrong. Now a checkout holds up only its own panes, for gitDeadline at most, and they are marked when it runs out.

func (*Workspace) RefreshGitOf added in v0.3.4

func (w *Workspace) RefreshGitOf(apply func(func()), ids []string)

RefreshGitOf is RefreshGit for the checkouts of the panes named only.

Every checkout of every open project was read every refresh, a whole-tree git status each, while only the panes on screen show what was read. With a few projects open that was dozens of processes every fifteen seconds for headers nobody could see.

func (*Workspace) ReloadAgents

func (w *Workspace) ReloadAgents() string

ReloadAgents reads agents.json again, so that an edit made by hand takes effect without restarting. It also returns what the file had to say for itself, which is empty unless it could not be read.

func (*Workspace) ReloadProjectMeta added in v0.3.26

func (w *Workspace) ReloadProjectMeta()

ReloadProjectMeta re-reads every project's display settings -- a name chosen by hand, whether it is archived, where it sits in a list ordered by hand -- from the recent-projects list, so a rename, an archive or a reorder made from the picker takes effect at once. It is safe to call from any goroutine, the way ReloadAgents is.

A damaged or unreadable list leaves what was cached before in place rather than clearing it: the picker's own write already failed and told the user so, and a second failure reading the very file it just wrote must not also unname or un-archive every other project on top of that.

func (*Workspace) RemoveRepoFromGroup added in v0.3.26

func (w *Workspace) RemoveRepoFromGroup(root string) error

RemoveRepoFromGroup splits one member back out of its project into a singleton group of its own -- ungrouping it, without closing it or touching any of its tabs. It refuses on a group's last member, the same shape as CloseProject's refusal to close the last open project: a group of zero members is not a project at all.

Closing that one repo's own tabs and panes as well -- "Remove Repo from Project" as the worktrees panel or project settings offers it -- is this plus CloseProject(root): once root is its own singleton group, closing it closes only itself, through the very rescue-or-destroy logic CloseProject already runs for any other single-member group, reused rather than duplicated.

func (*Workspace) RenameGroup added in v0.3.26

func (w *Workspace) RenameGroup(projectRoot, name string) error

RenameGroup gives a project a display name chosen by hand, which the switcher and the picker show in place of the one projectNames would derive for it. An empty name goes back to that -- the same shape as clearing a tab's name goes back to its automatic title.

func (*Workspace) ResizePaneTerminal

func (w *Workspace) ResizePaneTerminal(id string, cols, rows int)

ResizePaneTerminal records the terminal size the viewer measured for a pane and applies it to the PTY. Geometry is decided by the browser, which knows the font metrics, so the server only forwards the result.

func (*Workspace) RestartPane

func (w *Workspace) RestartPane()

RestartPane relaunches the focused pane's process. An agent pane resumes the same conversation wherever its agent can.

func (*Workspace) RestartPaneByID added in v0.3.7

func (w *Workspace) RestartPaneByID(id string) bool

RestartPaneByID is RestartPane for a pane named by id, wherever its tab is, and reports whether the pane was there to restart.

func (*Workspace) Restore

func (w *Workspace) Restore() (bool, error)

Restore rebuilds the initial project from its saved layout. It reports whether anything was restored; when it returns false the caller should create a fresh tab. The error is every saved layout it could not read, this project's and those of the projects its panes brought back with it; each of those projects has still been opened, without its tabs.

func (*Workspace) RestoreErrors added in v0.3.3

func (w *Workspace) RestoreErrors() error

RestoreErrors returns what the restores since it was last asked could not read, and forgets it: saved layouts, and the list of open projects that RestoreSession reads.

A file that cannot be read is restored as nothing, which should never stop the app starting, and so was never said at all. The project came up on one fresh tab, and the save half a minute later moved the user's file aside under a new name, which nothing said either.

func (*Workspace) RestoreSession

func (w *Workspace) RestoreSession() int

RestoreSession reopens the projects that were open when the application last exited, alongside the one it was started on. It returns how many extra projects were opened.

The project the user asked for stays active: reopening the rest is meant to bring back context, not to move them somewhere they did not ask to be.

Each restoreProject below builds its tabs as it always did, but collects every pane it would have started rather than starting it there; they are all started together once every project has been read, so a window with several other projects open waits once, for whichever project has the most to start, rather than once per project. See restoreProject's deferLaunch.

A list that could not be read, and the layout of any project reopened that could not be, are noted for RestoreErrors.

func (*Workspace) RevealPane added in v0.2.10

func (w *Workspace) RevealPane(id string)

RevealPane selects the tab a pane is in, switching project if that tab belongs to another, and focuses the pane there. FocusPane alone only works in the tab on screen, which is no help for a pane that has just been put in a tab of its own. A pane in no tab at all is left alone, and so is the window.

func (*Workspace) RootOf

func (w *Workspace) RootOf(paneID string) string

RootOf reports the project a pane belongs to, for callers outside the package that need to name it rather than the tab it is drawn on.

func (*Workspace) SaveAll

func (w *Workspace) SaveAll() error

SaveAll writes the layout of every open project and the list of which ones were open.

Every project is attempted even when one fails, and each failure is named after the project it belongs to: this runs on the way out, so the message printed to the terminal is the only thing the user gets, and "could not save layout" is no help at all when several projects are open.

func (*Workspace) SaveLayouts added in v0.3.1

func (w *Workspace) SaveLayouts() error

SaveLayouts writes the layout of every open project and leaves the list of which ones are open alone. It is what is saved while the app runs; SaveAll, which records that list as well, is what is saved as it stops.

func (*Workspace) SaveProject

func (w *Workspace) SaveProject(root string) error

SaveProject writes one project's tabs to its own layout file, so projects are restored independently of one another.

func (*Workspace) SaveSession

func (w *Workspace) SaveSession() error

SaveSession records which projects are open for the next run.

func (*Workspace) SelectProject

func (w *Workspace) SelectProject(root string)

SelectProject shows an already open project. Naming any one of a multi-repo project's members shows the project on the member it was last worked in, not necessarily the one named -- see noteActiveRoot -- the same way switching to a project by any other route always lands where it was left.

func (*Workspace) SelectRepo added in v0.3.26

func (w *Workspace) SelectRepo(root string)

SelectRepo shows an already open project on one particular member repo, rather than the member the project was last left on -- for picking a specific entry out of a project's own expanded member list, or a worktree-panel row that names one directly. SelectProject is what every other route into a project uses, and lands on the last member worked in.

func (*Workspace) SelectTab

func (w *Workspace) SelectTab(id string)

SelectTab focuses a tab, switching project if it belongs to another.

func (*Workspace) SendPrompt

func (w *Workspace) SendPrompt(text string, submit bool)

SendPrompt types text into every broadcast target and submits it.

Each pane is written to on a goroutine of its own. This runs on the goroutine that owns the workspace, and a terminal whose program has stopped reading its input fills after a few kilobytes on Linux and macOS, after which a write into it blocks until the program reads again — which, done here, held up the whole window for as long as one pane went on not reading.

A prompt of several lines is pasted rather than typed into a pane whose program takes bracketed paste: typed, every line break in it is an Enter, and the first line was submitted on its own with the rest arriving as further messages. Where the program has not asked for bracketed paste the markers would reach it as text, so it is typed as before.

func (*Workspace) SendPromptTo added in v0.3.4

func (w *Workspace) SendPromptTo(focus, text string, submit bool)

SendPromptTo is SendPrompt with the pane named standing where the focused one does; see BroadcastTargetsFor.

func (*Workspace) Session added in v0.3.3

func (w *Workspace) Session() *store.Session

Session is the list of open projects SaveSession records: the ones open, and after them the ones whose folders were away at start and are still being kept for their return, with how many starts each has been away. One whose folder came back and was opened during the run is among the open.

func (*Workspace) SetConversationHook added in v0.3.8

func (w *Workspace) SetConversationHook(fn func(paneID string))

SetConversationHook installs the callback told a pane's id whenever a hook event about it arrives, for the same reason SetWake exists: the server needs the workspace built before it can register itself.

func (*Workspace) SetPaneAutoReview added in v0.3.24

func (w *Workspace) SetPaneAutoReview(id string, on bool) bool

SetPaneAutoReview turns auto-review approvals on or off for one pane -- see Pane.AutoReview and reviewTool, which is where it is read. It reports whether the pane was found, which is false for one already closed, and is what an autoReview command for a gone id is refused by.

It writes under w.mu, unlike SetPaneMuted: reviewTool reads AutoReview from the hook server's own goroutines, not the one that owns the workspace.

func (*Workspace) SetPaneMuted added in v0.3.18

func (w *Workspace) SetPaneMuted(id string, muted bool) bool

SetPaneMuted mutes or unmutes a pane's phone push notifications -- see push.go's pushDue, which leaves a muted pane's wait out of the ones a push is built from. It reports whether the pane was found, which is false for one already closed, and is what a mutePane command for a gone id is refused by.

func (*Workspace) SetWake

func (w *Workspace) SetWake(fn func())

SetWake installs the refresh callback. It exists so the server, which needs the workspace to construct, can register itself afterwards.

func (*Workspace) Spawn

func (w *Workspace) Spawn(parentPaneID string, o SpawnOptions) (string, error)

Spawn starts a child agent, optionally in a worktree of its own.

The task is handed to the agent as its opening argument rather than typed into the terminal: typing into a TUI means guessing when it is ready, while an argument is submitted by the agent itself the moment it starts.

func (*Workspace) SplitPane

func (w *Workspace) SplitPane(dir layout.Dir, kind session.Kind)

SplitPane splits the focused pane, starting a new session beside it in the same directory.

func (*Workspace) SplitPaneIn

func (w *Workspace) SplitPaneIn(dir layout.Dir, kind session.Kind, cwd string)

SplitPaneIn splits the focused pane, starting the new session in cwd. An empty cwd inherits the focused pane's directory, which is what a plain split should do; the worktree panel passes a directory to put an agent straight into another checkout.

func (*Workspace) SplitPaneInProject

func (w *Workspace) SplitPaneInProject(dir layout.Dir, kind session.Kind, root string)

SplitPaneInProject splits the focused pane and starts the new session in another open project, which is how two projects come to be worked on side by side in one tab. An unknown or empty project falls back to an ordinary split.

func (*Workspace) SplitPaneInProjectWith

func (w *Workspace) SplitPaneInProjectWith(dir layout.Dir, c Choice, root string)

SplitPaneInProjectWith is SplitPaneInProject with the agent and model named.

func (*Workspace) SplitPaneInWith

func (w *Workspace) SplitPaneInWith(dir layout.Dir, c Choice, cwd string)

SplitPaneInWith is SplitPaneIn with the agent and model named.

func (*Workspace) StartAgent added in v0.3.16

func (w *Workspace) StartAgent(root, agentID, model, cwd, task string) (string, error)

StartAgent starts a fresh agent in an already open project, in a new tab of its own, without moving the desk's focus: neither the active project nor the active tab changes, because a phone starting an agent cannot see the desk's window and must not move it out from under whoever is sitting there.

root must already be open; StartAgent refuses to open one, unlike Spawn's caller newTabFor, which always works in the active project. cwd is where the pane actually works -- root itself, or a worktree cut from it, chosen by the caller, since cutting one is slow and best done, as a fan-out's are, before anything touches the workspace.

Its Parent is left empty, so unlike a helper started by another agent's own `flockdeck spawn`, it is never held back from notifying its user while some other pane stays open; see Pane.Parent. It is the user's own pane, exactly as one opened by hand at the desk would be -- started from a phone instead.

func (*Workspace) SwapPanes

func (w *Workspace) SwapPanes(a, b string) error

SwapPanes exchanges two panes' positions, leaving the splits and their proportions exactly as they were. The panes may be in different tabs.

func (*Workspace) Tab

func (w *Workspace) Tab(id string) *Tab

Tab returns the tab with the given id, or nil.

func (*Workspace) TabIDOf

func (w *Workspace) TabIDOf(paneID string) string

TabIDOf returns the id of the tab a pane is drawn in, or "" when the pane is not on screen. It is what a caller starting several panes into one tab needs after the first of them, since that first one is what created the tab.

func (*Workspace) TabNeedsAttention

func (w *Workspace) TabNeedsAttention(t *Tab) bool

TabNeedsAttention reports whether any pane in a tab is waiting on the user.

func (*Workspace) TilePanes

func (w *Workspace) TilePanes() error

TilePanes lays the current tab's panes out as an even grid, in the order they are already in.

It is the way back. Every other move here is relative — beside this one, past that one — and a tab that has been rearranged a dozen times ends up with panes so narrow there is no divider left to take hold of and no room to drop anything into. Rather than ask the user to drag their way out of that, this puts the tab back into rows of even columns in one go.

func (*Workspace) ToggleBroadcast

func (w *Workspace) ToggleBroadcast()

ToggleBroadcast turns broadcast mode on or off.

With no selection of the user's own, broadcast means every agent pane in the tab in front of you. That default is not written down as a set of panes: it is answered from whichever tab is on screen at the time, so switching tabs with broadcast still on broadcasts to the tab you are now looking at rather than to the one you switched it on in — where it would have gone to panes that are not on screen, which looks exactly like broadcast having stopped working.

func (*Workspace) ToggleBroadcastMember

func (w *Workspace) ToggleBroadcastMember()

ToggleBroadcastMember adds or removes the focused pane from the broadcast set.

func (*Workspace) ToggleZoom

func (w *Workspace) ToggleZoom()

ToggleZoom expands or restores the focused pane.

func (*Workspace) ToggleZoomByID added in v0.3.7

func (w *Workspace) ToggleZoomByID(id string) bool

ToggleZoomByID is ToggleZoom for a pane named by id, wherever its tab is: it gives the pane the focus of its own tab, expands or restores that tab, and reports whether the pane was there at all. Called on the pane already focused in the tab on screen, which is every use but the control socket's, it changes nothing beyond that tab's own Zoom.

func (*Workspace) UseAgent

func (w *Workspace) UseAgent(id string)

UseAgent fixes which agent a new pane starts as for the rest of this run, which is what -agent asks for.

It sits between the two answers that already exist: above the catalog's own defaults, because naming an agent on the command line is a more immediate statement than a file written weeks ago, and below a pane that names one itself, because a restored layout knows what it was.

func (*Workspace) UseAutoTitle added in v0.2.10

func (w *Workspace) UseAutoTitle(id string) bool

UseAutoTitle gives up a name chosen by hand, and gives the tab the title it would have now had it never been renamed: the directory name, still waiting for the first prompt to replace it, or what the first prompt made of it. It reports whether anything changed, which it does not for a tab that already has its automatic title.

func (*Workspace) ValidateStartAgent added in v0.3.16

func (w *Workspace) ValidateStartAgent(root, agentID, model string) (openRoot, resolvedAgent string, err error)

ValidateStartAgent reports what StartAgent would run for root, agentID and model, or the error it would refuse with, without starting anything.

func (*Workspace) VisibleTabs

func (w *Workspace) VisibleTabs() []*Tab

VisibleTabs returns the tabs of the active project, in order -- every tab belonging to any member of the active group, for a project spanning more than one repo, so its tabs show together rather than splitting across switcher entries. A project nobody has grouped has one member and this reads exactly as it always has.

Jump to

Keyboard shortcuts

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