Documentation
¶
Index ¶
- Variables
- func AppleScriptString(s string) string
- func JobID(id string) (string, error)
- type Agent
- type Control
- func (c *Control) Agents(ctx context.Context, all bool) ([]Agent, error)
- func (c *Control) Attach(id, dir string) error
- func (c *Control) AttachHere(id string) error
- func (c *Control) Copy(ctx context.Context, text string) error
- func (c *Control) Fork(ctx context.Context, dir, sessionID string) (string, error)
- func (c *Control) New(ctx context.Context, dir, prompt string) (string, error)
- func (c *Control) Paste(ctx context.Context) (string, error)
- func (c *Control) Remove(ctx context.Context, id string) error
- func (c *Control) Resume(ctx context.Context, dir, sessionID string) (string, error)
- func (c *Control) Reveal(dir string) error
- func (c *Control) Stop(ctx context.Context, id string) error
- type Desktop
- type Runner
Constants ¶
This section is empty.
Variables ¶
var ErrNoJob = errors.New("no Claude Code job for that session")
ErrNoJob is claude rm saying it has no job by that id: Claude Code 2.1.310's claude stop drops a job outright. Item 341.
var ErrUntrusted = errors.New("workspace not trusted")
Functions ¶
func AppleScriptString ¶ added in v0.1.6
AppleScriptString escapes s for the inside of an AppleScript string literal.
Types ¶
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func (*Control) Attach ¶
Attach opens a terminal on a session, started in the session's directory, dir: when the session ends, claude attach turns into Claude Code's agent view in that terminal's directory, which must be one the session already trusts rather than wherever the city was started (item 302). Empty dir starts it where the city runs.
func (*Control) AttachHere ¶ added in v0.3.0
AttachHere attaches to a session in the terminal botropolis runs in.
func (*Control) Copy ¶
Copy puts text on the clipboard through whichever tool is installed. A tool that has not finished within copyTimeout is stopped, and the copy fails rather than holding up whoever asked.
func (*Control) Fork ¶ added in v0.2.0
Fork starts a fresh session from a copy of another's conversation, leaving the original as it was.
func (*Control) Paste ¶ added in v0.3.3
Paste reads the clipboard's text through the tool Copy would use, under the same deadline (item 290).
type Desktop ¶ added in v0.1.6
type Desktop struct {
OS string
Opener string
Clipboards [][]string
// Pastes are the tools that read the clipboard back, in Clipboards'
// order, so paste reaches for the tool copy does (item 290).
Pastes [][]string
// ClipboardHint is what to install when no clipboard tool is found.
ClipboardHint string
Terminals []string
}
Desktop is what reveal, copy and attach reach for on one operating system.
func DesktopFor ¶ added in v0.1.6
DesktopFor returns the desktop for a GOOS; anything that is not macOS is treated as a Linux desktop.
func Native ¶ added in v0.1.6
func Native() Desktop
Native is the desktop this binary was built for.
func (Desktop) KnownTerminals ¶ added in v0.1.6
KnownTerminals is the list tried when nothing names a terminal.
type Runner ¶
type Runner interface {
Run(ctx context.Context, dir string, name string, args ...string) (string, error)
Start(dir string, name string, args ...string) error
// Interactive hands the caller's terminal to a command.
Interactive(name string, args ...string) error
// Feed runs a command with input on its stdin.
Feed(ctx context.Context, input string, name string, args ...string) error
// Read runs a command and returns what it printed.
Read(ctx context.Context, name string, args ...string) (string, error)
}