handler

package
v0.0.0-...-5b191e2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SandboxRoot           = "/"
	SandboxHome           = "/home"
	SandboxSkillsDir      = "/agents/skills"
	SandboxProjectdataDir = "/home/project"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BashHandler

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

func NewBashHandler

func NewBashHandler(mgr *session.Manager, udMgr *userdata.Manager, pdMgr *projectdata.Manager, exec executor.CommandExecutor) *BashHandler

func (*BashHandler) CloseSession

func (h *BashHandler) CloseSession(c *gin.Context)

func (*BashHandler) CreateSession

func (h *BashHandler) CreateSession(c *gin.Context)

func (*BashHandler) Exec

func (h *BashHandler) Exec(c *gin.Context)

func (*BashHandler) Kill

func (h *BashHandler) Kill(c *gin.Context)

func (*BashHandler) ListSessions

func (h *BashHandler) ListSessions(c *gin.Context)

func (*BashHandler) Output

func (h *BashHandler) Output(c *gin.Context)

func (*BashHandler) Write

func (h *BashHandler) Write(c *gin.Context)

type CodeHandler

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

func NewCodeHandler

func NewCodeHandler(mgr *session.Manager, udMgr *userdata.Manager, pdMgr *projectdata.Manager, exec executor.CommandExecutor) *CodeHandler

func (*CodeHandler) Execute

func (h *CodeHandler) Execute(c *gin.Context)

func (*CodeHandler) Info

func (h *CodeHandler) Info(c *gin.Context)

type FileHandler

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

func NewFileHandler

func NewFileHandler(mgr *session.Manager, udMgr *userdata.Manager, pdMgr *projectdata.Manager, fileOp executor.FileOperator) *FileHandler

func (*FileHandler) Download

func (h *FileHandler) Download(c *gin.Context)

func (*FileHandler) Find

func (h *FileHandler) Find(c *gin.Context)

func (*FileHandler) Glob

func (h *FileHandler) Glob(c *gin.Context)

func (*FileHandler) Grep

func (h *FileHandler) Grep(c *gin.Context)

func (*FileHandler) List

func (h *FileHandler) List(c *gin.Context)

func (*FileHandler) Read

func (h *FileHandler) Read(c *gin.Context)

func (*FileHandler) Replace

func (h *FileHandler) Replace(c *gin.Context)

func (*FileHandler) Search

func (h *FileHandler) Search(c *gin.Context)

func (*FileHandler) Upload

func (h *FileHandler) Upload(c *gin.Context)

func (*FileHandler) Write

func (h *FileHandler) Write(c *gin.Context)

type RegistryHandler

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

RegistryHandler handles skill registry API endpoints.

func NewRegistryHandler

func NewRegistryHandler(mgr *session.Manager, udMgr *userdata.Manager, pdMgr *projectdata.Manager) *RegistryHandler

NewRegistryHandler creates a new RegistryHandler.

func (*RegistryHandler) Activate

func (h *RegistryHandler) Activate(c *gin.Context)

Activate deploys a specific version to /data/skills/.

func (*RegistryHandler) Commit

func (h *RegistryHandler) Commit(c *gin.Context)

Commit captures an agent's skill as a new version in the registry.

func (*RegistryHandler) Copy

func (h *RegistryHandler) Copy(c *gin.Context)

Copy copies a skill with all its versions to a new name.

func (*RegistryHandler) Create

func (h *RegistryHandler) Create(c *gin.Context)

Create creates a new empty skill in the registry.

func (*RegistryHandler) Delete

func (h *RegistryHandler) Delete(c *gin.Context)

Delete removes a skill from the registry and its deployment in /data/skills/.

func (*RegistryHandler) Export

func (h *RegistryHandler) Export(c *gin.Context)

Export exports a specific version (or active version) as a ZIP file.

func (*RegistryHandler) Get

func (h *RegistryHandler) Get(c *gin.Context)

Get retrieves a skill's metadata and active version's SKILLS.md content.

func (*RegistryHandler) Import

func (h *RegistryHandler) Import(c *gin.Context)

Import imports a skill from a ZIP URL as a new version and auto-activates.

func (*RegistryHandler) ImportUpload

func (h *RegistryHandler) ImportUpload(c *gin.Context)

ImportUpload imports skills from uploaded ZIP files and auto-activates each.

func (*RegistryHandler) List

func (h *RegistryHandler) List(c *gin.Context)

List lists all skills in the registry.

func (*RegistryHandler) Rename

func (h *RegistryHandler) Rename(c *gin.Context)

Rename renames a skill in the registry and its deployment.

func (*RegistryHandler) SetSSRFProtection

func (h *RegistryHandler) SetSSRFProtection(enabled bool)

SetSSRFProtection enables or disables SSRF protection.

func (*RegistryHandler) Update

func (h *RegistryHandler) Update(c *gin.Context)

Update updates a skill's description.

func (*RegistryHandler) VersionClone

func (h *RegistryHandler) VersionClone(c *gin.Context)

VersionClone clones an existing version's content into a new version.

func (*RegistryHandler) VersionCreate

func (h *RegistryHandler) VersionCreate(c *gin.Context)

VersionCreate creates a new version for a skill.

func (*RegistryHandler) VersionDelete

func (h *RegistryHandler) VersionDelete(c *gin.Context)

VersionDelete deletes a version (cannot delete the active version).

func (*RegistryHandler) VersionFileDelete

func (h *RegistryHandler) VersionFileDelete(c *gin.Context)

VersionFileDelete deletes a file or directory within a specific version.

func (*RegistryHandler) VersionFileMkdir

func (h *RegistryHandler) VersionFileMkdir(c *gin.Context)

VersionFileMkdir creates a directory within a specific version.

func (*RegistryHandler) VersionFileRead

func (h *RegistryHandler) VersionFileRead(c *gin.Context)

VersionFileRead reads a file within a specific version.

func (*RegistryHandler) VersionFileUpdate

func (h *RegistryHandler) VersionFileUpdate(c *gin.Context)

VersionFileUpdate replaces string content in a file within a specific version.

func (*RegistryHandler) VersionFileWrite

func (h *RegistryHandler) VersionFileWrite(c *gin.Context)

VersionFileWrite writes a file within a specific version.

func (*RegistryHandler) VersionGet

func (h *RegistryHandler) VersionGet(c *gin.Context)

VersionGet retrieves a specific version's metadata and SKILLS.md content.

func (*RegistryHandler) VersionList

func (h *RegistryHandler) VersionList(c *gin.Context)

VersionList lists all versions of a skill.

func (*RegistryHandler) VersionTree

func (h *RegistryHandler) VersionTree(c *gin.Context)

VersionTree returns the directory tree of a specific version.

type SandboxHandler

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

func NewSandboxHandler

func NewSandboxHandler(mgr *session.Manager, udMgr *userdata.Manager, pdMgr *projectdata.Manager) *SandboxHandler

func (*SandboxHandler) FsInfo

func (h *SandboxHandler) FsInfo(c *gin.Context)

func (*SandboxHandler) GetContext

func (h *SandboxHandler) GetContext(c *gin.Context)

func (*SandboxHandler) GetNodejsPackages

func (h *SandboxHandler) GetNodejsPackages(c *gin.Context)

func (*SandboxHandler) GetPythonPackages

func (h *SandboxHandler) GetPythonPackages(c *gin.Context)

type SessionHandler

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

func NewSessionHandler

func NewSessionHandler(mgr *session.Manager) *SessionHandler

func (*SessionHandler) DeleteSession

func (h *SessionHandler) DeleteSession(c *gin.Context)

DeleteSession removes a session and its audit logs. DELETE /v1/sessions/:session_id?agent_id=xxx

func (*SessionHandler) GetAuditLogs

func (h *SessionHandler) GetAuditLogs(c *gin.Context)

GetAuditLogs returns paginated audit log entries for a session. GET /v1/sessions/:session_id/audits?agent_id=xxx&offset=0&limit=100

Total reflects the number of valid (parseable) audit entries in the file, not the raw line count. Malformed lines are silently skipped.

func (*SessionHandler) ListSessions

func (h *SessionHandler) ListSessions(c *gin.Context)

ListSessions returns all sessions for a given agent. GET /v1/sessions?agent_id=xxx

type SkillHandler

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

SkillHandler handles agent skill API endpoints.

func NewSkillHandler

func NewSkillHandler(mgr *session.Manager, udMgr *userdata.Manager, pdMgr *projectdata.Manager) *SkillHandler

NewSkillHandler creates a new SkillHandler with SSRF protection from env.

func (*SkillHandler) AgentCacheDelete

func (h *SkillHandler) AgentCacheDelete(c *gin.Context)

AgentCacheDelete deletes cached skills for an agent.

func (*SkillHandler) AgentList

func (h *SkillHandler) AgentList(c *gin.Context)

AgentList syncs skills to agent cache and returns frontmatter summaries. Skills are resolved across two layers with priority: user > agent. User skills are discovered by scanning directories (independent of skill_ids). Agent skills are synced from the global store based on skill_ids (console-configured).

func (*SkillHandler) AgentLoad

func (h *SkillHandler) AgentLoad(c *gin.Context)

AgentLoad syncs skills to agent cache and returns SKILLS.md body (post-frontmatter). Skills are resolved across two layers with priority: user > agent.

func (*SkillHandler) SetSSRFProtection

func (h *SkillHandler) SetSSRFProtection(enabled bool)

SetSSRFProtection enables or disables SSRF protection.

Jump to

Keyboard shortcuts

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