workspace

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package workspace models an editable KBot Studio workspace: a writable work folder overlaid on top of a kbot context (and that context's parent chain).

A workspace is described by a YAML manifest (workspace.yaml) stored in the work folder, which makes it portable and self-describing. The kbot config at ~/.kbot keeps a lightweight recents index pointing at workspaces; the manifest is the source of truth.

Index

Constants

View Source
const (
	ExportHPIv1 = "hpi-v1" // Total Annihilation archives
	ExportHPIv2 = "hpi-v2" // TA: Kingdoms archives
)

Export format identifiers for "Export Mod".

View Source
const ManifestName = "workspace.yaml"

ManifestName is the basename of the workspace manifest within a work folder.

View Source
const WorkspaceLabel = "Workspace"

WorkspaceLabel is the VFS layer label used for the writable overlay.

Variables

This section is empty.

Functions

func ContextSources

func ContextSources(cfg *kbotctx.Config, alias string) ([]filesystem.Source, error)

ContextSources builds the read-only VFS source stack for a context alias and its parent chain (highest priority first), with no writable overlay. Used for opening a context for browsing without a workspace.

func DefaultExportFormat

func DefaultExportFormat(game string) string

DefaultExportFormat returns the natural archive format for a game flavour.

Types

type Export

type Export struct {
	Format string `yaml:"format,omitempty"`
}

Export configures how the workspace is packaged by "Export Mod".

type Manifest

type Manifest struct {
	Name   string `yaml:"name"`
	Base   string `yaml:"base"`
	Game   string `yaml:"game,omitempty"`
	Mod    Mod    `yaml:"mod,omitempty"`
	Export Export `yaml:"export,omitempty"`
	// contains filtered or unexported fields
}

Manifest is the on-disk shape of workspace.yaml.

func Load

func Load(dir string) (*Manifest, error)

Load reads and validates the manifest from a work folder.

func New

func New(dir, name string, base kbotctx.Context, baseAlias string) *Manifest

New builds a manifest for a work folder layered on a base context, filling in the game flavour and export format from the context when not provided.

func (*Manifest) Dir

func (m *Manifest) Dir() string

Dir returns the work folder backing the workspace.

func (*Manifest) ManifestPath

func (m *Manifest) ManifestPath() string

ManifestPath returns the full path to the workspace's manifest file.

func (*Manifest) OpenVFS

func (m *Manifest) OpenVFS(cfg *kbotctx.Config, fsConfig *filesystem.Config) (*filesystem.VirtualFileSystem, error)

OpenVFS resolves the workspace's source stack and opens a writable VFS over it.

func (*Manifest) Ref

func (m *Manifest) Ref() kbotctx.WorkspaceRef

Ref returns the recents-index entry for this workspace.

func (*Manifest) ResolveSources

func (m *Manifest) ResolveSources(cfg *kbotctx.Config) ([]filesystem.Source, error)

ResolveSources builds the ordered VFS source stack for this workspace: the writable work folder on top, then the base context and its parent chain (highest priority first). It fails if the base context (or chain) is invalid.

func (*Manifest) Save

func (m *Manifest) Save() error

Save writes the manifest into its work folder, creating the folder if needed.

type Mod

type Mod struct {
	Title   string `yaml:"title,omitempty"`
	Author  string `yaml:"author,omitempty"`
	Version string `yaml:"version,omitempty"`
}

Mod holds the metadata stamped into an exported mod archive.

Jump to

Keyboard shortcuts

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