Documentation
¶
Index ¶
- type PluginGenHandler
- func (h *PluginGenHandler) Build(w http.ResponseWriter, r *http.Request)
- func (h *PluginGenHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *PluginGenHandler) Download(w http.ResponseWriter, r *http.Request)
- func (h *PluginGenHandler) Generate(w http.ResponseWriter, r *http.Request)
- func (h *PluginGenHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *PluginGenHandler) Status(w http.ResponseWriter, r *http.Request)
- type PluginService
- type PluginStatus
- type PluginStatusReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginGenHandler ¶
type PluginGenHandler struct {
// contains filtered or unexported fields
}
PluginGenHandler serves the AI plugin generator surface: generate, list, download, delete, and status.
func NewPluginGenHandler ¶
func NewPluginGenHandler(service PluginService, status PluginStatusReader, logger kernel.Logger, buildTimeout time.Duration) *PluginGenHandler
NewPluginGenHandler builds the plugin generator handler. A non-positive buildTimeout selects the default server-side build budget.
func (*PluginGenHandler) Build ¶
func (h *PluginGenHandler) Build(w http.ResponseWriter, r *http.Request)
Build compiles an installed project to WASM and installs the .wasm plus the synthesized manifest into plugins/. In DEV_MODE the watcher hot-reloads it; otherwise the response asks for a restart.
func (*PluginGenHandler) Delete ¶
func (h *PluginGenHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete removes an installed project.
func (*PluginGenHandler) Download ¶
func (h *PluginGenHandler) Download(w http.ResponseWriter, r *http.Request)
Download streams the project zip.
func (*PluginGenHandler) Generate ¶
func (h *PluginGenHandler) Generate(w http.ResponseWriter, r *http.Request)
Generate creates a plugin project from a natural-language brief, validates it, and installs it as a source project.
func (*PluginGenHandler) List ¶
func (h *PluginGenHandler) List(w http.ResponseWriter, r *http.Request)
List returns the installed plugin projects.
func (*PluginGenHandler) Status ¶
func (h *PluginGenHandler) Status(w http.ResponseWriter, r *http.Request)
Status returns loaded-plugin inspection: the .wasm files the host sees.
type PluginService ¶
type PluginService interface {
Generate(ctx context.Context, brief plugingendomain.Brief) (plugingendomain.Project, plugingendomain.ValidationReport, error)
Build(ctx context.Context, name string) (plugingendomain.BuildResult, error)
List(ctx context.Context) ([]plugingendomain.InstalledProject, error)
Get(ctx context.Context, name string) (plugingendomain.Project, error)
Delete(ctx context.Context, name string) error
Zip(ctx context.Context, name string) ([]byte, error)
}
PluginService is the generation orchestration seam the handler drives. It mirrors the domain Service's persistence-facing methods so mocks stay narrow.
type PluginStatus ¶
type PluginStatus struct {
Name string `json:"name"`
Status string `json:"status"`
Hooks []string `json:"hooks"`
}
PluginStatus is one loaded plugin for the status projection.
type PluginStatusReader ¶
type PluginStatusReader interface {
LoadedPlugins(ctx context.Context) []PluginStatus
}
PluginStatusReader exposes loaded-plugin inspection for the read-only status endpoint. It is satisfied by the edition over the plugin system.