server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Overview

Package server is the conch daemon: it owns panes and serves the protocol on a unix socket so clients can come and go without killing agents.

Index

Constants

View Source
const KeychainService = "conch-mcp"

KeychainService is the Keychain service the tokens are kept under; the account is the variable's name.

Variables

View Source
var DefaultLocalFiles = []string{
	".env", ".env.*", ".envrc",
	".claude/settings.local.json", "CLAUDE.local.md", ".mcp.json",
	"AGENTS.override.md", ".gemini/.env",
}

DefaultLocalFiles are copied from the main checkout into new worktrees: files an agent in the worktree would otherwise lack. Only files git ignores are copied — tracked ones are already there, and an untracked file git doesn't ignore could end up committed on the task's branch (and would stop the worktree from being removed).

View Source
var ErrAlreadyRunning = errors.New("conch server is already running")

ErrAlreadyRunning is returned when another server owns the socket.

Functions

This section is empty.

Types

type Server

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

Server owns all panes on this machine.

func New

func New(sockPath, configDir string) *Server

New creates a server that will listen on sockPath and keep integration files and agent manifest overrides under configDir.

func (*Server) Run

func (s *Server) Run() error

Run listens and serves until Stop is called or the process is signalled.

func (*Server) Stop

func (s *Server) Stop()

Stop begins shutdown; Run returns once panes are closed. The watches go at once rather than with the run loop: a server that never ran one — a test's, or one that failed to start — would otherwise leave its streams, and on macOS a CoreFoundation thread each, behind for good.

func (*Server) StopAndWait added in v0.2.0

func (s *Server) StopAndWait()

StopAndWait stops the server and waits until Run has returned — every pane's program ended, not merely asked to. Stop alone returns at once, and a test that ended its process then left a pane's program running for ever: a shell loop that ignores its dead terminal, found burning a core days later. A server that never ran is not waited for.

Jump to

Keyboard shortcuts

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