launchconfig

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package launchconfig loads Clank's project-specific web preview launch files.

Index

Constants

View Source
const (
	// ProjectRelativePath is the repository-owned launch configuration path.
	ProjectRelativePath = ".clank/launch.yaml"
	// PortEnvironmentName is the allocated-port contract for every command.
	PortEnvironmentName = "PORT"
	// PublicHostnameEnvironmentName is the hostname clients use to reach a preview.
	PublicHostnameEnvironmentName = "CLANK_PREVIEW_PUBLIC_HOSTNAME"
)

Variables

This section is empty.

Functions

func LaunchSchema

func LaunchSchema() string

LaunchSchema returns the canonical structural schema shown to setup agents.

func RenderEnvironment

func RenderEnvironment(environment map[string]string, port int, publicHostname string) (map[string]string, error)

RenderEnvironment resolves Clank placeholders in configured environment values.

func SetupTaskPrompt

func SetupTaskPrompt(paths Paths) (string, error)

SetupTaskPrompt builds the bounded, non-interactive agent task.

Types

type File

type File struct {
	Default  string             `yaml:"default"`
	Previews map[string]Preview `yaml:"previews"`
}

File is the strict YAML launch schema.

type NotFoundError

type NotFoundError struct {
	Paths Paths
}

NotFoundError carries the paths offered by one-time setup.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type Paths

type Paths struct {
	ProjectRoot string
	Project     string
}

Paths contains the project identity and launch configuration location.

func ResolvePaths

func ResolvePaths(workDir string) (Paths, error)

ResolvePaths finds the project root and derives its launch file.

type Preview

type Preview struct {
	Directory   string            `yaml:"directory"`
	Command     string            `yaml:"command"`
	Environment map[string]string `yaml:"env"`
	Ready       Ready             `yaml:"ready"`
}

Preview declares one named web development server.

type Ready

type Ready struct {
	Path              string `yaml:"path"`
	ExpectedSubstring string `yaml:"expect"`
}

Ready declares the HTTP response that marks a server ready.

type Resolved

type Resolved struct {
	Name        string
	WorkDir     string
	Command     string
	Environment map[string]string
	Ready       Ready
	Source      Source
}

Resolved is one validated launch entry with an absolute working directory.

func FinalizeSetup

func FinalizeSetup(workDir string) (*Resolved, error)

FinalizeSetup validates the generated project configuration in place.

func Resolve

func Resolve(workDir, name string) (*Resolved, error)

Resolve loads, validates, and selects a launch entry for workDir.

type Source

type Source struct {
	Path string
}

Source identifies the selected project configuration file.

Jump to

Keyboard shortcuts

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