wcore

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

wave core application coordinator

Index

Constants

View Source
const (
	LayoutActionDataType_Insert          = "insert"
	LayoutActionDataType_InsertAtIndex   = "insertatindex"
	LayoutActionDataType_Remove          = "delete"
	LayoutActionDataType_ClearTree       = "clear"
	LayoutActionDataType_Replace         = "replace"
	LayoutActionDataType_SplitHorizontal = "splithorizontal"
	LayoutActionDataType_SplitVertical   = "splitvertical"
	LayoutActionDataType_CleanupOrphaned = "cleanuporphaned"
)

Variables

View Source
var WorkspaceColors = [...]string{
	"#00CED1",
	"#00FFDB",
	"#429DFF",
	"#BF55EC",
	"#FF453A",
	"#FF9500",
	"#FFE900",
}
View Source
var WorkspaceIcons = [...]string{
	"terminal",
	"triangle",
	"star",
	"heart",
	"bolt",
	"solid@cloud",
	"moon",
	"layer-group",
	"rocket",
	"flask",
	"paperclip",
	"chart-line",
	"graduation-cap",
	"mug-hot",
}

Functions

func ApplyPortableLayout

func ApplyPortableLayout(ctx context.Context, tabId string, layout PortableLayout, recordTelemetry bool) error

func BootstrapStarterLayout

func BootstrapStarterLayout(ctx context.Context) error

func CheckAndFixWindow

func CheckAndFixWindow(ctx context.Context, windowId string) *waveobj.Window

func CloseWindow

func CloseWindow(ctx context.Context, windowId string, fromElectron bool) error

CloseWindow closes a window and deletes its workspace if it is empty and not named. If fromElectron is true, it does not send an event to Electron.

func CreateBlock

func CreateBlock(ctx context.Context, tabId string, blockDef *waveobj.BlockDef, rtOpts *waveobj.RuntimeOpts) (rtnBlock *waveobj.Block, rtnErr error)

func CreateBlockWithTelemetry

func CreateBlockWithTelemetry(ctx context.Context, tabId string, blockDef *waveobj.BlockDef, rtOpts *waveobj.RuntimeOpts, recordTelemetry bool) (rtnBlock *waveobj.Block, rtnErr error)

func CreateClient

func CreateClient(ctx context.Context) (*waveobj.Client, error)

func CreateSubBlock

func CreateSubBlock(ctx context.Context, blockId string, blockDef *waveobj.BlockDef) (*waveobj.Block, error)

func CreateTab

func CreateTab(ctx context.Context, workspaceId string, tabName string, activateTab bool, isInitialLaunch bool) (string, error)

returns tabid

func CreateWindow

func CreateWindow(ctx context.Context, winSize *waveobj.WinSize, workspaceId string) (*waveobj.Window, error)

func CreateWorkspace

func CreateWorkspace(ctx context.Context, name string, icon string, color string, applyDefaults bool, isInitialLaunch bool) (*waveobj.Workspace, error)

func DeleteBlock

func DeleteBlock(ctx context.Context, blockId string, recursive bool) error

Must delete all blocks individually first. Also deletes LayoutState. recursive: if true, will recursively close parent tab, window, workspace, if they are empty. Returns new active tab id, error.

func DeleteTab

func DeleteTab(ctx context.Context, workspaceId string, tabId string, recursive bool) (string, error)

Must delete all blocks individually first. Also deletes LayoutState. recursive: if true, will recursively close parent window, workspace, if they are empty. Returns new active tab id, error.

func DeleteWorkspace

func DeleteWorkspace(ctx context.Context, workspaceId string, force bool) (bool, string, error)

If force is true, it will delete even if workspace is named. If workspace is empty, it will be deleted, even if it is named. Returns true if workspace was deleted, false if it was not deleted.

func EnsureInitialData

func EnsureInitialData() (bool, error)

Ensures that the initial data is present in the store, creates an initial window if needed

func FocusWindow

func FocusWindow(ctx context.Context, windowId string) error

func GetAllTabIndicators

func GetAllTabIndicators() map[string]*wshrpc.TabIndicator

func GetClientData

func GetClientData(ctx context.Context) (*waveobj.Client, error)

func GetLayoutIdForTab

func GetLayoutIdForTab(ctx context.Context, tabId string) (string, error)

func GetTabIndicator

func GetTabIndicator(tabId string) *wshrpc.TabIndicator

func GetWindow

func GetWindow(ctx context.Context, windowId string) (*waveobj.Window, error)

func GetWorkspace

func GetWorkspace(ctx context.Context, wsID string) (*waveobj.Workspace, error)

func GoSendNoTelemetryUpdate

func GoSendNoTelemetryUpdate(telemetryEnabled bool)

func InitMainServer

func InitMainServer() error

func InitTabIndicatorStore

func InitTabIndicatorStore()

func ListWorkspaces

func ListWorkspaces(ctx context.Context) (waveobj.WorkspaceList, error)

func QueueLayoutAction

func QueueLayoutAction(ctx context.Context, layoutStateId string, actions ...waveobj.LayoutActionData) error

func QueueLayoutActionForTab

func QueueLayoutActionForTab(ctx context.Context, tabId string, actions ...waveobj.LayoutActionData) error

func ResolveBlockIdFromPrefix

func ResolveBlockIdFromPrefix(ctx context.Context, tabId string, blockIdPrefix string) (string, error)

func SendActiveTabUpdate

func SendActiveTabUpdate(ctx context.Context, workspaceId string, newActiveTabId string)

func SendWaveObjUpdate

func SendWaveObjUpdate(oref waveobj.ORef)

func SetActiveTab

func SetActiveTab(ctx context.Context, workspaceId string, tabId string) error

func SetColor

func SetColor(workspaceId string, color string) error

func SetIcon

func SetIcon(workspaceId string, icon string) error

func SetName

func SetName(workspaceId string, name string) error

func SwitchWorkspace

func SwitchWorkspace(ctx context.Context, windowId string, workspaceId string) (*waveobj.Workspace, error)

func UpdateWorkspace

func UpdateWorkspace(ctx context.Context, workspaceId string, name string, icon string, color string, applyDefaults bool) (*waveobj.Workspace, bool, error)

Returns updated workspace, whether it was updated, error.

func UpdateWorkspaceTabIds

func UpdateWorkspaceTabIds(ctx context.Context, workspaceId string, tabIds []string) error

Types

type PortableLayout

type PortableLayout []struct {
	IndexArr []int             `json:"indexarr"`
	Size     *uint             `json:"size,omitempty"`
	BlockDef *waveobj.BlockDef `json:"blockdef"`
	Focused  bool              `json:"focused"`
}

func GetNewTabLayout

func GetNewTabLayout() PortableLayout

func GetStarterLayout

func GetStarterLayout() PortableLayout

type TabIndicatorStore

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

Jump to

Keyboard shortcuts

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