server

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentHealthMonitor added in v0.30.0

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

AgentHealthMonitor periodically marks stale agents as offline.

func NewAgentHealthMonitor added in v0.30.0

func NewAgentHealthMonitor(database *db.DB) *AgentHealthMonitor

func (*AgentHealthMonitor) Run added in v0.30.0

func (m *AgentHealthMonitor) Run(ctx context.Context)

Run blocks until ctx is cancelled.

type IMInboundMessage added in v0.40.0

type IMInboundMessage struct {
	ChatJID    string `json:"chat_jid"`
	SenderName string `json:"sender_name"`
	Content    string `json:"content"`
	Provider   string `json:"provider"`
	ChannelID  string `json:"channel_id"`
}

IMInboundMessage represents an inbound message from an IM channel.

type ResourceDefaults added in v0.7.0

type ResourceDefaults struct {
	MaxWorkspacesPerUser     int
	MaxSandboxesPerWorkspace int
	MaxWorkspaceDriveSize    int64 // bytes
	MaxSandboxCPU            int   // millicores
	MaxSandboxMemory         int64 // bytes
	MaxIdleTimeout           int   // seconds
	WsMaxTotalCPU            int   // millicores
	WsMaxTotalMemory         int64 // bytes
	WsMaxIdleTimeout         int   // seconds
}

ResourceDefaults holds all resolved system-wide defaults.

type Server

type Server struct {
	Auth                      *auth.Auth
	OIDC                      *auth.OIDCManager
	DB                        *db.DB
	Sandboxes                 *sbxstore.Store
	ProcessManager            process.Manager
	DriveManager              storage.DriveManager
	NamespaceManager          *namespace.Manager
	TunnelRegistry            *tunnel.Registry
	StaticFS                  fs.FS
	BaseDomains               []string // e.g. ["agentserver.dev", "agent.cs.ac.cn"] (first is primary)
	OpencodeSubdomainPrefix   string   // e.g. "code" — subdomain: code-{id}.{baseDomain}
	OpenclawSubdomainPrefix   string   // e.g. "claw" — subdomain: claw-{id}.{baseDomain}
	ClaudeCodeSubdomainPrefix string   // e.g. "claude" — subdomain: claude-{id}.{baseDomain}
	PasswordAuthEnabled       bool     // when false, /api/auth/login and /api/auth/register are not registered
	LLMProxyURL               string   // base URL for the llmproxy service (e.g. "http://agentserver-llmproxy:8081")

	// IMBridgeURL is the base URL of the standalone imbridge service
	// (e.g. "http://agentserver-imbridge:8083"). When set, IM API routes
	// are reverse-proxied to the imbridge service.
	IMBridgeURL string

	// ModelServer OAuth
	ModelserverOAuthClientID      string
	ModelserverOAuthClientSecret  string
	ModelserverOAuthAuthURL       string
	ModelserverOAuthTokenURL      string
	ModelserverOAuthIntrospectURL string
	ModelserverOAuthRedirectURI   string
	ModelserverProxyURL           string
	DatabaseURL                   string // PostgreSQL connection URL (needed for Matrix E2EE crypto DB)

	// Hydra OAuth2 (for agent Device Flow)
	HydraClient    *auth.HydraClient
	HydraPublicURL string // internal URL for reverse proxy (e.g. "http://hydra-public:4444")

	// BridgeHandler provides CCR V2-compatible bridge API for agent sessions.
	BridgeHandler *bridge.Handler

	// CCBrokerURL is the base URL of the cc-broker service for stateless
	// Claude Code sessions (e.g. "http://cc-broker:8090").
	CCBrokerURL string

	// Credential proxy
	EncryptionKey      []byte // AES-256 key for credential_bindings auth_blob
	CredproxyPublicURL string // URL sandboxes use to reach credentialproxy
	// contains filtered or unexported fields
}

func New

func New(a *auth.Auth, oidcMgr *auth.OIDCManager, database *db.DB, sandboxStore *sbxstore.Store, processManager process.Manager, driveManager storage.DriveManager, nsMgr *namespace.Manager, tunnelReg *tunnel.Registry, staticFS fs.FS, passwordAuthEnabled bool) *Server

func (*Server) GetEffectiveIdleTimeout added in v0.7.0

func (s *Server) GetEffectiveIdleTimeout() time.Duration

GetEffectiveIdleTimeout is the exported version for use by cmd/serve.go.

func (*Server) Router

func (s *Server) Router() http.Handler

type WorkspaceDefaults added in v0.9.0

type WorkspaceDefaults struct {
	MaxSandboxes     int
	MaxSandboxCPU    int   // millicores
	MaxSandboxMemory int64 // bytes
	MaxIdleTimeout   int   // seconds
	MaxTotalCPU      int   // millicores
	MaxTotalMemory   int64 // bytes
	MaxDriveSize     int64 // bytes
}

WorkspaceDefaults holds workspace-level resolved defaults (system defaults <- workspace_quotas override).

Jump to

Keyboard shortcuts

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