gateway

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentLookup

type AgentLookup interface {
	Get(name string) interface{ CheckPolicy(toolName string) error }
	List() []string
}

AgentLookup resolves an agent by name.

type AgentRunRequest

type AgentRunRequest struct {
	Agent string `json:"agent"`
	Task  string `json:"task"`
}

AgentRunRequest is the body for POST /agent/run.

type AgentRunResponse

type AgentRunResponse struct {
	TaskID string `json:"task_id"`
	State  string `json:"state"`
	Agent  string `json:"agent,omitempty"`
}

AgentRunResponse is the response for POST /agent/run.

type Handler

type Handler struct {
	TaskAPI      access.TaskSubmissionAPI
	AgentManager AgentLookup
}

Handler provides ClawOS API: /agent/run, /tool/run.

func NewHandler

func NewHandler(taskAPI access.TaskSubmissionAPI) *Handler

NewHandler returns a gateway handler.

func (*Handler) ServeAgentList

func (h *Handler) ServeAgentList(w http.ResponseWriter, r *http.Request)

ServeAgentList handles GET /agent/list.

func (*Handler) ServeAgentRun

func (h *Handler) ServeAgentRun(w http.ResponseWriter, r *http.Request)

ServeAgentRun handles POST /agent/run.

func (*Handler) ServeAgentStatus

func (h *Handler) ServeAgentStatus(w http.ResponseWriter, r *http.Request)

ServeAgentStatus handles GET /agent/status?task_id=...

func (*Handler) ServeToolRun

func (h *Handler) ServeToolRun(w http.ResponseWriter, r *http.Request)

ServeToolRun handles POST /tool/run.

type ToolRunRequest

type ToolRunRequest struct {
	Tool  string         `json:"tool"`
	Input map[string]any `json:"input"`
}

ToolRunRequest is the body for POST /tool/run.

Jump to

Keyboard shortcuts

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