Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
CheckInterval time.Duration
TokenThreshold time.Duration
NotificationsOn bool
AttentionThreshold time.Duration
NotifyOn []string
QuietHoursStart string
QuietHoursEnd string
ContainerPrefix string
CreateContainer func(task, parentContainer, branch string) (string, error) // Callback for IPC child creation
}
Config holds daemon configuration
type ContainerState ¶
type ContainerState struct {
Name string
AttentionStarted *time.Time
LastNotified *time.Time
LastActivity time.Time
LastTokenCheck time.Time
NotificationSent bool
LastTaskCheck time.Time
HadOpenTasks bool // Whether container had incomplete tasks last check
LastTaskProgress string // Last seen task progress (e.g., "2/5")
TaskCompletionNotified bool // Whether we've notified about task completion
LastIPCCheck time.Time
// contains filtered or unexported fields
}
ContainerState tracks container monitoring state
type Credentials ¶
type Credentials struct {
ClaudeAiOauth struct {
AccessToken string `json:"accessToken"`
RefreshToken string `json:"refreshToken"`
ExpiresAt int64 `json:"expiresAt"`
Scopes []string `json:"scopes"`
SubscriptionType string `json:"subscriptionType"`
} `json:"claudeAiOauth"`
}
Credentials represents OAuth credentials
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon manages background monitoring and auto-refresh
type DaemonIPCInfo ¶ added in v0.9.4
type DaemonIPCInfo struct {
Port int `json:"port"`
BridgePort int `json:"bridge_port,omitempty"`
Token string `json:"token"`
PID int `json:"pid"`
}
DaemonIPCInfo is the JSON structure written to daemon-ipc.json
type IPCMessage ¶ added in v0.9.4
type IPCMessage struct {
Role string `json:"role"` // "user" or "assistant"
Content string `json:"content"` // Text content (truncated at 10KB)
Timestamp string `json:"timestamp"` // ISO 8601
}
IPCMessage represents a message from a Claude session
type IPCRequest ¶ added in v0.9.4
type IPCRequest struct {
ID string `json:"id"`
Action IPCAction `json:"action"`
Task string `json:"task,omitempty"` // For "new" action
Title string `json:"title,omitempty"` // For "notify" action
Message string `json:"message,omitempty"` // For "notify" and "send_message" actions
Parent string `json:"parent"` // Container hostname (verified)
Branch string `json:"branch,omitempty"` // Optional branch for "new" action
TargetRequestID string `json:"target_request_id,omitempty"` // For child-targeting actions
Count int `json:"count,omitempty"` // read_messages: how many (default 10, max 50)
Timeout int `json:"timeout,omitempty"` // wait_idle: seconds (default 300)
}
IPCRequest is the wire format for IPC requests from containers
type IPCRequestFile ¶ added in v0.9.4
type IPCRequestFile struct {
ID string `json:"id"`
Action IPCAction `json:"action"`
Task string `json:"task,omitempty"`
Title string `json:"title,omitempty"`
Message string `json:"message,omitempty"`
Parent string `json:"parent"`
Branch string `json:"branch,omitempty"`
Status IPCRequestStatus `json:"status"`
RequestedAt time.Time `json:"requested_at"`
ChildContainer *string `json:"child_container,omitempty"`
FulfilledAt *time.Time `json:"fulfilled_at,omitempty"`
ChildExitedAt *time.Time `json:"child_exited_at,omitempty"`
Error *string `json:"error,omitempty"`
TargetRequestID string `json:"target_request_id,omitempty"`
Messages []IPCMessage `json:"messages,omitempty"`
Count int `json:"count,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
IPCRequestFile is the persistence format stored in the container filesystem
type IPCRequestStatus ¶ added in v0.9.4
type IPCRequestStatus string
IPCRequestStatus represents the status of a persisted IPC request
const ( IPCRequestStatusPending IPCRequestStatus = "pending" IPCRequestStatusFulfilled IPCRequestStatus = "fulfilled" IPCRequestStatusFailed IPCRequestStatus = "failed" IPCRequestStatusChildExited IPCRequestStatus = "child_exited" )
type IPCResponse ¶ added in v0.9.4
type IPCResponse struct {
Status string `json:"status"` // "ok", "accepted", "error"
Container string `json:"container,omitempty"` // For "new" action (immediate only)
Error string `json:"error,omitempty"`
}
IPCResponse is the wire format for IPC responses to containers
type IPCServer ¶ added in v0.9.4
type IPCServer struct {
// contains filtered or unexported fields
}
IPCServer handles HTTP requests from containers and CLI over TCP
func NewIPCServer ¶ added in v0.9.4
NewIPCServer creates a new IPC server with a loopback listener (and optionally a Docker bridge listener)
func (*IPCServer) BridgePort ¶ added in v0.9.4
BridgePort returns the TCP port on the Docker bridge interface, or 0 if not bound
func (*IPCServer) LoopbackPort ¶ added in v0.9.4
LoopbackPort returns the TCP port on 127.0.0.1 (for CLI / daemon-ipc.json)