Aartiq
Aartiq™
Download
API Reference

Developer API

IPC handler reference for Aartiq. Main process handlers in main.js, src/main/handlers/, preload.js

Inter-Process Communication

IPC Handlers

The bridge is window.electronAPI, the single global contextBridge exposes in preload.js. Each channel is reached through a named method on it, not through a generic invoke.

Correction: an earlier version of this page stated a window.electron global. No preload creates it, so every example written against it threw a TypeError on its first line. The examples above were rewritten against methods verified to exist.

Browser Control

12 handlers

Source: src/core/window-manager.js, src/lib/screen-vision-service.js
get-open-tabs
→ Tab[]

Returns all open tabs with their URLs and titles

navigate-to(url: string)
→ void

Navigate the active tab to the specified URL

capture-browser-view-screenshot
→ Buffer

Capture screenshot of the current browser view

capture-page-html
→ string

Get the raw HTML of the current page

extract-page-content
→ string

Extract readable text content from the page

find-and-click-text(text: string)
→ boolean

Resolve visible text and click it through the shared native-first OCR service

perform-ocr({ useNative?, bounds?, language?, imagePath? })
→ OCRResult

Run OCR with native providers first and Tesseract fallback

ocr-capture-words(displayId?: string)
→ OCRCaptureResult

Capture OCR words and lines for the display

ocr-click({ target, useAi? })
→ OCRClickResult

Resolve and click a visible target using native-first OCR

ocr-screen-text(displayId?: string)
→ string

Return extracted screen text for a display

perform-cross-app-click({ x, y, button?, doubleClick? })
→ boolean

Click a coordinate in another application after permission checks

get-selected-text
→ string

Get currently selected text in the browser

Type Definitions

Data Models

Task

Represents a scheduled automation task

FieldTypeDescription
idstringUnique identifier
namestringHuman-readable task name
typeTaskTypepdf | scrape | prompt | workflow
triggerTriggerScheduling configuration
configTaskConfigTask-specific configuration
enabledbooleanWhether the task is active
priorityPriorityhigh | normal | low
modelstringAI model to use
outputDirstringOutput directory path
notifyOnCompletebooleanSend notification on completion
lastRunDate?Last execution time
nextRunDate?Next scheduled execution
runCountnumberTotal execution count
lastStatusstring?success | failed | running
lastErrorstring?Last error message

Trigger

Defines when a task should execute

FieldTypeDescription
typeTriggerTypecron | once | interval
schedulestring?Cron expression (for type=cron)
datetimestring?ISO datetime (for type=once)
intervalMsnumber?Interval in milliseconds (for type=interval)
timezonestring?Timezone (default: UTC)

TaskConfig

Configuration for different task types

FieldTypeDescription
promptstring?AI prompt to execute
pdfOptionsPDFOptions?PDF generation options
scrapeUrlsstring[]?URLs to scrape
workflowStepsWorkflowStep[]?Multi-step workflow definition
emailRecipientsstring[]?Email addresses to notify

ShellResult

Result of a shell command execution

FieldTypeDescription
successbooleanWhether the command succeeded
stdoutstringStandard output
stderrstringStandard error
exitCodenumberProcess exit code
durationnumberExecution time in ms

AppleIntelligenceStatus

Runtime availability and readiness information for Apple Intelligence on macOS

FieldTypeDescription
successbooleanWhether the status check completed successfully
osVersionstring?Detected macOS runtime version string
summaryAvailableboolean?Whether Foundation Models summary generation passed readiness checks
summaryReasonstring?Why summaries are unavailable or blocked
imageAvailableboolean?Whether Apple image generation is available right now
imageReasonstring?Why Apple image generation is unavailable
genmojiAvailableboolean?Whether Genmoji is available right now (macOS 15.4+)
genmojiReasonstring?Why Genmoji is unavailable

Usage Examples

Code Snippets

Guidelines

Error Handling

Best Practices

  • Always check the return value for success/error properties
  • Wrap IPC calls in try-catch for network failures
  • Use the status code to determine error type
  • Implement retry logic for transient failures
  • Log errors for debugging but don't expose to users

Security Notes

  • Shell commands require risk level and reason
  • High-risk actions need mobile approval via QR
  • Never expose raw command strings to users
  • Validate all inputs before passing to IPC
  • Rate limit sensitive operations