axengine

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 46 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const DefaultCLIVisibilityDelay = defaultCLIVisibilityDelay

DefaultCLIVisibilityDelay is the default post-action linger duration for CLI visual feedback overlays.

Variables

This section is empty.

Functions

func CaptureWindowByName

func CaptureWindowByName(appName string) ([]byte, error)

CaptureWindowByName captures the first window of appName as PNG bytes.

func EnvFlag

func EnvFlag(name string, def bool) bool

EnvFlag reads a boolean feature flag from AXMCP_FLAGS or AXMCP_FLAG_*.

func IsTTY

func IsTTY() bool

IsTTY reports whether stdin is an interactive terminal.

func NewAppshotCommand

func NewAppshotCommand() *cobra.Command

NewAppshotCommand returns the shared appshot capture command.

func NewCLICommand

func NewCLICommand(name string) *cobra.Command

NewCLICommand constructs a fresh Cobra subcommand for name. It returns nil if name is not a known axmcp CLI subcommand.

func RegisterTool

func RegisterTool(s *mcp.Server, name string) bool

RegisterTool registers the named AX MCP tool on s. It returns false if name is not a known AX tool.

func RunAppshotCLI

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

RunAppshotCLI executes the appshot subcommand directly with args and streams.

func SetAccessibilityWait

func SetAccessibilityWait(d time.Duration)

SetAccessibilityWait configures how long AX operations wait for Accessibility permission to be granted before returning an error.

func SetCLIVisibility

func SetCLIVisibility(enabled bool, delay time.Duration)

SetCLIVisibility configures post-action CLI visual feedback lingering.

func SetDiagnosticWriter

func SetDiagnosticWriter(w io.Writer)

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

func WriteScreenshot(out string, png []byte) error

WriteScreenshot writes png bytes to out (or a timestamped file if out is empty) and reports the saved path to os.Stdout.

func WriteScreenshotTo

func WriteScreenshotTo(w io.Writer, out string, png []byte) error

WriteScreenshotTo writes png bytes to out (or a timestamped file if out is empty) and reports the saved path to w.

Types

type InvalidRegionError

type InvalidRegionError struct {
	Region ocrRegion
	ImgW   int
	ImgH   int
}

InvalidRegionError indicates that an OCR region of interest is empty or lies outside the captured image.

func (*InvalidRegionError) Error

func (e *InvalidRegionError) Error() string

Jump to

Keyboard shortcuts

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