serverapi

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHealthRoutes added in v0.6.6

func AddHealthRoutes(mux *http.ServeMux)

AddHealthRoutes registers GET /health for liveness checks.

func AddVersionRoutes added in v0.6.6

func AddVersionRoutes(mux *http.ServeMux, version, nodeInstanceID, tenancy string)

AddVersionRoutes registers GET /version with JSON from apiframework.AboutServer. Handlers live here (not inside New) so tools/openapi-gen can discover the route via Add*Routes.

func LoadConfig

func LoadConfig[T any](cfg *T) error

func New

func New(
	ctx context.Context,
	mux *http.ServeMux,
	nodeInstanceID string,
	tenancy string,
	config *Config,
	dbInstance libdb.DBManager,
	pubsub libbus.Messenger,
	repo llmrepo.ModelRepo,
	environmentExec taskengine.EnvExecutor,
	state *runtimestate.State,
	hookRegistry taskengine.HookProvider,
	hookRepo taskengine.HookRepo,
	taskService execservice.TasksEnvService,
	embedService embedservice.Service,
	execService execservice.ExecService,
	taskChainService taskchainservice.Service,
	vfsSvc vfsservice.Service,
	auth middleware.AuthZReader,
	vfsRoot string,

) (func() error, error)

Types

type Config

type Config struct {
	DatabaseURL             string `json:"database_url"`
	Port                    string `json:"port"`
	Addr                    string `json:"addr"`
	NATSURL                 string `json:"nats_url"`
	NATSUser                string `json:"nats_user"`
	NATSPassword            string `json:"nats_password"`
	TokenizerServiceURL     string `json:"tokenizer_service_url"`
	EmbedModel              string `json:"embed_model"`
	EmbedProvider           string `json:"embed_provider"`
	EmbedModelContextLength string `json:"embed_model_context_length"`
	TaskModel               string `json:"task_model"`
	TaskProvider            string `json:"task_provider"`
	TaskModelContextLength  string `json:"task_model_context_length"`
	ChatModel               string `json:"chat_model"`
	ChatProvider            string `json:"chat_provider"`
	ChatModelContextLength  string `json:"chat_model_context_length"`
	VectorStoreURL          string `json:"vector_store_url"`
	Token                   string `json:"token"`
	UIBaseURL               string `json:"ui_base_url"`
	ValkeyAddr              string `json:"valkey_addr"`
	ValkeyPassword          string `json:"valkey_password"`
	// Interactive PTY terminal (Beam / UI). See terminalservice.ParseEnv.
	TerminalEnabled string `json:"terminal_enabled"`
	// Filesystem ceiling for terminal cwd. Beam CLI defaults to the project root (parent of .contenox) when terminal_enabled=true and this is unset.
	TerminalAllowedRoot string `json:"terminal_allowed_root"`
	TerminalMaxSessions string `json:"terminal_max_sessions"`
	TerminalShell       string `json:"terminal_shell"`
}

Jump to

Keyboard shortcuts

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