wshrpc

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

types and methods for wsh rpc calls

types and methods for wsh rpc calls

file-related types and methods for wsh rpc calls

Index

Constants

View Source
const (
	PortForwardStatus_Active  = "active"
	PortForwardStatus_Waiting = "waiting"
	PortForwardStatus_Error   = "error"
)
View Source
const (
	// MaxFileSize is the maximum file size that can be read
	MaxFileSize = 50 * 1024 * 1024 // 50M
	// MaxDirSize is the maximum number of entries that can be read in a directory
	MaxDirSize = 1024
	// FileChunkSize is the size of the file chunk to read
	FileChunkSize = 64 * 1024
	// DirChunkSize is the size of the directory chunk to read
	DirChunkSize = 128
)
View Source
const (
	RpcType_Call             = "call"             // single response (regular rpc)
	RpcType_ResponseStream   = "responsestream"   // stream of responses (streaming rpc)
	RpcType_StreamingRequest = "streamingrequest" // streaming request
	RpcType_Complex          = "complex"          // streaming request/response
)
View Source
const (
	CreateBlockAction_Replace    = "replace"
	CreateBlockAction_SplitUp    = "splitup"
	CreateBlockAction_SplitDown  = "splitdown"
	CreateBlockAction_SplitLeft  = "splitleft"
	CreateBlockAction_SplitRight = "splitright"
)
View Source
const (
	Command_Authenticate                 = "authenticate"                 // $control
	Command_AuthenticateToken            = "authenticatetoken"            // $control
	Command_AuthenticateTokenVerify      = "authenticatetokenverify"      // $control:root (internal, for token validation only)
	Command_AuthenticateJobManagerVerify = "authenticatejobmanagerverify" // $control:root (internal, for job auth token validation only)
	Command_RouteAnnounce                = "routeannounce"                // $control (for routing)
	Command_RouteUnannounce              = "routeunannounce"              // $control (for routing)
	Command_Ping                         = "ping"                         // $control
	Command_ControllerInput              = "controllerinput"
	Command_EventRecv                    = "eventrecv"
	Command_Message                      = "message"
	Command_StreamData                   = "streamdata"
	Command_StreamDataAck                = "streamdataack"
)

we only need consts for special commands handled in the router or in the RPC code / WPS code directly. other commands go through the clients

View Source
const LocalConnName = "local"
View Source
const (
	TimeSeries_Cpu = "cpu"
)

Variables

This section is empty.

Functions

func GenerateWshCommandDeclMap

func GenerateWshCommandDeclMap() map[string]*WshRpcMethodDecl

func MakeMethodMapForImpl

func MakeMethodMapForImpl(impl any, declMap map[string]*WshRpcMethodDecl) map[string]reflect.Method

Types

type ActivityDisplayType

type ActivityDisplayType struct {
	Width    int     `json:"width"`
	Height   int     `json:"height"`
	DPR      float64 `json:"dpr"`
	Internal bool    `json:"internal,omitempty"`
}

type ActivityUpdate

type ActivityUpdate struct {
	FgMinutes       int                   `json:"fgminutes,omitempty"`
	ActiveMinutes   int                   `json:"activeminutes,omitempty"`
	OpenMinutes     int                   `json:"openminutes,omitempty"`
	NumTabs         int                   `json:"numtabs,omitempty"`
	NewTab          int                   `json:"newtab,omitempty"`
	NumBlocks       int                   `json:"numblocks,omitempty"`
	NumWindows      int                   `json:"numwindows,omitempty"`
	NumWS           int                   `json:"numws,omitempty"`
	NumWSNamed      int                   `json:"numwsnamed,omitempty"`
	NumSSHConn      int                   `json:"numsshconn,omitempty"`
	NumWSLConn      int                   `json:"numwslconn,omitempty"`
	NumMagnify      int                   `json:"nummagnify,omitempty"`
	TermCommandsRun int                   `json:"termcommandsrun,omitempty"`
	NumPanics       int                   `json:"numpanics,omitempty"`
	Startup         int                   `json:"startup,omitempty"`
	Shutdown        int                   `json:"shutdown,omitempty"`
	SetTabTheme     int                   `json:"settabtheme,omitempty"`
	BuildTime       string                `json:"buildtime,omitempty"`
	Displays        []ActivityDisplayType `json:"displays,omitempty"`
	Renderers       map[string]int        `json:"renderers,omitempty"`
	Blocks          map[string]int        `json:"blocks,omitempty"`
	WshCmds         map[string]int        `json:"wshcmds,omitempty"`
	Conn            map[string]int        `json:"conn,omitempty"`
}

type BlockInfoData

type BlockInfoData struct {
	BlockId     string          `json:"blockid"`
	TabId       string          `json:"tabid"`
	WorkspaceId string          `json:"workspaceid"`
	Block       *waveobj.Block  `json:"block"`
	Files       []*WaveFileInfo `json:"files"`
}

type BlockJobStatusData

type BlockJobStatusData struct {
	BlockId       string `json:"blockid"`
	JobId         string `json:"jobid"`
	Status        string `json:"status,omitempty" tstype:"null | \"init\" | \"connected\" | \"disconnected\" | \"done\""`
	VersionTs     int64  `json:"versionts"`
	DoneReason    string `json:"donereason,omitempty"`
	StartupError  string `json:"startuperror,omitempty"`
	CmdExitTs     int64  `json:"cmdexitts,omitempty"`
	CmdExitCode   *int   `json:"cmdexitcode,omitempty"`
	CmdExitSignal string `json:"cmdexitsignal,omitempty"`
	OutputGap     int64  `json:"outputgap,omitempty"`
}

type BlocksListEntry

type BlocksListEntry struct {
	WindowId    string              `json:"windowid"`
	WorkspaceId string              `json:"workspaceid"`
	TabId       string              `json:"tabid"`
	BlockId     string              `json:"blockid"`
	Meta        waveobj.MetaMapType `json:"meta"`
}

type BlocksListRequest

type BlocksListRequest struct {
	WindowId    string `json:"windowid,omitempty"`
	WorkspaceId string `json:"workspaceid,omitempty"`
}

type CommandAiContext added in v1.2.0

type CommandAiContext struct {
	Connection     string   `json:"connection,omitempty"`
	Cwd            string   `json:"cwd,omitempty"`
	Shell          string   `json:"shell,omitempty"`
	ShellVersion   string   `json:"shellversion,omitempty"`
	Os             string   `json:"os,omitempty"`
	Distro         string   `json:"distro,omitempty"`
	RecentCommands []string `json:"recentcommands,omitempty"`
	Command        string   `json:"command,omitempty"`
	ExitCode       *int     `json:"exitcode,omitempty"`
	Output         string   `json:"output,omitempty"`
	Selection      string   `json:"selection,omitempty"`
}

type CommandAiEngineInfo added in v1.2.0

type CommandAiEngineInfo struct {
	Id           string   `json:"id"`
	Label        string   `json:"label"`
	Kind         string   `json:"kind"`
	Available    bool     `json:"available"`
	SignedIn     bool     `json:"signedin"`
	Account      string   `json:"account,omitempty"`
	Version      string   `json:"version,omitempty"`
	Path         string   `json:"path,omitempty"`
	Detail       string   `json:"detail,omitempty"`
	FixCommand   string   `json:"fixcommand,omitempty"`
	DefaultModel string   `json:"defaultmodel,omitempty"`
	Models       []string `json:"models,omitempty"`
	NeedsKey     bool     `json:"needskey,omitempty"`
	HasKey       bool     `json:"haskey,omitempty"`
	SecretName   string   `json:"secretname,omitempty"`
	BaseUrl      string   `json:"baseurl,omitempty"`
}

type CommandAiModels added in v1.2.0

type CommandAiModels struct {
	Models []string `json:"models"`
	Error  string   `json:"error,omitempty"`
}

type CommandAiModelsRequest added in v1.2.0

type CommandAiModelsRequest struct {
	Engine  string `json:"engine"`
	BaseUrl string `json:"baseurl,omitempty"`
}

type CommandAiPreview added in v1.2.0

type CommandAiPreview struct {
	Engine      string `json:"engine,omitempty"`
	EngineLabel string `json:"enginelabel,omitempty"`
	Destination string `json:"destination,omitempty"`
	System      string `json:"system"`
	Message     string `json:"message"`
	Redactions  int    `json:"redactions,omitempty"`
}

CommandAiPreview is exactly what CommandAiRunCommand would send for the same request.

type CommandAiProposal added in v1.2.0

type CommandAiProposal struct {
	Command     string `json:"command"`
	Explanation string `json:"explanation,omitempty"`
}

type CommandAiRequest added in v1.2.0

type CommandAiRequest struct {
	RequestId string           `json:"requestid"`
	Task      string           `json:"task"`
	Prompt    string           `json:"prompt,omitempty"`
	BlockId   string           `json:"blockid,omitempty"`
	Context   CommandAiContext `json:"context"`
	Previous  []CommandAiTurn  `json:"previous,omitempty"`
	Engine    string           `json:"engine,omitempty"`
	Model     string           `json:"model,omitempty"`
	BaseUrl   string           `json:"baseurl,omitempty"`
}

CommandAiRequest asks the configured engine to compose, fix or explain a command. The frontend sends what only it knows (the terminal buffer); the server fills shell, OS and cwd from the block when they are blank, then redacts everything.

type CommandAiResult added in v1.2.0

type CommandAiResult struct {
	RequestId    string              `json:"requestid"`
	Status       string              `json:"status"`
	StatusDetail string              `json:"statusdetail,omitempty"`
	FixCommand   string              `json:"fixcommand,omitempty"`
	Engine       string              `json:"engine,omitempty"`
	EngineLabel  string              `json:"enginelabel,omitempty"`
	Model        string              `json:"model,omitempty"`
	Summary      string              `json:"summary,omitempty"`
	Proposals    []CommandAiProposal `json:"proposals,omitempty"`
	DurationMs   int64               `json:"durationms,omitempty"`
	Redactions   int                 `json:"redactions,omitempty"`
}

type CommandAiStatus added in v1.2.0

type CommandAiStatus struct {
	Enabled       bool                  `json:"enabled"`
	Engine        string                `json:"engine,omitempty"`
	Ready         bool                  `json:"ready"`
	Engines       []CommandAiEngineInfo `json:"engines"`
	SecretBackend string                `json:"secretbackend,omitempty"`
}

type CommandAiStatusRequest added in v1.2.0

type CommandAiStatusRequest struct {
	Refresh bool `json:"refresh,omitempty"`
}

type CommandAiTurn added in v1.2.0

type CommandAiTurn struct {
	Prompt   string   `json:"prompt"`
	Commands []string `json:"commands,omitempty"`
}

type CommandAppendIJsonData

type CommandAppendIJsonData struct {
	ZoneId   string        `json:"zoneid"`
	FileName string        `json:"filename"`
	Data     ijson.Command `json:"data"`
}

type CommandAuthenticateJobManagerData

type CommandAuthenticateJobManagerData struct {
	JobId        string `json:"jobid"`
	JobAuthToken string `json:"jobauthtoken"`
}

type CommandAuthenticateRtnData

type CommandAuthenticateRtnData struct {
	RouteId string `json:"routeid"`

	// these fields are only set when doing a token swap
	Env            map[string]string `json:"env,omitempty"`
	InitScriptText string            `json:"initscripttext,omitempty"`
	RpcContext     *RpcContext       `json:"rpccontext,omitempty"`
}

type CommandAuthenticateToJobData

type CommandAuthenticateToJobData struct {
	JobAccessToken string `json:"jobaccesstoken"`
}

type CommandAuthenticateTokenData

type CommandAuthenticateTokenData struct {
	Token string `json:"token"`
}

type CommandBadgeWatchPidData

type CommandBadgeWatchPidData struct {
	Pid     int          `json:"pid"`
	ORef    waveobj.ORef `json:"oref"`
	BadgeId string       `json:"badgeid"`
}

type CommandBlockInputData

type CommandBlockInputData struct {
	BlockId     string            `json:"blockid"`
	InputData64 string            `json:"inputdata64,omitempty"`
	SigName     string            `json:"signame,omitempty"`
	TermSize    *waveobj.TermSize `json:"termsize,omitempty"`
}

type CommandConnServerInitData

type CommandConnServerInitData struct {
	ClientId string `json:"clientid"`
}

type CommandControllerAppendOutputData

type CommandControllerAppendOutputData struct {
	BlockId string `json:"blockid"`
	Data64  string `json:"data64"`
}

type CommandControllerResyncData

type CommandControllerResyncData struct {
	ForceRestart bool                 `json:"forcerestart,omitempty"`
	TabId        string               `json:"tabid"`
	BlockId      string               `json:"blockid"`
	RtOpts       *waveobj.RuntimeOpts `json:"rtopts,omitempty"`
}

type CommandCreateBlockData

type CommandCreateBlockData struct {
	TabId         string               `json:"tabid"`
	BlockDef      *waveobj.BlockDef    `json:"blockdef"`
	RtOpts        *waveobj.RuntimeOpts `json:"rtopts,omitempty"`
	Magnified     bool                 `json:"magnified,omitempty"`
	Ephemeral     bool                 `json:"ephemeral,omitempty"`
	Focused       bool                 `json:"focused,omitempty"`
	TargetBlockId string               `json:"targetblockid,omitempty"`
	TargetAction  string               `json:"targetaction,omitempty"` // "replace", "splitright", "splitdown", "splitleft", "splitup"
}

type CommandCreateSubBlockData

type CommandCreateSubBlockData struct {
	ParentBlockId string            `json:"parentblockid"`
	BlockDef      *waveobj.BlockDef `json:"blockdef"`
}

type CommandDebugTermData

type CommandDebugTermData struct {
	BlockId string `json:"blockid"`
	Size    int64  `json:"size"`
}

type CommandDebugTermRtnData

type CommandDebugTermRtnData struct {
	Offset int64  `json:"offset"`
	Data64 string `json:"data64"`
}

type CommandDeleteBlockData

type CommandDeleteBlockData struct {
	BlockId string `json:"blockid"`
}

type CommandDeleteFileData

type CommandDeleteFileData struct {
	Path      string `json:"path"`
	Recursive bool   `json:"recursive"`
}

type CommandDurableJobCountData added in v0.5.0

type CommandDurableJobCountData struct {
	WorkspaceId string   `json:"workspaceid,omitempty"`
	BlockIds    []string `json:"blockids,omitempty"`
}

counts running durable sessions attached to the given workspace's blocks and/or the given blocks

type CommandElectronDecryptData

type CommandElectronDecryptData struct {
	CipherText string `json:"ciphertext"`
}

type CommandElectronDecryptRtnData

type CommandElectronDecryptRtnData struct {
	PlainText      string `json:"plaintext"`
	StorageBackend string `json:"storagebackend"` // only returned for linux
}

type CommandElectronEncryptData

type CommandElectronEncryptData struct {
	PlainText string `json:"plaintext"`
}

type CommandElectronEncryptRtnData

type CommandElectronEncryptRtnData struct {
	CipherText     string `json:"ciphertext"`
	StorageBackend string `json:"storagebackend"` // only returned for linux
}

type CommandEventReadHistoryData

type CommandEventReadHistoryData struct {
	Event    string `json:"event"`
	Scope    string `json:"scope"`
	MaxItems int    `json:"maxitems"`
}

type CommandFileCopyData

type CommandFileCopyData struct {
	SrcUri  string        `json:"srcuri"`
	DestUri string        `json:"desturi"`
	Opts    *FileCopyOpts `json:"opts,omitempty"`
}

type CommandFileDownloadDirectoryData added in v1.7.0

type CommandFileDownloadDirectoryData struct {
	SrcUri   string `json:"srcuri"`
	DestPath string `json:"destpath"`
}

type CommandFileStreamData

type CommandFileStreamData struct {
	Info       *FileInfo  `json:"info"`
	ByteRange  string     `json:"byterange,omitempty"`
	StreamMeta StreamMeta `json:"streammeta"`
}

type CommandGetMetaData

type CommandGetMetaData struct {
	ORef waveobj.ORef `json:"oref"`
}

type CommandGetRTInfoData

type CommandGetRTInfoData struct {
	ORef waveobj.ORef `json:"oref"`
}

type CommandGitStatusData added in v0.4.66

type CommandGitStatusData struct {
	ConnName  string `json:"connname,omitempty"`
	Cwd       string `json:"cwd,omitempty"`
	TimeoutMs int    `json:"timeoutms,omitempty"`
}

type CommandJobCmdExitedData

type CommandJobCmdExitedData struct {
	JobId      string `json:"jobid"`
	ExitCode   *int   `json:"exitcode,omitempty"`
	ExitSignal string `json:"exitsignal,omitempty"`
	ExitErr    string `json:"exiterr,omitempty"`
	ExitTs     int64  `json:"exitts,omitempty"`
}

type CommandJobConnectRtnData

type CommandJobConnectRtnData struct {
	Seq         int64  `json:"seq"`
	StreamDone  bool   `json:"streamdone,omitempty"`
	StreamError string `json:"streamerror,omitempty"`
	HasExited   bool   `json:"hasexited,omitempty"`
	ExitCode    *int   `json:"exitcode,omitempty"`
	ExitSignal  string `json:"exitsignal,omitempty"`
	ExitErr     string `json:"exiterr,omitempty"`
}

type CommandJobControllerAttachJobData

type CommandJobControllerAttachJobData struct {
	JobId   string `json:"jobid"`
	BlockId string `json:"blockid"`
}

type CommandJobControllerStartJobData

type CommandJobControllerStartJobData struct {
	ConnName string            `json:"connname"`
	JobKind  string            `json:"jobkind"`
	Cmd      string            `json:"cmd"`
	Args     []string          `json:"args"`
	Env      map[string]string `json:"env"`
	TermSize *waveobj.TermSize `json:"termsize,omitempty"`
}

type CommandJobInputData

type CommandJobInputData struct {
	JobId          string            `json:"jobid"`
	InputSessionId string            `json:"inputsessionid,omitempty"`
	SeqNum         int               `json:"seqnum,omitempty"`
	InputData64    string            `json:"inputdata64,omitempty"`
	SigName        string            `json:"signame,omitempty"`
	TermSize       *waveobj.TermSize `json:"termsize,omitempty"`
}

type CommandJobPrepareConnectData

type CommandJobPrepareConnectData struct {
	StreamMeta StreamMeta       `json:"streammeta"`
	Seq        int64            `json:"seq"`
	TermSize   waveobj.TermSize `json:"termsize"`
}

type CommandJobStartStreamData

type CommandJobStartStreamData struct {
}

type CommandMessageData

type CommandMessageData struct {
	Message string `json:"message"`
}

type CommandPortForwardListData added in v1.0.0

type CommandPortForwardListData struct {
	ConnName string `json:"connname,omitempty"` // empty = all connections
}

type CommandPortForwardStartData added in v1.0.0

type CommandPortForwardStartData struct {
	ConnName   string `json:"connname"`
	RemoteHost string `json:"remotehost,omitempty"` // host as seen from the remote machine; default 127.0.0.1
	RemotePort int    `json:"remoteport"`
	LocalPort  int    `json:"localport,omitempty"` // 0 = RemotePort when free on this machine, otherwise any free port
}

type CommandPortForwardStopData added in v1.0.0

type CommandPortForwardStopData struct {
	Id string `json:"id"`
}

type CommandRemoteDisconnectFromJobManagerData

type CommandRemoteDisconnectFromJobManagerData struct {
	JobId string `json:"jobid"`
}

type CommandRemoteFileMultiInfoData

type CommandRemoteFileMultiInfoData struct {
	Cwd   string   `json:"cwd"`
	Paths []string `json:"paths"`
}

type CommandRemoteFileStreamData

type CommandRemoteFileStreamData struct {
	Path       string     `json:"path"`
	ByteRange  string     `json:"byterange,omitempty"`
	StreamMeta StreamMeta `json:"streammeta"`
}

type CommandRemoteListEntriesData

type CommandRemoteListEntriesData struct {
	Path string        `json:"path"`
	Opts *FileListOpts `json:"opts,omitempty"`
}

type CommandRemoteListEntriesRtnData

type CommandRemoteListEntriesRtnData struct {
	FileInfo []*FileInfo `json:"fileinfo,omitempty"`
}

type CommandRemoteProcessListData

type CommandRemoteProcessListData struct {
	WidgetId   string `json:"widgetid,omitempty"`
	SortBy     string `json:"sortby,omitempty"`
	SortDesc   bool   `json:"sortdesc,omitempty"`
	Start      int    `json:"start,omitempty"`
	Limit      int    `json:"limit,omitempty"`
	TextSearch string `json:"textsearch,omitempty"`
	// LastPidOrder, when set, ignores SortBy/SortDesc/TextSearch and returns processes in the order
	// they were returned in the previous request for this WidgetId (with Gone=true for dead pids).
	LastPidOrder bool `json:"lastpidorder,omitempty"`
	// KeepAlive, when set, overrides all other fields and only keeps this WidgetId's pid order from
	// expiring (returns nil). It does not keep background sampling running.
	KeepAlive bool `json:"keepalive,omitempty"`
	// Release, when set, drops this WidgetId's sampling lease and pid order (returns nil).
	Release bool `json:"release,omitempty"`
	// Interval is the widget's refresh interval in ms; the backend samples at the smallest live interval.
	Interval int `json:"interval,omitempty"`
}

type CommandRemoteProcessSignalData

type CommandRemoteProcessSignalData struct {
	Pid    int32  `json:"pid"`
	Signal string `json:"signal"`
}

type CommandRemoteReconnectToJobManagerData

type CommandRemoteReconnectToJobManagerData struct {
	JobId              string `json:"jobid"`
	JobAuthToken       string `json:"jobauthtoken"`
	MainServerJwtToken string `json:"mainserverjwttoken"`
	JobManagerPid      int    `json:"jobmanagerpid"`
	JobManagerStartTs  int64  `json:"jobmanagerstartts"`
}

type CommandRemoteReconnectToJobManagerRtnData

type CommandRemoteReconnectToJobManagerRtnData struct {
	Success        bool   `json:"success"`
	JobManagerGone bool   `json:"jobmanagergone"`
	Error          string `json:"error,omitempty"`
}

type CommandRemoteStartJobData

type CommandRemoteStartJobData struct {
	Cmd                string            `json:"cmd"`
	Args               []string          `json:"args"`
	Env                map[string]string `json:"env"`
	TermSize           waveobj.TermSize  `json:"termsize"`
	StreamMeta         *StreamMeta       `json:"streammeta,omitempty"`
	JobAuthToken       string            `json:"jobauthtoken"`
	JobId              string            `json:"jobid"`
	MainServerJwtToken string            `json:"mainserverjwttoken"`
	ClientId           string            `json:"clientid"`
	PublicKeyBase64    string            `json:"publickeybase64"`
}

type CommandRemoteStreamFileData

type CommandRemoteStreamFileData struct {
	Path      string `json:"path"`
	ByteRange string `json:"byterange,omitempty"`
}

type CommandRemoteSysInfoWatchData added in v0.4.84

type CommandRemoteSysInfoWatchData struct {
	WatcherId string `json:"watcherid,omitempty"`
	Active    bool   `json:"active"`
}

type CommandRemoteTerminateJobManagerData

type CommandRemoteTerminateJobManagerData struct {
	JobId             string `json:"jobid"`
	JobManagerPid     int    `json:"jobmanagerpid"`
	JobManagerStartTs int64  `json:"jobmanagerstartts"`
}

type CommandResolveIdsData

type CommandResolveIdsData struct {
	BlockId string   `json:"blockid"`
	Ids     []string `json:"ids"`
}

type CommandResolveIdsRtnData

type CommandResolveIdsRtnData struct {
	ResolvedIds map[string]waveobj.ORef `json:"resolvedids"`
}

type CommandRunCompletionGenData

type CommandRunCompletionGenData struct {
	ConnName  string            `json:"connname,omitempty"`
	Cwd       string            `json:"cwd,omitempty"`
	Command   string            `json:"command"`
	Args      []string          `json:"args,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
	TimeoutMs int               `json:"timeoutms,omitempty"`
}

type CommandRunCompletionGenRtnData

type CommandRunCompletionGenRtnData struct {
	Stdout    string `json:"stdout"`
	Stderr    string `json:"stderr"`
	ExitCode  int    `json:"exitcode"`
	Supported bool   `json:"supported"`
}

type CommandSetMetaData

type CommandSetMetaData struct {
	ORef waveobj.ORef        `json:"oref"`
	Meta waveobj.MetaMapType `json:"meta"`
}

type CommandSetRTInfoData

type CommandSetRTInfoData struct {
	ORef   waveobj.ORef   `json:"oref"`
	Data   map[string]any `json:"data" tstype:"ObjRTInfo"`
	Delete bool           `json:"delete,omitempty"`
}

type CommandStartJobData

type CommandStartJobData struct {
	Cmd        string            `json:"cmd"`
	Args       []string          `json:"args"`
	Env        map[string]string `json:"env"`
	TermSize   waveobj.TermSize  `json:"termsize"`
	StreamMeta *StreamMeta       `json:"streammeta,omitempty"`
}

type CommandStartJobRtnData

type CommandStartJobRtnData struct {
	CmdPid            int   `json:"cmdpid"`
	CmdStartTs        int64 `json:"cmdstartts"`
	JobManagerPid     int   `json:"jobmanagerpid"`
	JobManagerStartTs int64 `json:"jobmanagerstartts"`
}

type CommandStreamAckData

type CommandStreamAckData struct {
	Id     string `json:"id"`               // streamid
	Seq    int64  `json:"seq"`              // next expected byte
	RWnd   int64  `json:"rwnd"`             // receive window size
	Fin    bool   `json:"fin,omitempty"`    // observed end-of-stream (eof or error)
	Delay  int64  `json:"delay,omitempty"`  // ack delay in microseconds (from when data was received to when we sent out ack -- monotonic clock)
	Cancel bool   `json:"cancel,omitempty"` // used to cancel the stream
	Error  string `json:"error,omitempty"`  // reason for cancel (may only be set if cancel is true)
}

type CommandStreamData

type CommandStreamData struct {
	Id     string `json:"id"`  // streamid
	Seq    int64  `json:"seq"` // start offset (bytes)
	Data64 string `json:"data64,omitempty"`
	Eof    bool   `json:"eof,omitempty"`   // can be set with data or without
	Error  string `json:"error,omitempty"` // stream terminated with error
}

type CommandTermCommandBlockData added in v1.6.0

type CommandTermCommandBlockData struct {
	CommandBlockId int    `json:"commandblockid"`
	StartTs        int64  `json:"startts"`
	Command        string `json:"command"`
	Focus          bool   `json:"focus,omitempty"`
}

type CommandTermCommandBlockRtnData added in v1.6.0

type CommandTermCommandBlockRtnData struct {
	Retained bool `json:"retained"`
}

type CommandTermGetScrollbackLinesData

type CommandTermGetScrollbackLinesData struct {
	LineStart   int  `json:"linestart"`
	LineEnd     int  `json:"lineend"`
	LastCommand bool `json:"lastcommand"`
}

type CommandTermGetScrollbackLinesRtnData

type CommandTermGetScrollbackLinesRtnData struct {
	TotalLines  int      `json:"totallines"`
	LineStart   int      `json:"linestart"`
	Lines       []string `json:"lines"`
	LastUpdated int64    `json:"lastupdated"`
}

type CommandUpdateSavedPortServiceData added in v1.6.0

type CommandUpdateSavedPortServiceData struct {
	Host    string                   `json:"host"`
	Service wconfig.SavedPortService `json:"service"`
	Remove  bool                     `json:"remove,omitempty"`
}

type CommandVarData

type CommandVarData struct {
	Key      string `json:"key"`
	Val      string `json:"val,omitempty"`
	Remove   bool   `json:"remove,omitempty"`
	ZoneId   string `json:"zoneid"`
	FileName string `json:"filename"`
}

type CommandVarResponseData

type CommandVarResponseData struct {
	Key    string `json:"key"`
	Val    string `json:"val"`
	Exists bool   `json:"exists"`
}

type CommandWaitForRouteData

type CommandWaitForRouteData struct {
	RouteId string `json:"routeid"`
	WaitMs  int    `json:"waitms"`
}

type CommandWaveFileReadStreamData

type CommandWaveFileReadStreamData struct {
	ZoneId     string     `json:"zoneid"`
	Name       string     `json:"name"`
	StreamMeta StreamMeta `json:"streammeta"`
}

type CommandWebSelectorData

type CommandWebSelectorData struct {
	WorkspaceId string           `json:"workspaceid"`
	BlockId     string           `json:"blockid"`
	TabId       string           `json:"tabid"`
	Selector    string           `json:"selector"`
	Opts        *WebSelectorOpts `json:"opts,omitempty"`
}

type CommandWriteTempFileData

type CommandWriteTempFileData struct {
	FileName string `json:"filename"`
	Data64   string `json:"data64"`
}

type ConnConfigRequest

type ConnConfigRequest struct {
	Host        string              `json:"host"`
	MetaMapType waveobj.MetaMapType `json:"metamaptype"`
}

type ConnExtData

type ConnExtData struct {
	ConnName   string `json:"connname"`
	LogBlockId string `json:"logblockid,omitempty"`
}

type ConnRequest

type ConnRequest struct {
	Host       string               `json:"host"`
	Keywords   wconfig.ConnKeywords `json:"keywords,omitempty"`
	LogBlockId string               `json:"logblockid,omitempty"`
}

type ConnStatus

type ConnStatus struct {
	Status                        string `json:"status"`
	ConnHealthStatus              string `json:"connhealthstatus,omitempty"`
	WshEnabled                    bool   `json:"wshenabled"`
	Connection                    string `json:"connection"`
	Connected                     bool   `json:"connected"`
	HasConnected                  bool   `json:"hasconnected"` // true if it has *ever* connected successfully
	ActiveConnNum                 int    `json:"activeconnnum"`
	Error                         string `json:"error,omitempty"`
	WshError                      string `json:"wsherror,omitempty"`
	NoWshReason                   string `json:"nowshreason,omitempty"`
	WshVersion                    string `json:"wshversion,omitempty"`
	WshInstallPct                 int    `json:"wshinstallpct,omitempty"` // 1-100 while the helper is being copied
	LastActivityBeforeStalledTime int64  `json:"lastactivitybeforestalledtime,omitempty"`
	KeepAliveSentTime             int64  `json:"keepalivesenttime,omitempty"`
	Reconnecting                  bool   `json:"reconnecting,omitempty"`
	ReconnectAttempt              int    `json:"reconnectattempt,omitempty"`
	NextReconnectTs               int64  `json:"nextreconnectts,omitempty"`
}

type DiskUsageData

type DiskUsageData struct {
	Mount   string  `json:"mount"`
	Total   float64 `json:"total"`
	Used    float64 `json:"used"`
	Free    float64 `json:"free"`
	Percent float64 `json:"percent"`
}

type FetchSuggestionsData

type FetchSuggestionsData struct {
	SuggestionType string `json:"suggestiontype"`
	Query          string `json:"query"`
	WidgetId       string `json:"widgetid"`
	ReqNum         int    `json:"reqnum"`
	FileCwd        string `json:"file:cwd,omitempty"`
	FileDirOnly    bool   `json:"file:dironly,omitempty"`
	FileConnection string `json:"file:connection,omitempty"`
}

type FetchSuggestionsResponse

type FetchSuggestionsResponse struct {
	ReqNum      int              `json:"reqnum"`
	Suggestions []SuggestionType `json:"suggestions"`
}

type FileCopyOpts

type FileCopyOpts struct {
	Overwrite bool  `json:"overwrite,omitempty"`
	Recursive bool  `json:"recursive,omitempty"` // only used for move, always true for copy
	Merge     bool  `json:"merge,omitempty"`
	Timeout   int64 `json:"timeout,omitempty"`
}

type FileCreateData

type FileCreateData struct {
	Path string         `json:"path"`
	Meta map[string]any `json:"meta,omitempty"`
	Opts *FileOpts      `json:"opts,omitempty"`
}

type FileData

type FileData struct {
	Info    *FileInfo   `json:"info,omitempty"`
	Data64  string      `json:"data64,omitempty"`
	Entries []*FileInfo `json:"entries,omitempty"`
	At      *FileDataAt `json:"at,omitempty"` // if set, this turns read/write ops to ReadAt/WriteAt ops (len is only used for ReadAt)
}

type FileDataAt

type FileDataAt struct {
	Offset int64 `json:"offset"`
	Size   int   `json:"size,omitempty"`
}

type FileInfo

type FileInfo struct {
	Path          string      `json:"path"`          // cleaned path (may have "~")
	Dir           string      `json:"dir,omitempty"` // returns the directory part of the path (if this is a a directory, it will be equal to Path).  "~" will be expanded, and separators will be normalized to "/"
	Name          string      `json:"name,omitempty"`
	StatError     string      `json:"staterror,omitempty"`
	NotFound      bool        `json:"notfound,omitempty"`
	Opts          *FileOpts   `json:"opts,omitempty"`
	Size          int64       `json:"size,omitempty"`
	Meta          *FileMeta   `json:"meta,omitempty"`
	Mode          os.FileMode `json:"mode,omitempty"`
	ModeStr       string      `json:"modestr,omitempty"`
	ModTime       int64       `json:"modtime,omitempty"`
	IsDir         bool        `json:"isdir,omitempty"`
	SupportsMkdir bool        `json:"supportsmkdir,omitempty"`
	MimeType      string      `json:"mimetype,omitempty"`
	ReadOnly      bool        `json:"readonly,omitempty"` // this is not set for fileinfo's returned from directory listings
}

type FileListData

type FileListData struct {
	Path string        `json:"path"`
	Opts *FileListOpts `json:"opts,omitempty"`
}

type FileListOpts

type FileListOpts struct {
	All    bool `json:"all,omitempty"`
	Offset int  `json:"offset,omitempty"`
	Limit  int  `json:"limit,omitempty"`
}

type FileMeta

type FileMeta = map[string]any

type FileOpts

type FileOpts struct {
	MaxSize     int64 `json:"maxsize,omitempty"`
	Circular    bool  `json:"circular,omitempty"`
	IJson       bool  `json:"ijson,omitempty"`
	IJsonBudget int   `json:"ijsonbudget,omitempty"`
	Truncate    bool  `json:"truncate,omitempty"`
	Append      bool  `json:"append,omitempty"`
}

type FileTransferProgress added in v1.7.0

type FileTransferProgress struct {
	BytesTransferred int64 `json:"bytestransferred"`
	FilesCompleted   int64 `json:"filescompleted"`
	FilesSkipped     int64 `json:"filesskipped"`
	Done             bool  `json:"done,omitempty"`
}

type GitStatusFile added in v0.4.66

type GitStatusFile struct {
	Path     string `json:"path"`
	OrigPath string `json:"origpath,omitempty"`
	Index    string `json:"index"`
	Worktree string `json:"worktree"`
}

type GitStatusResponse added in v0.4.66

type GitStatusResponse struct {
	Branch    string          `json:"branch,omitempty"`
	Upstream  string          `json:"upstream,omitempty"`
	Ahead     int             `json:"ahead,omitempty"`
	Behind    int             `json:"behind,omitempty"`
	Detached  bool            `json:"detached,omitempty"`
	Files     []GitStatusFile `json:"files"`
	Stdout    string          `json:"stdout,omitempty"`
	Stderr    string          `json:"stderr,omitempty"`
	ExitCode  int             `json:"exitcode"`
	Supported bool            `json:"supported"`
}

type GpuData added in v1.0.0

type GpuData struct {
	Index      int              `json:"index"`
	Name       string           `json:"name"`
	Util       float64          `json:"util"`       // percent
	MemUsed    float64          `json:"memused"`    // bytes
	MemTotal   float64          `json:"memtotal"`   // bytes
	Temp       float64          `json:"temp"`       // celsius
	Power      float64          `json:"power"`      // watts
	PowerLimit float64          `json:"powerlimit"` // watts
	MemUtil    float64          `json:"memutil"`    // percent of time the memory controller was busy
	Fan        float64          `json:"fan"`        // percent; -1 for passively cooled cards
	ClockSm    float64          `json:"clocksm"`    // MHz
	ClockSmMax float64          `json:"clocksmmax"` // MHz
	ClockMem   float64          `json:"clockmem"`   // MHz
	Pstate     string           `json:"pstate,omitempty"`
	Processes  []GpuProcessInfo `json:"processes,omitempty"`
}

GpuData fields are -1 when the driver does not report them.

type GpuProcessInfo added in v1.0.0

type GpuProcessInfo struct {
	Pid     int32   `json:"pid"`
	Command string  `json:"command,omitempty"`
	User    string  `json:"user,omitempty"`
	MemUsed float64 `json:"memused"` // bytes
}

type HostInfo added in v1.0.0

type HostInfo struct {
	Hostname    string `json:"hostname"`
	Os          string `json:"os"`     // e.g. "Ubuntu 22.04.4 LTS", "macOS 15.1"
	Kernel      string `json:"kernel"` // e.g. "6.5.0-41-generic", "Darwin 24.1.0"
	Arch        string `json:"arch"`
	CpuModel    string `json:"cpumodel,omitempty"`
	NumCpu      int    `json:"numcpu"`
	MemTotal    uint64 `json:"memtotal"` // bytes
	BootTime    int64  `json:"boottime"` // unix seconds
	GpuDriver   string `json:"gpudriver,omitempty"`
	CudaVersion string `json:"cudaversion,omitempty"`
}

type JobManagerStatusUpdate

type JobManagerStatusUpdate struct {
	JobId            string `json:"jobid"`
	JobManagerStatus string `json:"jobmanagerstatus"`
}

type ListeningPort added in v1.0.0

type ListeningPort struct {
	Port    int    `json:"port"`
	Address string `json:"address"` // bind address: 127.0.0.1, 0.0.0.0, ::, ::1, or a specific interface
	Pid     int32  `json:"pid,omitempty"`
	Command string `json:"command,omitempty"`
	User    string `json:"user,omitempty"`
}

type ListeningPortsResponse added in v1.0.0

type ListeningPortsResponse struct {
	Ports    []ListeningPort `json:"ports"`
	Platform string          `json:"platform"`
	Partial  bool            `json:"partial,omitempty"` // owners of some sockets could not be read
}

type MetaSettingsType

type MetaSettingsType struct {
	waveobj.MetaMapType
}

func (MetaSettingsType) MarshalJSON

func (m MetaSettingsType) MarshalJSON() ([]byte, error)

func (*MetaSettingsType) UnmarshalJSON

func (m *MetaSettingsType) UnmarshalJSON(data []byte) error

type MultiArg

type MultiArg struct {
	Args []any `json:"args"`
}

type PathCommandData

type PathCommandData struct {
	PathType     string `json:"pathtype"`
	Open         bool   `json:"open"`
	OpenExternal bool   `json:"openexternal"`
	TabId        string `json:"tabid"`
}

type PortForwardInfo added in v1.0.0

type PortForwardInfo struct {
	Id          string `json:"id"`
	ConnName    string `json:"connname"`
	RemoteHost  string `json:"remotehost"`
	RemotePort  int    `json:"remoteport"`
	LocalPort   int    `json:"localport"`
	Status      string `json:"status"` // PortForwardStatus_*
	Error       string `json:"error,omitempty"`
	ActiveConns int    `json:"activeconns"`
	CreatedTs   int64  `json:"createdts"`
}

type ProcessInfo

type ProcessInfo struct {
	Pid        int32   `json:"pid"`
	Ppid       int32   `json:"ppid,omitempty"`
	Command    string  `json:"command,omitempty"`
	Status     string  `json:"status,omitempty"`
	User       string  `json:"user,omitempty"`
	Mem        int64   `json:"mem"`        // resident set size in bytes; -1 if unavailable
	MemPct     float64 `json:"mempct"`     // memory percent; -1 if unavailable
	Cpu        float64 `json:"cpu"`        // cpu percent; -1 if unavailable
	NumThreads int32   `json:"numthreads"` // -1 if unavailable
	Gone       bool    `json:"gone,omitempty"`
}

ProcessInfo holds per-process information for the process viewer. Mem, MemPct, Cpu, and NumThreads are set to -1 when the data is unavailable (e.g. permission denied reading another user's process on macOS).

type ProcessListResponse

type ProcessListResponse struct {
	Processes     []ProcessInfo  `json:"processes"`
	Summary       ProcessSummary `json:"summary"`
	Ts            int64          `json:"ts"`
	HasCPU        bool           `json:"hascpu,omitempty"`
	Platform      string         `json:"platform,omitempty"`
	TotalCount    int            `json:"totalcount,omitempty"`
	FilteredCount int            `json:"filteredcount,omitempty"`
}

type ProcessSummary

type ProcessSummary struct {
	Total    int     `json:"total"`
	Load1    float64 `json:"load1,omitempty"`
	Load5    float64 `json:"load5,omitempty"`
	Load15   float64 `json:"load15,omitempty"`
	MemTotal uint64  `json:"memtotal,omitempty"`
	MemUsed  uint64  `json:"memused,omitempty"`
	MemFree  uint64  `json:"memfree,omitempty"`
	NumCPU   int     `json:"numcpu,omitempty"`
	CpuSum   float64 `json:"cpusum,omitempty"`
}

type RemoteInfo

type RemoteInfo struct {
	ClientArch    string `json:"clientarch"`
	ClientOs      string `json:"clientos"`
	ClientVersion string `json:"clientversion"`
	Shell         string `json:"shell"`
	HomeDir       string `json:"homedir"`
}

type RespOrErrorUnion

type RespOrErrorUnion[T any] struct {
	Response T
	Error    error
}

type RpcContext

type RpcContext struct {
	SockName  string `json:"sockname,omitempty"`  // the domain socket name
	RouteId   string `json:"routeid"`             // the routeid from the jwt
	ProcRoute bool   `json:"procroute,omitempty"` // use a random procid for route
	BlockId   string `json:"blockid,omitempty"`   // blockid for this rpc
	Conn      string `json:"conn,omitempty"`      // the conn name
	IsRouter  bool   `json:"isrouter,omitempty"`  // if this is for a sub-router
}

func (RpcContext) GenerateRouteId

func (rc RpcContext) GenerateRouteId() string

type RpcOpts

type RpcOpts struct {
	Timeout    int64  `json:"timeout,omitempty"`
	NoResponse bool   `json:"noresponse,omitempty"`
	Route      string `json:"route,omitempty"`

	StreamCancelFn func(context.Context) error `json:"-"` // this is an *output* parameter, set by the handler
}

type StreamMeta

type StreamMeta struct {
	Id            string `json:"id"`   // streamid
	RWnd          int64  `json:"rwnd"` // initial receive window size
	ReaderRouteId string `json:"readerrouteid"`
	WriterRouteId string `json:"writerrouteid"`
}

type SuggestionType

type SuggestionType struct {
	Type         string `json:"type"`
	SuggestionId string `json:"suggestionid"`
	Display      string `json:"display"`
	SubText      string `json:"subtext,omitempty"`
	Icon         string `json:"icon,omitempty"`
	IconColor    string `json:"iconcolor,omitempty"`
	IconSrc      string `json:"iconsrc,omitempty"`
	MatchPos     []int  `json:"matchpos,omitempty"`
	SubMatchPos  []int  `json:"submatchpos,omitempty"`
	Score        int    `json:"score,omitempty"`
	FileMimeType string `json:"file:mimetype,omitempty"`
	FilePath     string `json:"file:path,omitempty"`
	FileName     string `json:"file:name,omitempty"`
	UrlUrl       string `json:"url:url,omitempty"`
}

type TimeSeriesData

type TimeSeriesData struct {
	Ts     int64              `json:"ts"`
	Values map[string]float64 `json:"values"`
	Disks  []DiskUsageData    `json:"disks,omitempty"`
	Gpus   []GpuData          `json:"gpus,omitempty"`
}

TimeSeriesData is one sysinfo sample. Values keys: cpu, cpu:<n>, mem:total|available|used|free (GB), swap:total|used (GB), load:1|5|15, net:up|down (bytes/s).

type VDomUrlRequestData

type VDomUrlRequestData struct {
	Method  string            `json:"method"`
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
	Body    []byte            `json:"body,omitempty"`
}

type VDomUrlRequestResponse

type VDomUrlRequestResponse struct {
	StatusCode int               `json:"statuscode,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	Body       []byte            `json:"body,omitempty"`
}

type WaveFileInfo

type WaveFileInfo struct {
	ZoneId    string   `json:"zoneid"`
	Name      string   `json:"name"`
	Opts      FileOpts `json:"opts"`
	CreatedTs int64    `json:"createdts"`
	Size      int64    `json:"size"`
	ModTs     int64    `json:"modts"`
	Meta      FileMeta `json:"meta"`
}

see blockstore.go (WaveFile)

type WaveInfoData

type WaveInfoData struct {
	Version   string `json:"version"`
	ClientId  string `json:"clientid"`
	BuildTime string `json:"buildtime"`
	ConfigDir string `json:"configdir"`
	DataDir   string `json:"datadir"`
}

type WaveNotificationOptions

type WaveNotificationOptions struct {
	Title   string `json:"title,omitempty"`
	Body    string `json:"body,omitempty"`
	Silent  bool   `json:"silent,omitempty"`
	TabId   string `json:"tabid,omitempty"`
	BlockId string `json:"blockid,omitempty"`
}

type WebSelectorOpts

type WebSelectorOpts struct {
	All   bool `json:"all,omitempty"`
	Inner bool `json:"inner,omitempty"`
}

type WorkspaceInfoData

type WorkspaceInfoData struct {
	WindowId      string             `json:"windowid"`
	WorkspaceData *waveobj.Workspace `json:"workspacedata"`
}

type WshRpcFileInterface

type WshRpcFileInterface interface {
	FileMkdirCommand(ctx context.Context, data FileData) error
	FileCreateCommand(ctx context.Context, data FileData) error
	FileDeleteCommand(ctx context.Context, data CommandDeleteFileData) error
	FileAppendCommand(ctx context.Context, data FileData) error
	FileWriteCommand(ctx context.Context, data FileData) error
	FileReadCommand(ctx context.Context, data FileData) (*FileData, error)
	FileMoveCommand(ctx context.Context, data CommandFileCopyData) error
	FileCopyCommand(ctx context.Context, data CommandFileCopyData) error
	FileDownloadDirectoryCommand(ctx context.Context, data CommandFileDownloadDirectoryData) chan RespOrErrorUnion[FileTransferProgress]
	FileInfoCommand(ctx context.Context, data FileData) (*FileInfo, error)
	FileListCommand(ctx context.Context, data FileListData) ([]*FileInfo, error)
	FileJoinCommand(ctx context.Context, paths []string) (*FileInfo, error)
	FileListStreamCommand(ctx context.Context, data FileListData) <-chan RespOrErrorUnion[CommandRemoteListEntriesRtnData]
	FileStreamCommand(ctx context.Context, data CommandFileStreamData) (*FileInfo, error)
}

type WshRpcInterface

type WshRpcInterface interface {
	AuthenticateCommand(ctx context.Context, data string) (CommandAuthenticateRtnData, error)
	AuthenticateTokenCommand(ctx context.Context, data CommandAuthenticateTokenData) (CommandAuthenticateRtnData, error)
	AuthenticateTokenVerifyCommand(ctx context.Context, data CommandAuthenticateTokenData) (CommandAuthenticateRtnData, error) // (special) validates token without binding, root router only
	AuthenticateJobManagerCommand(ctx context.Context, data CommandAuthenticateJobManagerData) error
	AuthenticateJobManagerVerifyCommand(ctx context.Context, data CommandAuthenticateJobManagerData) error // (special) validates job auth token without binding, root router only
	RouteAnnounceCommand(ctx context.Context) error                                                        // (special) announces a new route to the main router
	RouteUnannounceCommand(ctx context.Context) error                                                      // (special) unannounces a route to the main router
	ControlGetRouteIdCommand(ctx context.Context) (string, error)                                          // (special) gets the route for the link that we're on
	SetPeerInfoCommand(ctx context.Context, peerInfo string) error
	GetJwtPublicKeyCommand(ctx context.Context) (string, error) // (special) gets the public JWT signing key

	MessageCommand(ctx context.Context, data CommandMessageData) error
	GetMetaCommand(ctx context.Context, data CommandGetMetaData) (waveobj.MetaMapType, error)
	SetMetaCommand(ctx context.Context, data CommandSetMetaData) error
	ControllerInputCommand(ctx context.Context, data CommandBlockInputData) error
	ControllerDestroyCommand(ctx context.Context, blockId string) error
	ControllerResyncCommand(ctx context.Context, data CommandControllerResyncData) error
	ControllerAppendOutputCommand(ctx context.Context, data CommandControllerAppendOutputData) error
	ResolveIdsCommand(ctx context.Context, data CommandResolveIdsData) (CommandResolveIdsRtnData, error)
	CreateBlockCommand(ctx context.Context, data CommandCreateBlockData) (waveobj.ORef, error)
	CreateSubBlockCommand(ctx context.Context, data CommandCreateSubBlockData) (waveobj.ORef, error)
	DeleteBlockCommand(ctx context.Context, data CommandDeleteBlockData) error
	DeleteSubBlockCommand(ctx context.Context, data CommandDeleteBlockData) error
	WaitForRouteCommand(ctx context.Context, data CommandWaitForRouteData) (bool, error)

	EventPublishCommand(ctx context.Context, data wps.WaveEvent) error
	EventSubCommand(ctx context.Context, data wps.SubscriptionRequest) error
	EventUnsubCommand(ctx context.Context, data string) error
	EventReadHistoryCommand(ctx context.Context, data CommandEventReadHistoryData) ([]*wps.WaveEvent, error)

	WriteTempFileCommand(ctx context.Context, data CommandWriteTempFileData) (string, error)
	StreamTestCommand(ctx context.Context) chan RespOrErrorUnion[int]
	TestCommand(ctx context.Context, data string) error
	TestMultiArgCommand(ctx context.Context, arg1 string, arg2 int, arg3 bool) (string, error)
	SetConfigCommand(ctx context.Context, data MetaSettingsType) error
	SetConnectionsConfigCommand(ctx context.Context, data ConnConfigRequest) error
	UpdateSavedPortServiceCommand(ctx context.Context, data CommandUpdateSavedPortServiceData) ([]wconfig.SavedPortService, error)
	GetFullConfigCommand(ctx context.Context) (wconfig.FullConfigType, error)
	CommandAiStatusCommand(ctx context.Context, data CommandAiStatusRequest) (CommandAiStatus, error)
	CommandAiModelsCommand(ctx context.Context, data CommandAiModelsRequest) (CommandAiModels, error)
	CommandAiPreviewCommand(ctx context.Context, data CommandAiRequest) (CommandAiPreview, error)
	CommandAiRunCommand(ctx context.Context, data CommandAiRequest) (CommandAiResult, error)
	CommandAiCancelCommand(ctx context.Context, requestId string) error
	BlockInfoCommand(ctx context.Context, blockId string) (*BlockInfoData, error)
	DebugTermCommand(ctx context.Context, data CommandDebugTermData) (*CommandDebugTermRtnData, error)
	BlocksListCommand(ctx context.Context, data BlocksListRequest) ([]BlocksListEntry, error)
	WaveInfoCommand(ctx context.Context) (*WaveInfoData, error)
	MacOSVersionCommand(ctx context.Context) (string, error)
	WshActivityCommand(ct context.Context, data map[string]int) error
	ActivityCommand(ctx context.Context, data ActivityUpdate) error
	RecordTEventCommand(ctx context.Context, data telemetrydata.TEvent) error
	GetVarCommand(ctx context.Context, data CommandVarData) (*CommandVarResponseData, error)
	GetAllVarsCommand(ctx context.Context, data CommandVarData) ([]CommandVarResponseData, error)
	SetVarCommand(ctx context.Context, data CommandVarData) error
	PathCommand(ctx context.Context, data PathCommandData) (string, error)
	FetchSuggestionsCommand(ctx context.Context, data FetchSuggestionsData) (*FetchSuggestionsResponse, error)
	DisposeSuggestionsCommand(ctx context.Context, widgetId string) error
	RunCompletionGenCommand(ctx context.Context, data CommandRunCompletionGenData) (CommandRunCompletionGenRtnData, error)
	GitStatusCommand(ctx context.Context, data CommandGitStatusData) (*GitStatusResponse, error)
	PortForwardStartCommand(ctx context.Context, data CommandPortForwardStartData) (*PortForwardInfo, error)
	PortForwardStopCommand(ctx context.Context, data CommandPortForwardStopData) error
	PortForwardListCommand(ctx context.Context, data CommandPortForwardListData) ([]PortForwardInfo, error)
	UpdateTabNameCommand(ctx context.Context, tabId string, newName string) error
	UpdateWorkspaceTabIdsCommand(ctx context.Context, workspaceId string, tabIds []string) error
	GetAllBadgesCommand(ctx context.Context) ([]baseds.BadgeEvent, error)

	// connection functions
	ConnStatusCommand(ctx context.Context) ([]ConnStatus, error)
	WslStatusCommand(ctx context.Context) ([]ConnStatus, error)
	ConnEnsureCommand(ctx context.Context, data ConnExtData) error
	ConnReinstallWshCommand(ctx context.Context, data ConnExtData) error
	ConnConnectCommand(ctx context.Context, connRequest ConnRequest) error
	ConnDisconnectCommand(ctx context.Context, connName string) error
	ConnListCommand(ctx context.Context) ([]string, error)
	WslListCommand(ctx context.Context) ([]string, error)
	WslDefaultDistroCommand(ctx context.Context) (string, error)
	DismissWshFailCommand(ctx context.Context, connName string) error
	FindGitBashCommand(ctx context.Context, rescan bool) (string, error)
	ConnServerInitCommand(ctx context.Context, data CommandConnServerInitData) error
	NotifySystemResumeCommand(ctx context.Context) error

	// eventrecv is special, it's handled internally by WshRpc with EventListener
	EventRecvCommand(ctx context.Context, data wps.WaveEvent) error

	// remotes
	WshRpcRemoteFileInterface
	RemoteGetInfoCommand(ctx context.Context) (RemoteInfo, error)
	RemoteInstallRcFilesCommand(ctx context.Context) error
	RemoteStartJobCommand(ctx context.Context, data CommandRemoteStartJobData) (*CommandStartJobRtnData, error)
	RemoteReconnectToJobManagerCommand(ctx context.Context, data CommandRemoteReconnectToJobManagerData) (*CommandRemoteReconnectToJobManagerRtnData, error)
	RemoteDisconnectFromJobManagerCommand(ctx context.Context, data CommandRemoteDisconnectFromJobManagerData) error
	RemoteTerminateJobManagerCommand(ctx context.Context, data CommandRemoteTerminateJobManagerData) error
	BadgeWatchPidCommand(ctx context.Context, data CommandBadgeWatchPidData) error
	RemoteProcessListCommand(ctx context.Context, data CommandRemoteProcessListData) (*ProcessListResponse, error)
	RemoteProcessSignalCommand(ctx context.Context, data CommandRemoteProcessSignalData) error
	RemoteSysInfoWatchCommand(ctx context.Context, data CommandRemoteSysInfoWatchData) error
	RemoteHostInfoCommand(ctx context.Context) (*HostInfo, error)
	RemoteListeningPortsCommand(ctx context.Context) (*ListeningPortsResponse, error)

	// emain
	WebSelectorCommand(ctx context.Context, data CommandWebSelectorData) ([]string, error)
	NotifyCommand(ctx context.Context, notificationOptions WaveNotificationOptions) error
	FocusWindowCommand(ctx context.Context, windowId string) error
	ElectronEncryptCommand(ctx context.Context, data CommandElectronEncryptData) (*CommandElectronEncryptRtnData, error)
	ElectronDecryptCommand(ctx context.Context, data CommandElectronDecryptData) (*CommandElectronDecryptRtnData, error)
	NetworkOnlineCommand(ctx context.Context) (bool, error)
	ElectronSystemBellCommand(ctx context.Context) error

	// secrets
	GetSecretsCommand(ctx context.Context, names []string) (map[string]string, error)
	GetSecretsNamesCommand(ctx context.Context) ([]string, error)
	SetSecretsCommand(ctx context.Context, secrets map[string]*string) error
	GetSecretsLinuxStorageBackendCommand(ctx context.Context) (string, error)

	WorkspaceListCommand(ctx context.Context) ([]WorkspaceInfoData, error)
	GetUpdateChannelCommand(ctx context.Context) (string, error)

	// terminal
	VDomCreateContextCommand(ctx context.Context, data vdom.VDomCreateContext) (*waveobj.ORef, error)
	VDomAsyncInitiationCommand(ctx context.Context, data vdom.VDomAsyncInitiationRequest) error

	// block focus
	SetBlockFocusCommand(ctx context.Context, blockId string) error

	// rtinfo
	GetRTInfoCommand(ctx context.Context, data CommandGetRTInfoData) (*waveobj.ObjRTInfo, error)
	SetRTInfoCommand(ctx context.Context, data CommandSetRTInfoData) error

	// terminal
	TermGetScrollbackLinesCommand(ctx context.Context, data CommandTermGetScrollbackLinesData) (*CommandTermGetScrollbackLinesRtnData, error)
	TermCommandBlockCommand(ctx context.Context, data CommandTermCommandBlockData) (*CommandTermCommandBlockRtnData, error)

	// file
	WshRpcFileInterface
	WaveFileReadStreamCommand(ctx context.Context, data CommandWaveFileReadStreamData) (*WaveFileInfo, error)

	// proc
	VDomRenderCommand(ctx context.Context, data vdom.VDomFrontendUpdate) chan RespOrErrorUnion[*vdom.VDomBackendUpdate]
	VDomUrlRequestCommand(ctx context.Context, data VDomUrlRequestData) chan RespOrErrorUnion[VDomUrlRequestResponse]

	// streams
	StreamDataCommand(ctx context.Context, data CommandStreamData) error
	StreamDataAckCommand(ctx context.Context, data CommandStreamAckData) error

	// jobs
	AuthenticateToJobManagerCommand(ctx context.Context, data CommandAuthenticateToJobData) error
	StartJobCommand(ctx context.Context, data CommandStartJobData) (*CommandStartJobRtnData, error)
	JobPrepareConnectCommand(ctx context.Context, data CommandJobPrepareConnectData) (*CommandJobConnectRtnData, error)
	JobStartStreamCommand(ctx context.Context, data CommandJobStartStreamData) error
	JobInputCommand(ctx context.Context, data CommandJobInputData) error
	JobCmdExitedCommand(ctx context.Context, data CommandJobCmdExitedData) error // this is sent FROM the job manager => main server

	// job controller
	JobControllerDeleteJobCommand(ctx context.Context, jobId string) error
	JobControllerListCommand(ctx context.Context) ([]*waveobj.Job, error)
	JobControllerStartJobCommand(ctx context.Context, data CommandJobControllerStartJobData) (string, error)
	JobControllerExitJobCommand(ctx context.Context, jobId string) error
	JobControllerDisconnectJobCommand(ctx context.Context, jobId string) error
	JobControllerReconnectJobCommand(ctx context.Context, jobId string) error
	JobControllerReconnectJobsForConnCommand(ctx context.Context, connName string) error
	JobControllerConnectedJobsCommand(ctx context.Context) ([]string, error)
	JobControllerAttachJobCommand(ctx context.Context, data CommandJobControllerAttachJobData) error
	JobControllerDetachJobCommand(ctx context.Context, jobId string) error
	BlockJobStatusCommand(ctx context.Context, blockId string) (*BlockJobStatusData, error)
	DurableJobCountCommand(ctx context.Context, data CommandDurableJobCountData) (int, error)
}

type WshRpcMethodDecl

type WshRpcMethodDecl struct {
	Command                 string
	CommandType             string
	MethodName              string
	CommandDataTypes        []reflect.Type
	DefaultResponseDataType reflect.Type
}

func (*WshRpcMethodDecl) GetCommandDataTypes

func (decl *WshRpcMethodDecl) GetCommandDataTypes() []reflect.Type

type WshRpcRemoteFileInterface

type WshRpcRemoteFileInterface interface {
	RemoteFileStreamCommand(ctx context.Context, data CommandRemoteFileStreamData) (*FileInfo, error)
	RemoteFileCopyCommand(ctx context.Context, data CommandFileCopyData) (bool, error)
	RemoteListEntriesCommand(ctx context.Context, data CommandRemoteListEntriesData) chan RespOrErrorUnion[CommandRemoteListEntriesRtnData]
	RemoteFileInfoCommand(ctx context.Context, path string) (*FileInfo, error)
	RemoteFileMultiInfoCommand(ctx context.Context, data CommandRemoteFileMultiInfoData) (map[string]FileInfo, error)
	RemoteFileTouchCommand(ctx context.Context, path string) error
	RemoteFileMoveCommand(ctx context.Context, data CommandFileCopyData) error
	RemoteFileDeleteCommand(ctx context.Context, data CommandDeleteFileData) error
	RemoteWriteFileCommand(ctx context.Context, data FileData) error
	RemoteFileJoinCommand(ctx context.Context, paths []string) (*FileInfo, error)
	RemoteMkdirCommand(ctx context.Context, path string) error
}

type WshServerCommandMeta

type WshServerCommandMeta struct {
	CommandType string `json:"commandtype"`
}

for frontend

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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