Documentation
¶
Index ¶
- type ModuleGenHandler
- func (h *ModuleGenHandler) Apply(w http.ResponseWriter, r *http.Request)
- func (h *ModuleGenHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *ModuleGenHandler) Download(w http.ResponseWriter, r *http.Request)
- func (h *ModuleGenHandler) Generate(w http.ResponseWriter, r *http.Request)
- func (h *ModuleGenHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *ModuleGenHandler) Unapply(w http.ResponseWriter, r *http.Request)
- type ModuleService
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 ¶
func (h *ModuleGenHandler) Apply(w http.ResponseWriter, r *http.Request)
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 ¶
func (h *ModuleGenHandler) List(w http.ResponseWriter, r *http.Request)
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.