service

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodexModeAdapter   = "adapter"
	CodexModeAppServer = "app_server"
)

Variables

View Source
var ErrServiceNotConfigured = fmt.Errorf("acp service is not configured")

Functions

func DecodeStoredServiceConfig

func DecodeStoredServiceConfig(data []byte) (any, error)

func ValidateCWDAllowed

func ValidateCWDAllowed(cwd string, roots []string) error

Types

type CodexConfig

type CodexConfig struct {
	Mode             string   `json:"mode,omitempty"`
	AdapterCommand   string   `json:"adapter_command,omitempty"`
	AdapterArgs      []string `json:"adapter_args,omitempty"`
	AppServerCommand string   `json:"app_server_command,omitempty"`
	AppServerArgs    []string `json:"app_server_args,omitempty"`
	DefaultProfile   string   `json:"default_profile,omitempty"`
	InitialAuthMode  string   `json:"initial_auth_mode,omitempty"`
	TraceJSON        bool     `json:"trace_json,omitempty"`
	RetryTurnOnCrash bool     `json:"retry_turn_on_crash,omitempty"`
}

type Manager

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

func NewManager

func NewManager(store configstore.ConfigStore) *Manager

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, cfg ServiceConfig) error

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context, id string) error

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, id string) (ServiceConfig, error)

func (*Manager) List

func (m *Manager) List(ctx context.Context) ([]ServiceConfig, error)

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, id string, cfg ServiceConfig) error

type ServiceConfig

type ServiceConfig struct {
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	AgentType       string            `json:"agent_type"`
	CWD             string            `json:"cwd"`
	AllowedRoots    []string          `json:"allowed_roots,omitempty"`
	DefaultModel    string            `json:"default_model,omitempty"`
	Env             map[string]string `json:"env,omitempty"`
	ConfigOverrides map[string]string `json:"config_overrides,omitempty"`
	IdleTTL         time.Duration     `json:"idle_ttl,omitempty"`
	MaxInstances    int               `json:"max_instances,omitempty"`
	PermissionMode  string            `json:"permission_mode,omitempty"`
	Disabled        bool              `json:"disabled"`
	Description     string            `json:"description,omitempty"`
	CreatedAt       time.Time         `json:"created_at"`
	UpdatedAt       time.Time         `json:"updated_at"`
	Codex           *CodexConfig      `json:"codex,omitempty"`
}

func (*ServiceConfig) Normalize

func (c *ServiceConfig) Normalize()

func (*ServiceConfig) NormalizeTimestamps

func (c *ServiceConfig) NormalizeTimestamps(now time.Time)

func (ServiceConfig) Validate

func (c ServiceConfig) Validate() error

Jump to

Keyboard shortcuts

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