Documentation
¶
Index ¶
- func EscapeJSString(s string) string
- func LooksLikeSyntaxError(msg string) bool
- type ClientArgs
- func (a *ClientArgs) BuildClient() (s4wave_debug.SRPCDebugBridgeServiceClient, error)
- func (a *ClientArgs) BuildCommands() []*cli.Command
- func (a *ClientArgs) BuildCoreClient() (srpc.Client, error)
- func (a *ClientArgs) BuildFlags() []cli.Flag
- func (a *ClientArgs) BuildSpaceCommand() *appcli.Command
- func (a *ClientArgs) BuildSrpcClient() (srpc.Client, error)
- func (a *ClientArgs) DialPluginRpc(pluginID string) (srpc.Client, error)
- func (a *ClientArgs) EvalCode(ctx context.Context, code string) error
- func (a *ClientArgs) GetContext() context.Context
- func (a *ClientArgs) MountSession(ctx context.Context, sessionIdx uint32) (*s4wave_session.Session, func(), error)
- func (a *ClientArgs) RunCreateSpace(c *cli.Context) error
- func (a *ClientArgs) RunEval(c *cli.Context) error
- func (a *ClientArgs) RunEvalJSON(ctx context.Context, code string, fn func(*fastjson.Value)) error
- func (a *ClientArgs) RunInfo(c *cli.Context) error
- func (a *ClientArgs) RunListSpaces(c *cli.Context) error
- func (a *ClientArgs) RunWait(c *cli.Context) error
- func (a *ClientArgs) SetContext(c context.Context)
- type SpaceArgs
- func (sa *SpaceArgs) RunAddPlugin(c *appcli.Context) error
- func (sa *SpaceArgs) RunPlugins(c *appcli.Context) error
- func (sa *SpaceArgs) RunRemovePlugin(c *appcli.Context) error
- func (sa *SpaceArgs) RunSetPluginApproval(c *appcli.Context) error
- func (sa *SpaceArgs) RunStatus(c *appcli.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeJSString ¶
EscapeJSString returns s as a safe JavaScript string literal (with quotes).
func LooksLikeSyntaxError ¶
LooksLikeSyntaxError returns true if the error message suggests shell quoting issues.
Types ¶
type ClientArgs ¶
type ClientArgs struct {
// SessionIdx is the session index to use.
SessionIdx uint
// EvalFilePath is the path to a JS file for eval.
EvalFilePath string
// SpaceName is the name for create-space.
SpaceName string
// WebPkgs is extra web packages for the eval bundler.
WebPkgs cli.StringSlice
// contains filtered or unexported fields
}
ClientArgs contains the client arguments and functions.
func (*ClientArgs) BuildClient ¶
func (a *ClientArgs) BuildClient() (s4wave_debug.SRPCDebugBridgeServiceClient, error)
BuildClient builds or returns the cached debug bridge client.
func (*ClientArgs) BuildCommands ¶
func (a *ClientArgs) BuildCommands() []*cli.Command
BuildCommands returns the command list.
func (*ClientArgs) BuildCoreClient ¶
func (a *ClientArgs) BuildCoreClient() (srpc.Client, error)
BuildCoreClient returns an SRPC client connected to the spacewave-core plugin via PluginRpc. Reusable for any RPC that needs core bus access.
func (*ClientArgs) BuildFlags ¶
func (a *ClientArgs) BuildFlags() []cli.Flag
BuildFlags returns the common flags.
func (*ClientArgs) BuildSpaceCommand ¶
func (a *ClientArgs) BuildSpaceCommand() *appcli.Command
BuildSpaceCommand returns the space command with subcommands.
func (*ClientArgs) BuildSrpcClient ¶
func (a *ClientArgs) BuildSrpcClient() (srpc.Client, error)
BuildSrpcClient builds or returns the cached SRPC client for the debug socket.
func (*ClientArgs) DialPluginRpc ¶
func (a *ClientArgs) DialPluginRpc(pluginID string) (srpc.Client, error)
DialPluginRpc opens a PluginRpc stream to the given plugin via the debug bridge, returning an srpc.Client for that plugin's RPC services.
func (*ClientArgs) EvalCode ¶
func (a *ClientArgs) EvalCode(ctx context.Context, code string) error
EvalCode evaluates JavaScript code and prints the result to stdout.
func (*ClientArgs) GetContext ¶
func (a *ClientArgs) GetContext() context.Context
GetContext returns the context. Falls back to context.Background() for CLI entrypoints where no caller context is available.
func (*ClientArgs) MountSession ¶
func (a *ClientArgs) MountSession(ctx context.Context, sessionIdx uint32) (*s4wave_session.Session, func(), error)
MountSession opens a ResourceClient via PluginRpc to spacewave-core, mounts a session by index via the root resource, and returns the Session SDK wrapper along with a cleanup function.
func (*ClientArgs) RunCreateSpace ¶
func (a *ClientArgs) RunCreateSpace(c *cli.Context) error
RunCreateSpace creates a new space.
func (*ClientArgs) RunEval ¶
func (a *ClientArgs) RunEval(c *cli.Context) error
RunEval evaluates JavaScript code in the page context.
func (*ClientArgs) RunEvalJSON ¶
RunEvalJSON evaluates code via EvalJS and parses the JSON result with fastjson.
func (*ClientArgs) RunInfo ¶
func (a *ClientArgs) RunInfo(c *cli.Context) error
RunInfo returns information about the current page.
func (*ClientArgs) RunListSpaces ¶
func (a *ClientArgs) RunListSpaces(c *cli.Context) error
RunListSpaces lists spaces in the current session.
func (*ClientArgs) RunWait ¶
func (a *ClientArgs) RunWait(c *cli.Context) error
RunWait polls until the debug bridge is ready and responds.
func (*ClientArgs) SetContext ¶
func (a *ClientArgs) SetContext(c context.Context)
SetContext sets the context.
type SpaceArgs ¶
type SpaceArgs struct {
// SpaceID is the target space ID.
SpaceID string
// PluginID is the target plugin manifest ID.
PluginID string
// Approved is the approval state for set-plugin-approval.
Approved bool
// contains filtered or unexported fields
}
SpaceArgs contains space subcommand arguments.
func (*SpaceArgs) RunAddPlugin ¶
RunAddPlugin adds a plugin to the space settings.
func (*SpaceArgs) RunPlugins ¶
RunPlugins prints plugin statuses by calling MountSpaceContents + WatchState. This mirrors exactly what the UI SpacePlugins component does.
func (*SpaceArgs) RunRemovePlugin ¶
RunRemovePlugin removes a plugin from the space settings.
func (*SpaceArgs) RunSetPluginApproval ¶
RunSetPluginApproval sets the approval state for a plugin.