Documentation
¶
Index ¶
- func AddDomainToAllContainers(domain, containerPrefix string) error
- func AddDomainToContainer(containerName, domain string) error
- func CheckIdleStatus(containerName string) bool
- func DeleteContainer(containerName string) error
- func EnsureFreshToken(containerName, containerPrefix string) error
- func FormatExpiration(creds *Credentials) string
- func GetAuthStatus(containerName string) string
- func GetBranchName(containerName string) string
- func GetGitStatus(containerName string) string
- func GetLastActivity(containerName string) string
- func GetShortName(containerName, prefix string) string
- func IsClaudeRunning(containerName string) bool
- func IsDockerResponsive() bool
- func IsTokenExpired(creds *Credentials) bool
- func RefreshTokens(containerName string) error
- func RestartContainer(containerName string) error
- func StartContainer(containerName string) error
- func StopContainer(containerName string) error
- func TimeUntilExpiration(creds *Credentials) time.Duration
- type ContainerDetails
- type ContainerTasks
- type Credentials
- type DisplayOptions
- type Info
- type OperationType
- type Session
- type SessionSummary
- type Task
- type TaskStatus
- type TaskSummary
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDomainToAllContainers ¶
AddDomainToAllContainers adds a domain to all running maestro containers' firewall
func AddDomainToContainer ¶
AddDomainToContainer adds a domain to a specific container's firewall
func CheckIdleStatus ¶ added in v0.9.4
CheckIdleStatus checks if a container's Claude agent is idle (waiting for input). Returns true when the claude-idle flag file exists, which is created by the Claude Code Stop hook and removed by UserPromptSubmit/PreToolUse hooks.
func DeleteContainer ¶
DeleteContainer removes a container and its volumes
func EnsureFreshToken ¶ added in v0.9.3
EnsureFreshToken checks if a container has a valid token, and if not, syncs the freshest available token from host or other containers. Returns nil if token is already fresh, or after successful sync. Returns error if no valid token is available anywhere.
func FormatExpiration ¶
func FormatExpiration(creds *Credentials) string
FormatExpiration returns human-readable expiration status
func GetAuthStatus ¶
GetAuthStatus retrieves the authentication status for a container
func GetBranchName ¶
GetBranchName retrieves the current git branch from a container
func GetGitStatus ¶
GetGitStatus gets git status indicators for a container Returns a fixed-width string for proper column alignment
func GetLastActivity ¶
GetLastActivity gets the last activity time for a container
func GetShortName ¶
GetShortName removes the prefix from a container name
func IsClaudeRunning ¶
IsClaudeRunning checks if Claude process is running in a container Excludes zombie/defunct processes
func IsDockerResponsive ¶ added in v0.9.2
func IsDockerResponsive() bool
IsDockerResponsive checks if Docker daemon is responding
func IsTokenExpired ¶
func IsTokenExpired(creds *Credentials) bool
IsTokenExpired checks if token is expired (true) or valid (false)
func RefreshTokens ¶
RefreshTokens finds the freshest token and syncs it to a specific container
func RestartContainer ¶
RestartContainer performs a full container restart (docker stop + start)
func StartContainer ¶ added in v0.9.3
StartContainer starts a stopped container
func StopContainer ¶
StopContainer stops a running container
func TimeUntilExpiration ¶
func TimeUntilExpiration(creds *Credentials) time.Duration
TimeUntilExpiration returns duration until token expires (negative if expired)
Types ¶
type ContainerDetails ¶
type ContainerDetails struct {
Name string
ShortName string
Status string
StatusDetails string
Branch string
GitStatus string
AuthStatus string
LastActivity string
Uptime string
CPUs string
Memory string
IPAddress string
Ports []string
Volumes []string
Environment []string
RecentLogs string
}
ContainerDetails holds comprehensive information about a container for the details view
func GetContainerDetails ¶
func GetContainerDetails(containerName, prefix string) (*ContainerDetails, error)
GetContainerDetails fetches comprehensive information about a container
type ContainerTasks ¶ added in v0.9.3
type ContainerTasks struct {
ContainerName string
ShortName string
Sessions []Session
Error error // If there was an error reading tasks
}
ContainerTasks holds all task data for a container
func GetAllContainerTasks ¶ added in v0.9.3
func GetAllContainerTasks(containerPrefix string) ([]ContainerTasks, error)
GetAllContainerTasks reads task data from all running containers with the given prefix
func GetContainerTasks ¶ added in v0.9.3
func GetContainerTasks(containerName string) (*ContainerTasks, error)
GetContainerTasks reads all task data from a container Supports two formats: - Old TodoWrite: /home/node/.claude/todos/{session-uuid}-agent-{agent-uuid}.json (array format) - New Task*: /home/node/.claude/tasks/{session-uuid}/{id}.json (individual files)
type Credentials ¶
type Credentials struct {
ClaudeAiOauth struct {
AccessToken string `json:"accessToken"`
RefreshToken string `json:"refreshToken"`
ExpiresAt int64 `json:"expiresAt"` // milliseconds
Scopes []string `json:"scopes"`
SubscriptionType string `json:"subscriptionType"`
} `json:"claudeAiOauth"`
}
Credentials represents the Claude OAuth credentials structure
func ReadCredentials ¶
func ReadCredentials(path string) (*Credentials, error)
ReadCredentials loads and parses credentials from a file path
type DisplayOptions ¶
type DisplayOptions struct {
ShowNumbers bool // Show selection numbers (for interactive selection)
ShowTable bool // Show full table format with all columns
}
DisplayOptions configures how containers are displayed
type Info ¶
type Info struct {
Name string
ShortName string
Status string
StatusDetails string
Branch string
NeedsAttention bool
IsDormant bool // Claude process not running
AuthStatus string // Token expiration status
LastActivity string // Time since last activity
GitStatus string // Git status indicators
CreatedAt time.Time // Container creation time
CurrentTask string // Current task being worked on (from Claude Code task management)
TaskProgress string // Task progress (e.g., "2/5")
}
Info holds information about a container
func Display ¶
func Display(containers []Info, opts DisplayOptions) []Info
Display shows containers in a consistent format Returns the sorted list for use in selection
func GetAllContainers ¶
GetAllContainers returns a list of all containers (including stopped) with the given prefix
func GetRunningContainers ¶
GetRunningContainers returns a list of all running containers with the given prefix
func SortByPriority ¶
SortByPriority sorts containers by logical priority groups, then by creation date within each group Priority order: 1. Needs Attention (running with idle flag from Claude Code hooks) 2. Running (normal) 3. Dormant (running but Claude not active) 4. Stopped Within each group, sorts by creation date (newest first)
type OperationType ¶
type OperationType string
OperationType defines Docker operations that can be performed on containers
const ( OperationStop OperationType = "stop" OperationRestart OperationType = "restart" OperationDelete OperationType = "delete" OperationRefreshTokens OperationType = "refresh-tokens" )
type Session ¶ added in v0.9.3
type Session struct {
ID string // Session UUID (directory name)
Tasks []Task // Tasks in this session
LastUpdate time.Time // Last modification time
}
Session represents a Claude Code session containing tasks
func (*Session) GetSummary ¶ added in v0.9.3
func (s *Session) GetSummary() SessionSummary
GetSummary returns a summary of the session's task state
type SessionSummary ¶ added in v0.9.3
type SessionSummary struct {
ID string
TotalTasks int
PendingTasks int
InProgressTasks int
CompletedTasks int
CurrentTask string // The activeForm of the in_progress task
LastUpdate time.Time
}
SessionSummary provides a quick overview of session state
type Task ¶ added in v0.9.3
type Task struct {
ID string `json:"id"`
Content string `json:"content,omitempty"` // TodoWrite format: task description
Subject string `json:"subject,omitempty"` // Task* format: task title
Description string `json:"description,omitempty"` // Task* format: detailed description
Status TaskStatus `json:"status"` // pending, in_progress, completed
ActiveForm string `json:"activeForm,omitempty"` // Present tense form shown during execution
BlockedBy []string `json:"blockedBy,omitempty"` // Task* format: dependency IDs
Blocks []string `json:"blocks,omitempty"` // Task* format: tasks this blocks
}
Task represents a Claude Code task item Supports both old TodoWrite format (content) and new Task* format (subject/description)
func GetActiveTask ¶ added in v0.9.3
GetActiveTask returns the currently in-progress task for a container, if any
func (*Task) GetDisplayName ¶ added in v0.9.3
GetDisplayName returns the best available name for display
type TaskStatus ¶ added in v0.9.3
type TaskStatus string
TaskStatus represents the status of a Claude Code task
const ( TaskStatusPending TaskStatus = "pending" TaskStatusInProgress TaskStatus = "in_progress" TaskStatusCompleted TaskStatus = "completed" )
type TaskSummary ¶ added in v0.9.3
type TaskSummary struct {
CurrentTask string // Display name of current in-progress task
Progress string // e.g., "2/5" (completed/total)
HasTasks bool // Whether there are any tasks
}
TaskSummary holds a brief summary of task state for display
func GetTaskSummary ¶ added in v0.9.3
func GetTaskSummary(containerName string) TaskSummary
GetTaskSummary returns a brief task summary for a container (for list display)
type TokenSource ¶ added in v0.9.3
type TokenSource struct {
Path string // File path (for host or temp file from container)
ExpiresAt time.Time // Token expiration time
Source string // "host" or container name
IsTempFile bool // If true, path is a temp file that should be cleaned up
}
TokenSource represents where a token was found
func FindFreshestToken ¶ added in v0.9.3
func FindFreshestToken(containerPrefix string) (*TokenSource, error)
FindFreshestToken searches host and all containers for the freshest unexpired token. Returns nil if no valid token is found anywhere.