waveterm/pkg/wps/wpstypes.go
Mike Sawka 347eef289d
more builder updates (#2553)
* load manifest metadata into the FE
* builder only edits draft/ apps (convert local => draft)
* gofmt app.go after saving (AI tools and manual user save)
* dont open duplicate builder windows
* remix app context menu in waveapp
* add icon/iconcolor in appmeta and implement in the wave block frame
2025-11-13 22:47:46 -08:00

57 lines
1.6 KiB
Go

// Copyright 2025, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
package wps
import "github.com/wavetermdev/waveterm/pkg/util/utilfn"
const (
Event_BlockClose = "blockclose"
Event_ConnChange = "connchange"
Event_SysInfo = "sysinfo"
Event_ControllerStatus = "controllerstatus"
Event_BuilderStatus = "builderstatus"
Event_BuilderOutput = "builderoutput"
Event_WaveObjUpdate = "waveobj:update"
Event_BlockFile = "blockfile"
Event_Config = "config"
Event_UserInput = "userinput"
Event_RouteGone = "route:gone"
Event_WorkspaceUpdate = "workspace:update"
Event_WaveAIRateLimit = "waveai:ratelimit"
Event_WaveAppAppGoUpdated = "waveapp:appgoupdated"
Event_TsunamiUpdateMeta = "tsunami:updatemeta"
)
type WaveEvent struct {
Event string `json:"event"`
Scopes []string `json:"scopes,omitempty"`
Sender string `json:"sender,omitempty"`
Persist int `json:"persist,omitempty"`
Data any `json:"data,omitempty"`
}
func (e WaveEvent) HasScope(scope string) bool {
return utilfn.ContainsStr(e.Scopes, scope)
}
type SubscriptionRequest struct {
Event string `json:"event"`
Scopes []string `json:"scopes,omitempty"`
AllScopes bool `json:"allscopes,omitempty"`
}
const (
FileOp_Create = "create"
FileOp_Delete = "delete"
FileOp_Append = "append"
FileOp_Truncate = "truncate"
FileOp_Invalidate = "invalidate"
)
type WSFileEventData struct {
ZoneId string `json:"zoneid"`
FileName string `json:"filename"`
FileOp string `json:"fileop"`
Data64 string `json:"data64"`
}