api

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 10 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleGenHandler

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

ModuleGenHandler serves the AI module generator surface: generate, apply, unapply, list, download, and delete.

func NewModuleGenHandler

func NewModuleGenHandler(service ModuleService, logger kernel.Logger, applyTimeout time.Duration) *ModuleGenHandler

NewModuleGenHandler builds the module generator handler. A non-positive applyTimeout selects the default server-side apply budget.

func (*ModuleGenHandler) Apply

List returns the installed module projects. Apply stages an installed module project into the source checkout: tree, registries, regenerated custom edition, and verification. The handler serializes applies server-wide and bounds the whole call; the applier's own verification deadline applies inside.

func (*ModuleGenHandler) Delete

func (h *ModuleGenHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes an installed project. The response reports whether the module stays applied in the checkout: staged and applied have independent lifecycles, so deleting the former must warn about the latter.

func (*ModuleGenHandler) Download

func (h *ModuleGenHandler) Download(w http.ResponseWriter, r *http.Request)

Download streams the project zip.

func (*ModuleGenHandler) Generate

func (h *ModuleGenHandler) Generate(w http.ResponseWriter, r *http.Request)

Generate creates a module project from a natural-language brief, validates it, and installs it as an inert source project.

func (*ModuleGenHandler) List

List returns the installed module projects.

func (*ModuleGenHandler) Unapply

func (h *ModuleGenHandler) Unapply(w http.ResponseWriter, r *http.Request)

Unapply removes an applied module from the source checkout: registry, custom edition, and tree. Without explicit confirmation the call is refused before touching anything.

type ModuleService

type ModuleService interface {
	Generate(ctx context.Context, brief modgendomain.Brief) (modgendomain.Project, modgendomain.ValidationReport, error)
	Apply(ctx context.Context, name string, replace, confirm bool) (modgendomain.Project, modgendomain.ApplyResult, error)
	Unapply(ctx context.Context, name string, confirm bool) (modgendomain.UnapplyResult, error)
	List(ctx context.Context) ([]modgendomain.InstalledProject, error)
	Get(ctx context.Context, name string) (modgendomain.Project, error)
	Delete(ctx context.Context, name string) (bool, error)
	Zip(ctx context.Context, name string) ([]byte, error)
}

ModuleService is the generation orchestration seam the handler drives. It mirrors the domain Service's persistence-facing methods so mocks stay narrow.

Jump to

Keyboard shortcuts

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