workflows

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workflows stages project workflows and plugin skills onto targets.

Workflows are plugin contributions: the bundled ones (Spec Kit, Maestro, Delegated build) come from the binary's own plugins in internal/pluginpkg, installed plugins add more through internal/plugins. The source files are copied to the target only when an operator enables a workflow. The target copy is versioned and immutable: a later enable verifies existing bytes instead of replacing them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SourceDigest

func SourceDigest(files []File) string

func Stage

func Stage(ctx context.Context, ex executor.Executor, id string) (string, string, error)

Stage copies a bundled workflow to a target-local immutable version path.

func StageFiles added in v2.6.0

func StageFiles(ctx context.Context, ex executor.Executor, root string, files []File) error

StageFiles writes files under root on the target, verifying rather than replacing anything already there.

func StageSource added in v2.6.0

func StageSource(ctx context.Context, ex executor.Executor, src Source) (string, string, error)

StageSource copies a workflow or skill to a target-local immutable version path, ~/.lectern/workflows/<id>/<version>-<digest>. It uses only Executor.Run, so SSH targets execute the same checks remotely and bytes never land in the Lectern control-plane filesystem.

func TargetHome added in v2.6.0

func TargetHome(ctx context.Context, ex executor.Executor) (string, error)

TargetHome is the target user's $HOME, checked to be a plain absolute path.

Types

type Definition

type Definition struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Version     string   `json:"version"`
	UpstreamURL string   `json:"upstream_url"`
	Commands    []string `json:"commands"`
	// Kind is "workflow", or "skill" for a plugin skill: a workflow with no
	// commands, enabled the same way.
	Kind string `json:"kind,omitempty"`
	// PluginID is the plugin that contributes it; Entry is the skill
	// directory it becomes in the project.
	PluginID string `json:"plugin_id,omitempty"`
	Entry    string `json:"entry,omitempty"`
	// Bundled marks the binary's own workflows, whose ids and attachment
	// records predate plugins and are kept exactly.
	Bundled bool `json:"bundled,omitempty"`
}

func DefinitionFor

func DefinitionFor(id string) (Definition, bool)

func Definitions

func Definitions() []Definition

Definitions lists the bundled workflows. Installed plugins add theirs through internal/plugins.

type File

type File struct {
	Path []string
	Data []byte
	Mode uint32
}

func Files

func Files(id string) ([]File, error)

type Source added in v2.6.0

type Source struct {
	Definition
	Files []File
}

Source is a workflow with the files it stages.

func FromPlugin added in v2.6.0

func FromPlugin(pkg *pluginpkg.Package) ([]Source, error)

FromPlugin lists a plugin's workflows and skills as sources. A bundled plugin's workflows keep their bare ids (spec-kit, maestro, delegate) so existing project attachments still match; any other plugin's are namespaced "<plugin id>:<id>".

Jump to

Keyboard shortcuts

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