launch

package
v0.0.0-...-69bd20d Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 17 Imported by: 0

README

Native Bee launch

Component returns the native executable host and boot component. Before a non-explicit launch opens state, it selects:

<Bee config directory>/bee/projects/<sha256(canonical working directory)>

An explicit --state is preserved unchanged. Planning does not create directories, write receipts, inspect databases or acquire locks.

The runtime owns state opening, locking, deployment history, migrations, process ownership and application lifecycle. The native host provides the selected default state and a read-only environment store with home, cwd, self and safe PATH executable lookup.

Environment values are nonsecret and absolute. Executable lookup accepts only a bare name and returns an absolute PATH result. Writes, deletes, path names and traversal are refused.

Run the native package tests with:

make -C native test

Documentation

Overview

Package launch contains Bee's small native host boundary. The runtime owns state opening, locking, deployment and application lifecycle; this package only chooses the default state directory before those operations begin.

Index

Constants

View Source
const (
	ComponentName boot.Name = "bee.launch"
	StorageID               = "bee.harness.host:environment"
)

Variables

This section is empty.

Functions

func DefaultProjectStateDir

func DefaultProjectStateDir(root, directory string) (string, error)

DefaultProjectStateDir selects the state for a non-explicit launch. The hashed directory is the normal choice. A valid receipt from an older Bee version binds its matching project to the old root for compatibility; a valid receipt for another project and an absent receipt both select the hashed directory.

Planning is deliberately read-only. In particular, this function does not create a receipt, inspect databases, acquire a lock, or open runtime state.

func ProjectStateDir

func ProjectStateDir(root, directory string) (string, error)

ProjectStateDir returns the state directory for one canonical project. It does not inspect or create the root; callers can use it during planning.

Types

type Host

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

Host is both Bee's app.Host and its sole native boot component. The runtime calls Plan before it opens state, while Load registers the one read-only host environment storage needed by native integrations.

func Component

func Component() *Host

Component is the native factory named by wippy.build.json. The returned value is also passed to the runtime as app.Host; no second host component is needed for environment registration.

func New

func New(defaultRoot string) (*Host, error)

New creates the launch host for a known default Bee state root. It does not inspect or create the root.

func (*Host) DependsOn

func (host *Host) DependsOn() []string

func (*Host) Load

func (host *Host) Load(ctx context.Context) (context.Context, error)

func (*Host) Name

func (host *Host) Name() string

func (*Host) Plan

func (host *Host) Plan(ctx context.Context, launch app.Launch) (app.Plan, error)

Plan selects a project-specific default before the runtime opens state. Explicit --state remains entirely under the caller's control.

Jump to

Keyboard shortcuts

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