handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateExecution

func CreateExecution(r *runner.Runner) gin.HandlerFunc

CreateExecution handles POST /v1/executions. It parses the request body, invokes the runner synchronously, and returns the full RunResult JSON. The "skill" field is required; "version" defaults to "latest" if omitted.

func DeleteSkill

func DeleteSkill(reg *registry.Registry, s *store.Store) gin.HandlerFunc

DeleteSkill handles DELETE /v1/skills/:name/:version. It removes the skill from both the registry and the metadata store, then returns 204 No Content.

func GetExecution

func GetExecution(s *store.Store) gin.HandlerFunc

GetExecution handles GET /v1/executions/:id. It retrieves an execution record from the store and enforces tenant isolation: the caller's tenant must match the execution's tenant.

func GetExecutionLogs

func GetExecutionLogs(s *store.Store) gin.HandlerFunc

GetExecutionLogs handles GET /v1/executions/:id/logs. It returns just the logs field as plain text.

func GetSkill

func GetSkill(reg *registry.Registry) gin.HandlerFunc

GetSkill handles GET /v1/skills/:name/:version. It downloads the skill zip from the registry, parses SKILL.md, and returns the full metadata including the SKILL.md body content (instructions).

func Health

func Health(s *store.Store) gin.HandlerFunc

Health returns a liveness handler that always responds 200 OK if the process is running. Load balancers and orchestrators use this to determine whether to route traffic to the instance.

func ListSkills

func ListSkills(s *store.Store, reg *registry.Registry) gin.HandlerFunc

ListSkills handles GET /v1/skills. It returns all skill metadata for the authenticated tenant, including descriptions so agents can decide which skill to use.

func Ready

func Ready(s *store.Store) gin.HandlerFunc

Ready returns a readiness handler that checks all downstream dependencies (Postgres, etc.) and reports whether the instance can serve requests. Orchestrators use this to decide when to add the instance to the load balancer pool.

func UploadSkill

func UploadSkill(reg *registry.Registry, s *store.Store, cfg *config.Config) gin.HandlerFunc

UploadSkill handles POST /v1/skills.

It accepts skill zip data via two content types:

  • application/zip: raw zip body
  • multipart/form-data: zip in a "file" form field

The zip is validated (must contain SKILL.md with valid frontmatter), then uploaded to the registry. Skill metadata is also persisted in PostgreSQL so that list operations can return descriptions without downloading every zip archive. Returns 201 with skill metadata on success.

Types

This section is empty.

Jump to

Keyboard shortcuts

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