webproto

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageToFrame

func MessageToFrame(msg Message) (pty.Frame, error)

Types

type AgentIdentity

type AgentIdentity struct {
	NodeID       string         `json:"node_id,omitempty"`
	NodeName     string         `json:"node_name,omitempty"`
	Space        string         `json:"space,omitempty"`
	IOAURL       string         `json:"ioa_url,omitempty"`
	Hostname     string         `json:"hostname,omitempty"`
	Username     string         `json:"username,omitempty"`
	WorkingDir   string         `json:"working_dir,omitempty"`
	OS           string         `json:"os,omitempty"`
	Arch         string         `json:"arch,omitempty"`
	PID          int            `json:"pid,omitempty"`
	Provider     string         `json:"provider,omitempty"`
	Model        string         `json:"model,omitempty"`
	Capabilities []string       `json:"capabilities,omitempty"`
	Meta         map[string]any `json:"meta,omitempty"`
}

type AgentStats

type AgentStats struct {
	Turns            int    `json:"turns,omitempty"`
	ToolCalls        int    `json:"tool_calls,omitempty"`
	RunningTools     int    `json:"running_tools,omitempty"`
	PromptTokens     int    `json:"prompt_tokens,omitempty"`
	CompletionTokens int    `json:"completion_tokens,omitempty"`
	TotalTokens      int    `json:"total_tokens,omitempty"`
	CacheReadTokens  int    `json:"cache_read_tokens,omitempty"`
	CacheWriteTokens int    `json:"cache_write_tokens,omitempty"`
	Assets           int    `json:"assets,omitempty"`
	Loots            int    `json:"loots,omitempty"`
	LastEvent        string `json:"last_event,omitempty"`
}

type DistributeConfig added in v0.2.8

type DistributeConfig struct {
	LLM struct {
		Provider string `json:"provider" yaml:"provider"`
		BaseURL  string `json:"base_url" yaml:"base_url"`
		APIKey   string `json:"api_key,omitempty" yaml:"api_key"`
		Model    string `json:"model" yaml:"model"`
		Proxy    string `json:"proxy" yaml:"proxy"`
	} `json:"llm" yaml:"llm"`
	Cyberhub struct {
		URL   string `json:"url" yaml:"url"`
		Key   string `json:"key,omitempty" yaml:"key"`
		Mode  string `json:"mode" yaml:"mode"`
		Proxy string `json:"proxy" yaml:"proxy"`
	} `json:"cyberhub" yaml:"cyberhub"`
	Recon struct {
		FofaEmail    string `json:"fofa_email" yaml:"fofa_email"`
		FofaKey      string `json:"fofa_key,omitempty" yaml:"fofa_key"`
		HunterToken  string `json:"hunter_token,omitempty" yaml:"hunter_token"`
		HunterAPIKey string `json:"hunter_api_key,omitempty" yaml:"hunter_api_key"`
		Proxy        string `json:"proxy" yaml:"proxy"`
		Limit        *int   `json:"limit,omitempty" yaml:"limit,omitempty"`
	} `json:"recon" yaml:"recon"`
	Scan struct {
		Verify        string `json:"verify" yaml:"verify"`
		VerifyTimeout int    `json:"verify_timeout" yaml:"verify_timeout"`
	} `json:"scan" yaml:"scan"`
	Search struct {
		TavilyKeys string `json:"tavily_keys,omitempty" yaml:"tavily_keys"`
	} `json:"search" yaml:"search"`
	IOA struct {
		URL      string `json:"url" yaml:"url"`
		Token    string `json:"token,omitempty" yaml:"token"`
		NodeName string `json:"node_name" yaml:"node_name"`
		Space    string `json:"space" yaml:"space"`
	} `json:"ioa" yaml:"ioa"`
	Agent struct {
		Tools       []string `json:"tools,omitempty" yaml:"tools,omitempty"`
		Timeout     int      `json:"timeout" yaml:"timeout"`
		SaveSession bool     `json:"save_session" yaml:"save_session"`
	} `json:"agent" yaml:"agent"`
}

DistributeConfig is the configuration payload sent from the web server to agents. All secret fields are included so agents can use them. Also used by the settings UI (with secrets masked at the handler level).

type FileUploadPayload added in v0.2.8

type FileUploadPayload struct {
	Filename  string `json:"filename"`
	FileSize  int64  `json:"file_size"`
	MimeType  string `json:"mime_type,omitempty"`
	SessionID string `json:"session_id,omitempty"`
}

type FileUploadResult added in v0.2.8

type FileUploadResult struct {
	Filename string `json:"filename"`
	Path     string `json:"path"`
	Size     int64  `json:"size"`
	Error    string `json:"error,omitempty"`
}

type Message

type Message struct {
	Type     string          `json:"type"`
	TaskID   string          `json:"task_id,omitempty"`
	StreamID string          `json:"stream_id,omitempty"`
	Data     string          `json:"data,omitempty"`
	DataB64  string          `json:"data_b64,omitempty"`
	Payload  json.RawMessage `json:"payload,omitempty"`
}

func FrameToMessage

func FrameToMessage(frame pty.Frame) Message

type PTYPayload

type PTYPayload struct {
	SessionID string      `json:"session_id,omitempty"`
	Data      string      `json:"data,omitempty"`
	DataB64   string      `json:"data_b64,omitempty"`
	Command   string      `json:"command,omitempty"`
	Kind      string      `json:"kind,omitempty"`
	Args      []string    `json:"args,omitempty"`
	Name      string      `json:"name,omitempty"`
	Rows      int         `json:"rows,omitempty"`
	Cols      int         `json:"cols,omitempty"`
	Bytes     int         `json:"bytes,omitempty"`
	Singleton bool        `json:"singleton,omitempty"`
	State     tmux.State  `json:"state,omitempty"`
	ExitCode  int         `json:"exit_code,omitempty"`
	Session   *tmux.Info  `json:"session,omitempty"`
	Sessions  []tmux.Info `json:"sessions,omitempty"`
}

func DecodePTYPayload

func DecodePTYPayload(raw json.RawMessage) (PTYPayload, error)

type RegisterPayload

type RegisterPayload struct {
	Name     string        `json:"name"`
	Commands []string      `json:"commands,omitempty"`
	Identity AgentIdentity `json:"identity,omitempty"`
	Stats    AgentStats    `json:"stats,omitempty"`
}

Jump to

Keyboard shortcuts

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