forge

package
v0.0.0-...-cebc4e0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestrator

type Orchestrator struct {
	Containers container.ContainerManager
	HomeDir    string
	ConfigDir  string
	ClaudeDir  string
	Log        func(format string, args ...any)
}

Orchestrator manages the lifecycle of claude-forge sessions.

func NewOrchestrator

func NewOrchestrator(containers container.ContainerManager, homeDir string) *Orchestrator

NewOrchestrator creates an Orchestrator with default paths derived from homeDir.

func (*Orchestrator) Build

func (o *Orchestrator) Build(ctx context.Context) error

Build pulls the latest agent and gateway images.

func (*Orchestrator) Cleanup

func (o *Orchestrator) Cleanup(ctx context.Context, sess *Session)

Cleanup stops and removes all containers and network for a session.

func (*Orchestrator) RestartSharedMCP

func (o *Orchestrator) RestartSharedMCP(ctx context.Context) error

RestartSharedMCP stops all shared MCP containers and starts them again.

func (*Orchestrator) Start

func (o *Orchestrator) Start(ctx context.Context, opts StartOptions) (*Session, error)

Start creates a new claude-forge session: loads config, identifies the project, resolves credentials, creates containers, and returns the session info. The caller is responsible for attaching to the agent and calling Cleanup.

func (*Orchestrator) Status

func (o *Orchestrator) Status(ctx context.Context) ([]StatusEntry, error)

Status returns all running forge containers.

func (*Orchestrator) Stop

func (o *Orchestrator) Stop(ctx context.Context, projectDir string) error

Stop stops all running containers for the project in the given directory.

type Session

type Session struct {
	AgentName     string
	GatewayName   string
	GitHubMCPName string
	NetworkName   string
	SessionID     string
	ProjectID     string
}

Session holds information about a running session.

type StartOptions

type StartOptions struct {
	SkipPermissions    bool
	Worktree           bool
	Prompt             string
	ResumeID           string
	ResumeSubdir       string // session subdir (e.g., "-work") for constructing the resume file path
	Continue           bool
	Interactive        bool     // allocate TTY for docker attach (false for prompt mode)
	ProjectDir         string   // working directory (defaults to cwd if empty)
	UID                int      // host user UID
	GID                int      // host user GID
	Mounts             []string // additional host:container bind mounts
	ResumeWorktreeName string   // worktree name when resuming a worktree session
}

StartOptions holds options for starting a session.

type StatusEntry

type StatusEntry = container.ContainerInfo

StatusEntry holds info about a running forge container.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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