scaffold

package
v0.0.1-dev.35 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 22 Imported by: 1 module, 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 scaffold writes Holon apps: an MCP server and the view it serves, in Go, Python or TypeScript, into a new directory or beside an existing project in that language.

Index

Constants

This section is empty.

Variables

Languages are the languages an app can be written in, by their --lang names.

Functions

func AppName

func AppName(dir string) string

AppName is the name of the app in dir: the directory's name as a label.

func Detect

func Detect(dir string) (languages []string, existing bool, err error)

Detect reports whether dir holds a project, and the languages an app there can be written in: any into an empty or absent directory, and otherwise the languages whose manifests dir has.

func Relative

func Relative(path string) string

Relative is path relative to the working directory when that is shorter to read.

Types

type Project

type Project struct {
	Dir, Language, Name string
	Versions            Versions
}

Project is an app in Dir, whose MCP server is named Name.

func (Project) Check

func (p Project) Check() error

Check reports why the app cannot be written: in an existing project, a file the app adds that is already there, another server entry, or a project Holon would not run the server of.

func (Project) PythonRequirements

func (p Project) PythonRequirements() (dependencies, dev []string)

PythonRequirements are the Python requirements the app needs: dependencies, which a project declares directly, and development ones, which it only needs installed.

func (Project) Write

func (p Project) Write() (created, changed, notes []string, err error)

Write writes the app after Check accepts it, and returns the files it created and those it changed. An existing project keeps its manifest, tsconfig.json and scripts, gains the npm packages the app needs in its package.json and the app's lines in its .gitignore; notes say what the project may still need.

type Versions

type Versions struct {
	HolonSH    string // holon-sh on npm, for a TypeScript server
	HolonUI    string // holon-ui on npm, for the view
	HolonPy    string // holon-sh on PyPI, for a Python server
	HolonTypes string
}

Versions are the Holon SDK versions an app pins.

func Resolve

func Resolve(ctx context.Context, language, cliVersion string) (Versions, error)

Resolve picks the newest SDK releases a new app in language pins, from npm's registry, or the one npm_config_registry names, and PyPI.

Jump to

Keyboard shortcuts

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