Documentation
¶
Overview ¶
Package axengine implements the macOS Accessibility, OCR, screenshot, appshot, pipeline, and MCP tool handlers used by package axmcp and cmd/axmcp.
Index ¶
- Constants
- func CaptureWindowByName(appName string) ([]byte, error)
- func EnvFlag(name string, def bool) bool
- func IsTTY() bool
- func NewAppshotCommand() *cobra.Command
- func NewCLICommand(name string) *cobra.Command
- func RegisterTool(s *mcp.Server, name string) bool
- func RunAppshotCLI(ctx context.Context, args []string, stdout, stderr io.Writer) error
- func SetAccessibilityWait(d time.Duration)
- func SetCLIVisibility(enabled bool, delay time.Duration)
- func SetDiagnosticWriter(w io.Writer)
- func WaitForCLIVisualFeedback()
- func WriteScreenshot(out string, png []byte) error
- func WriteScreenshotTo(w io.Writer, out string, png []byte) error
- type InvalidRegionError
Constants ¶
const DefaultCLIVisibilityDelay = defaultCLIVisibilityDelay
DefaultCLIVisibilityDelay is the default post-action linger duration for CLI visual feedback overlays.
Variables ¶
This section is empty.
Functions ¶
func CaptureWindowByName ¶
CaptureWindowByName captures the first window of appName as PNG bytes.
func NewAppshotCommand ¶
NewAppshotCommand returns the shared appshot capture command.
func NewCLICommand ¶
NewCLICommand constructs a fresh Cobra subcommand for name. It returns nil if name is not a known axmcp CLI subcommand.
func RegisterTool ¶
RegisterTool registers the named AX MCP tool on s. It returns false if name is not a known AX tool.
func RunAppshotCLI ¶
RunAppshotCLI executes the appshot subcommand directly with args and streams.
func SetAccessibilityWait ¶
SetAccessibilityWait configures how long AX operations wait for Accessibility permission to be granted before returning an error.
func SetCLIVisibility ¶
SetCLIVisibility configures post-action CLI visual feedback lingering.
func SetDiagnosticWriter ¶
SetDiagnosticWriter directs diagnostic log lines to w. Passing nil restores os.Stderr.
func WaitForCLIVisualFeedback ¶
func WaitForCLIVisualFeedback()
WaitForCLIVisualFeedback sleeps briefly if a CLI command triggered visual feedback and visibility lingering is enabled.
func WriteScreenshot ¶
WriteScreenshot writes png bytes to out (or a timestamped file if out is empty) and reports the saved path to os.Stdout.
Types ¶
type InvalidRegionError ¶
InvalidRegionError indicates that an OCR region of interest is empty or lies outside the captured image.
func (*InvalidRegionError) Error ¶
func (e *InvalidRegionError) Error() string
Source Files
¶
- api.go
- appshot.go
- artifacts.go
- cli.go
- coords.go
- doc.go
- feature_flags.go
- focusstate.go
- highlight.go
- image_diff.go
- matcher.go
- menu.go
- ocr.go
- ocr_diff.go
- ocr_overlay.go
- pipeline.go
- pointer.go
- scope.go
- screenshot.go
- tools.go
- tools_action_screenshot.go
- tools_appshot.go
- tools_interaction.go
- tools_ocr_action_diff.go
- tools_ocr_click.go
- tools_window.go
- typing_cursor.go