codeapp

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FloeAppCode is the floe_app id used for code-server sessions.
	FloeAppCode = "com.floegence.redeven.code"
)

Variables

This section is empty.

Functions

func IsValidCodeSpaceID

func IsValidCodeSpaceID(id string) bool

IsValidCodeSpaceID enforces a DNS-safe label: - allowed: [a-z0-9-] - length: 1..48 - no leading/trailing '-'

It intentionally matches the control-plane validation to avoid subtle routing bugs.

func ValidateControlplaneBaseURL added in v0.6.8

func ValidateControlplaneBaseURL(raw string) error

Types

type Options

type Options struct {
	Logger    *slog.Logger
	StateDir  string
	StateRoot string
	// ConfigPath is the absolute path to the runtime config file (used to persist settings updates from the Env App UI).
	ConfigPath             string
	PermissionPolicy       *config.PermissionPolicy
	ControlplaneBaseURL    string
	ReDevPluginRuntimePath string
	RedevenVersion         string

	// CodeServerPortMin/Max configures the dynamic port range used for code-server processes.
	// If unset/invalid, a safe default range is used.
	CodeServerPortMin int
	CodeServerPortMax int

	// Env/App-level context (used by AI tools).
	AgentHomeDir    string
	FilesystemScope *filesystemscope.Registry
	Shell           string

	AIConfig            *config.AIConfig
	AIWorkloadAdmission ai.WorkloadAdmission
	Audit               *auditlog.Store
	Diagnostics         *diagnostics.Store
	Terminal            *terminal.Manager
	// LocalUIEnabled enables Local UI-specific runtime behavior such as shorter
	// code-server reconnection grace and local app-server routing.
	LocalUIEnabled           bool
	ResolveSessionMeta       func(channelID string) (*session.Meta, bool)
	ResolveSessionTunnelURL  func(channelID string) (string, bool)
	ResolvePluginSessionMeta func(channelID string) (*session.Meta, bool)
	AcquirePluginSession     func(channelID string) (*session.Meta, func(), bool)
	EndPluginSession         func(channelID string)
	PluginRuntimeAuthority   *redevpluginintegration.RuntimeProcessAuthority
	// contains filtered or unexported fields
}

type Service

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

func New

func New(ctx context.Context, opts Options) (*Service, error)

func (*Service) AIReadiness added in v0.11.0

func (s *Service) AIReadiness() appserver.AIReadinessSnapshot

func (*Service) AcquireAIService added in v0.11.0

func (s *Service) AcquireAIService(ctx context.Context) (*ai.Service, context.Context, uint64, func(), error)

func (*Service) AppServer added in v0.7.1

func (s *Service) AppServer() *appserver.Server

func (*Service) AppServerURL added in v0.7.1

func (s *Service) AppServerURL() string

func (*Service) AppendCodeRuntimeSetupChunk added in v0.10.0

func (s *Service) AppendCodeRuntimeSetupChunk(ctx context.Context, operationID string, chunkIndex int64, body io.Reader) (appserver.CodeRuntimeSetupChunkResult, error)

func (*Service) BindPluginSessionGeneration added in v0.11.0

func (s *Service) BindPluginSessionGeneration(ctx context.Context, meta *session.Meta, processGeneration, sessionGeneration string) error

func (*Service) CancelCodeRuntimeOperation

func (s *Service) CancelCodeRuntimeOperation(ctx context.Context) (appserver.CodeRuntimeStatus, error)

func (*Service) CancelCodeRuntimeSetupOperation added in v0.10.0

func (s *Service) CancelCodeRuntimeSetupOperation(ctx context.Context, operationID string) (appserver.CodeRuntimeStatus, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) CodeRuntimeStatus

func (s *Service) CodeRuntimeStatus(ctx context.Context) (appserver.CodeRuntimeStatus, error)

func (*Service) CompleteCodeRuntimeSetupOperation added in v0.10.0

func (s *Service) CompleteCodeRuntimeSetupOperation(ctx context.Context, operationID string) (appserver.CodeRuntimeStatus, error)

func (*Service) CreateCodeRuntimeSetupOperation added in v0.10.0

func (s *Service) CreateCodeRuntimeSetupOperation(
	ctx context.Context,
	operationID string,
	installMethod codeserver.BrowserEditorInstallMethod,
	manifest *appserver.CodeRuntimeArtifactManifest,
) (appserver.CodeRuntimeSetupOperation, error)

func (*Service) CreateSpace

func (*Service) DeleteSpace

func (s *Service) DeleteSpace(ctx context.Context, codeSpaceID string) error

func (*Service) ExternalOriginForCodeSpace

func (s *Service) ExternalOriginForCodeSpace(codeSpaceID string) (string, error)

func (*Service) ExternalOriginForEnvApp

func (s *Service) ExternalOriginForEnvApp(envPublicID string) (string, error)

func (*Service) ExternalOriginForPortForward

func (s *Service) ExternalOriginForPortForward(forwardID string) (string, error)

func (*Service) ListSpaces

func (s *Service) ListSpaces(ctx context.Context) ([]appserver.SpaceStatus, error)

func (*Service) MaintainTerminalPluginSession added in v0.11.0

func (s *Service) MaintainTerminalPluginSession(ctx context.Context, meta *session.Meta, processGeneration, sessionGeneration string) error

func (*Service) RecordPluginSessionTerminalIntent added in v0.11.0

func (s *Service) RecordPluginSessionTerminalIntent(ctx context.Context, meta *session.Meta, processGeneration, sessionGeneration string) error

func (*Service) RemoveCodeRuntimeVersion

func (s *Service) RemoveCodeRuntimeVersion(ctx context.Context, version string) (appserver.CodeRuntimeStatus, error)

func (*Service) ResolveCodeServerPort

func (s *Service) ResolveCodeServerPort(ctx context.Context, codeSpaceID string) (int, error)

func (*Service) SelectCodeRuntimeVersion

func (s *Service) SelectCodeRuntimeVersion(ctx context.Context, version string) (appserver.CodeRuntimeStatus, error)

func (*Service) SetControlplaneBaseURL added in v0.6.8

func (s *Service) SetControlplaneBaseURL(raw string) error

func (*Service) StartSpace

func (s *Service) StartSpace(ctx context.Context, codeSpaceID string) (*appserver.SpaceStatus, error)

func (*Service) StopSpace

func (s *Service) StopSpace(ctx context.Context, codeSpaceID string) error

func (*Service) UpdateSpace

func (s *Service) UpdateSpace(ctx context.Context, codeSpaceID string, req appserver.UpdateSpaceRequest) (*appserver.SpaceStatus, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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