desktopruntime

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 1

Variables

This section is empty.

Functions

func DefaultRuntimeRoot added in v0.7.3

func DefaultRuntimeRoot() string

DefaultRuntimeRoot 只由 macOS App 内置后台服务使用;其他平台继续要求调用方显式传入。

func DispatchControlRequest

func DispatchControlRequest(ctx context.Context, request desktopcontrol.Request) (any, error)

DispatchControlRequest 是后台核心的本地控制 API。这里只暴露桌面日常管理能力, 安装、卸载和提权仍由系统安装器负责。

func PathForBinary

func PathForBinary(binaryPath string) string

func PrepareCoreEnvironment

func PrepareCoreEnvironment(runtimeRoot string) error

func RunConfigCommand

func RunConfigCommand(ctx context.Context, args []string, stdout, stderr io.Writer) error

func RunServiceCommand

func RunServiceCommand(ctx context.Context, args []string, stdout, stderr io.Writer) error

func RunTunnelCommand

func RunTunnelCommand(ctx context.Context, args []string, stdout, stderr io.Writer) error

func Save

func Save(path string, manifest Manifest) error

Types

type ConfigUpdateRequest

type ConfigUpdateRequest struct {
	RuntimeRoot    string
	Port           int
	LogLevel       string
	NexusEndpoint  string
	NexusTokenFile string
	BrowserEnabled bool
	ACPEnabled     bool
	ACPAgent       string
}

ConfigUpdateRequest 是桌面端保存日常运行设置时使用的结构化请求。

type Manifest

type Manifest struct {
	SchemaVersion               int    `json:"schema_version"`
	InstallRoot                 string `json:"install_root,omitempty"`
	AgentDockBinary             string `json:"agentdock_binary"`
	TrayBinary                  string `json:"tray_binary,omitempty"`
	AgentDockLauncher           string `json:"agentdock_launcher,omitempty"`
	AgentDockTaskName           string `json:"agentdock_task_name,omitempty"`
	PrivilegeMode               string `json:"privilege_mode,omitempty"`
	CloudflaredBinary           string `json:"cloudflared_binary,omitempty"`
	CloudflaredLauncher         string `json:"cloudflared_launcher,omitempty"`
	StartupValueName            string `json:"startup_value_name,omitempty"`
	TrayStartupValueName        string `json:"tray_startup_value_name,omitempty"`
	CloudflaredStartupValueName string `json:"cloudflared_startup_value_name,omitempty"`
	Host                        string `json:"host"`
	Port                        int    `json:"port"`
	LocalMCPURL                 string `json:"local_mcp_url"`
	TunnelMode                  string `json:"tunnel_mode"`
	PublicURL                   string `json:"public_url,omitempty"`
	InstallChannel              string `json:"install_channel"`
}

func Load

func Load(path string) (Manifest, error)

func LoadForBinary

func LoadForBinary(binaryPath string) (Manifest, error)

func (Manifest) HealthURL

func (manifest Manifest) HealthURL() string

func (Manifest) UsesScheduledTask

func (manifest Manifest) UsesScheduledTask() bool

func (Manifest) Validate

func (manifest Manifest) Validate() error

type ServiceStatus

type ServiceStatus struct {
	Running        bool `json:"running"`
	Healthy        bool `json:"healthy"`
	StartupEnabled bool `json:"startup_enabled"`
}

ServiceStatus 是桌面端和 CLI 共享的结构化运行状态。 生命周期操作统一返回 JSON,避免桌面端继续解析 PowerShell 文本。

type TunnelConfigureRequest

type TunnelConfigureRequest struct {
	RuntimeRoot string
	Mode        string
	ServerURL   string
	TokenFile   string
}

type TunnelStatus

type TunnelStatus struct {
	Mode           string `json:"mode"`
	Running        bool   `json:"running"`
	Ready          bool   `json:"ready"`
	StartupEnabled bool   `json:"startup_enabled"`
	PublicURL      string `json:"public_url,omitempty"`
}

TunnelStatus 是桌面端和 CLI 共享的结构化 Tunnel 状态。

Jump to

Keyboard shortcuts

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