runtimebuild

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionLogger

func NewSessionLogger(base *zap.Logger, sessionID string, folderPath string, factoryDir string) *zap.Logger

NewSessionLogger annotates runtime logs with session and directory metadata.

func SessionScopedRecordPath

func SessionScopedRecordPath(basePath string, sessionID string) string

SessionScopedRecordPath substitutes per-session recording tokens in record paths.

func WarnPortableBundledReplacementReport

func WarnPortableBundledReplacementReport(
	logger *zap.Logger,
	message string,
	replacements []factoryconfig.PortableBundledFileReplacement,
)

WarnPortableBundledReplacementReport logs portable bundled file replacement targets.

Types

type BuildInput

type BuildInput struct {
	Dir                   string
	FolderPath            string
	SessionID             string
	LoadedFactoryCfg      *factoryconfig.LoadedFactoryConfig
	BaseLogger            *zap.Logger
	RuntimeInstanceID     string
	Clock                 factory.Clock
	RecordPath            string
	WorkflowID            string
	ProviderOverride      workers.Provider
	ProviderCommandRunner workers.CommandRunner
	CommandRunnerOverride workers.CommandRunner
	AdditionalFactoryOpts []factory.FactoryOption
}

BuildInput is the canonical input for constructing one runnable runtime bundle.

type BundleBuilder

type BundleBuilder func(ctx context.Context, input BuildInput) (any, error)

BundleBuilder constructs a runnable runtime bundle from canonical build input.

type Config

type Config struct {
	ExecutionBaseDir                        string
	RunnerID                                string
	RuntimeMode                             interfaces.RuntimeMode
	Verbose                                 bool
	RuntimeInstanceID                       string
	RuntimeLogDir                           string
	RuntimeLogConfig                        logging.RuntimeLogConfig
	RecordPath                              string
	WorkflowID                              string
	MockWorkersConfig                       *factoryconfig.MockWorkersConfig
	RecordFlushInterval                     time.Duration
	ModelCacheDir                           string
	SkipBuiltInRunnerPrerequisiteValidation bool
	WorkstationLoader                       factoryconfig.WorkstationLoader
	ProviderOverride                        workers.Provider
	ProviderCommandRunnerOverride           workers.CommandRunner
	CommandRunnerOverride                   workers.CommandRunner
	LocalModelRuntimeOverride               localmodels.Runtime
	ExtraOptions                            []factory.FactoryOption
}

Config carries service-level settings required to build runnable runtimes.

type Service

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

Service owns the single runtime build path for session open and post-save activation.

func New

func New(cfg Config, clock factory.Clock, baseLogger *zap.Logger, build BundleBuilder) *Service

New constructs a runtime-build collaborator with explicit dependencies.

func (*Service) BuildFromLoadedConfig

func (s *Service) BuildFromLoadedConfig(ctx context.Context, input BuildInput) (any, error)

BuildFromLoadedConfig builds a runtime bundle from an already-loaded factory config. Startup and replacement flows both use this entry point.

func (*Service) BuildReplacement

func (s *Service) BuildReplacement(
	ctx context.Context,
	folderPath string,
	factoryDir string,
	sessionID string,
) (any, error)

BuildReplacement loads runtime config from factoryDir and builds a replacement bundle. Session open, named activation, and post-save activation all route through this path.

Jump to

Keyboard shortcuts

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