services

package
v0.0.0-...-071fe3b Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the path to the configuration file This is a wrapper around path.PathManager to avoid import cycle

func ShouldSkipHeartbeatForBootstrap

func ShouldSkipHeartbeatForBootstrap(workspace string) bool

ShouldSkipHeartbeatForBootstrap checks if BOOTSTRAP.md exists If it exists, heartbeat LLM call should be skipped

Types

type BotService

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

BotService encapsulates all core bot services It manages the lifecycle of the entire bot functionality

func NewBotService

func NewBotService() *BotService

NewBotService creates a new BotService instance

func (*BotService) GetComponents

func (s *BotService) GetComponents() map[string]interface{}

GetComponents returns the core components for external access

func (*BotService) GetConfig

func (s *BotService) GetConfig() (*config.Config, error)

GetConfig returns the current configuration

func (*BotService) GetError

func (s *BotService) GetError() error

GetError returns the error that caused the error state

func (*BotService) GetForge

func (s *BotService) GetForge() *forge.Forge

GetForge returns the Forge instance if available.

func (*BotService) GetState

func (s *BotService) GetState() BotState

GetState returns the current state of the bot service

func (*BotService) Restart

func (s *BotService) Restart() error

Restart stops and then starts the bot service

func (*BotService) SaveConfig

func (s *BotService) SaveConfig(cfg interface{}, restart bool) error

SaveConfig saves the configuration and optionally restarts the bot

func (*BotService) Start

func (s *BotService) Start() error

Start initializes and starts all bot services This is equivalent to what the gateway command does

func (*BotService) Stop

func (s *BotService) Stop() error

Stop gracefully stops all bot services

type BotState

type BotState int

BotState represents the current state of the Bot service

const (
	// BotStateNotStarted indicates the bot has not been started
	BotStateNotStarted BotState = iota
	// BotStateStarting indicates the bot is currently starting
	BotStateStarting
	// BotStateRunning indicates the bot is running normally
	BotStateRunning
	// BotStateError indicates the bot is in an error state
	BotStateError
)

func (BotState) CanStart

func (s BotState) CanStart() bool

CanStart returns true if the bot can be started

func (BotState) CanStop

func (s BotState) CanStop() bool

CanStop returns true if the bot can be stopped

func (BotState) IsRunning

func (s BotState) IsRunning() bool

IsRunning returns true if the bot is in a running state

func (BotState) MarshalJSON

func (s BotState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface

func (BotState) String

func (s BotState) String() string

String returns the string representation of the state

func (*BotState) UnmarshalJSON

func (s *BotState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface

type ServiceManager

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

ServiceManager manages all services in the application It handles both basic services (always running) and the bot service (on-demand)

func NewServiceManager

func NewServiceManager() *ServiceManager

NewServiceManager creates a new ServiceManager instance

func (*ServiceManager) GetBotComponents

func (m *ServiceManager) GetBotComponents() map[string]interface{}

GetBotComponents returns the bot components for external access

func (*ServiceManager) GetBotConfig

func (m *ServiceManager) GetBotConfig() (interface{}, error)

GetBotConfig returns the current bot configuration

func (*ServiceManager) GetBotError

func (m *ServiceManager) GetBotError() error

GetBotError returns the error from the bot service

func (*ServiceManager) GetBotService

func (m *ServiceManager) GetBotService() *BotService

GetBotService returns the bot service instance

func (*ServiceManager) GetBotState

func (m *ServiceManager) GetBotState() BotState

GetBotState returns the current state of the bot service

func (*ServiceManager) IsBasicServicesStarted

func (m *ServiceManager) IsBasicServicesStarted() bool

IsBasicServicesStarted returns true if basic services are started

func (*ServiceManager) IsBotRunning

func (m *ServiceManager) IsBotRunning() bool

IsBotRunning returns true if the bot service is running

func (*ServiceManager) RestartBot

func (m *ServiceManager) RestartBot() error

RestartBot restarts the bot service

func (*ServiceManager) SaveBotConfig

func (m *ServiceManager) SaveBotConfig(cfg interface{}, restart bool) error

SaveBotConfig saves the bot configuration

func (*ServiceManager) Shutdown

func (m *ServiceManager) Shutdown()

Shutdown gracefully shuts down all services

func (*ServiceManager) StartBasicServices

func (m *ServiceManager) StartBasicServices() error

StartBasicServices starts services that should always run This includes HTTP server for Web UI and Desktop UI Returns an error if critical services fail to start

func (*ServiceManager) StartBot

func (m *ServiceManager) StartBot() error

StartBot starts the bot service This is equivalent to starting the gateway

func (*ServiceManager) StopBot

func (m *ServiceManager) StopBot() error

StopBot stops the bot service

func (*ServiceManager) WaitForShutdown

func (m *ServiceManager) WaitForShutdown()

WaitForShutdown waits for a shutdown signal (Ctrl+C)

func (*ServiceManager) WaitForShutdownWithDesktop

func (m *ServiceManager) WaitForShutdownWithDesktop(desktopClosed <-chan struct{})

WaitForShutdownWithDesktop waits for either shutdown signal or desktop UI close

Jump to

Keyboard shortcuts

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