Documentation
¶
Index ¶
- func BridgeEvaluate(script string) (any, error)
- func BridgeNavigate(url string) error
- func BridgeScreenshot() (string, error)
- func BridgeStatus() (connected bool, version string)
- func EnsureDaemon()
- func ReadDaemonPID() int
- func RemoveDaemonPID()
- func WriteDaemonPID(pid int)
- type Adapter
- type CLIAdapter
- type Daemon
- type OpenAPIAdapter
- type PipelineAdapter
- type Result
- type ScriptAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BridgeEvaluate ¶ added in v0.5.0
BridgeEvaluate executes JavaScript in the browser via the extension bridge.
func BridgeNavigate ¶ added in v0.5.0
BridgeNavigate opens a URL in the browser via the extension bridge.
func BridgeScreenshot ¶ added in v0.7.0
BridgeScreenshot captures a screenshot of the current browser tab via the extension bridge. Returns the base64-encoded PNG data.
func BridgeStatus ¶ added in v0.5.0
BridgeStatus checks if the AnyClaw browser extension is connected.
func EnsureDaemon ¶ added in v0.5.0
func EnsureDaemon()
EnsureDaemon starts the daemon if it's not already running.
func ReadDaemonPID ¶ added in v0.5.0
func ReadDaemonPID() int
ReadDaemonPID reads the saved daemon PID.
func WriteDaemonPID ¶ added in v0.5.0
func WriteDaemonPID(pid int)
WriteDaemonPID saves daemon PID to a file for management.
Types ¶
type Adapter ¶
type Adapter interface {
Execute(ctx context.Context, cmd *pkg.Command, params map[string]any, packageDir string) (*Result, error)
}
Adapter executes a command with given parameters.
type CLIAdapter ¶
type CLIAdapter struct{}
CLIAdapter executes commands by shelling out to CLI tools.
type Daemon ¶ added in v0.5.0
type Daemon struct {
// contains filtered or unexported fields
}
Daemon bridges the browser extension (WebSocket) and CLI commands (HTTP). Bridges the AnyClaw browser extension and CLI commands.
type OpenAPIAdapter ¶
type OpenAPIAdapter struct{}
OpenAPIAdapter executes commands via HTTP API calls.
type Result ¶
type Result struct {
Content string // human-readable text
Data map[string]any // structured data (optional)
}
Result holds the output of a command execution.
type ScriptAdapter ¶
type ScriptAdapter struct{}
ScriptAdapter executes commands by running Python or Node scripts. Convention: script reads JSON params from stdin, writes result to stdout.