superbased 1.6.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -36
- package/SUPERBASED_SKILL.md +1196 -22
- package/dist/electron/core/input-injection/index.d.ts +6 -0
- package/dist/electron/core/input-injection/index.d.ts.map +1 -0
- package/dist/electron/core/input-injection/index.js +31 -0
- package/dist/electron/core/input-injection/index.js.map +1 -0
- package/dist/electron/core/input-injection/macos.d.ts +3 -0
- package/dist/electron/core/input-injection/macos.d.ts.map +1 -0
- package/dist/electron/core/input-injection/macos.js +14 -0
- package/dist/electron/core/input-injection/macos.js.map +1 -0
- package/dist/electron/core/input-injection/windows.d.ts +3 -0
- package/dist/electron/core/input-injection/windows.d.ts.map +1 -0
- package/dist/electron/core/input-injection/windows.js +119 -0
- package/dist/electron/core/input-injection/windows.js.map +1 -0
- package/dist/electron/core/json-store.d.ts +22 -0
- package/dist/electron/core/json-store.d.ts.map +1 -1
- package/dist/electron/core/json-store.js +61 -47
- package/dist/electron/core/json-store.js.map +1 -1
- package/dist/electron/core/platform.d.ts +1 -0
- package/dist/electron/core/platform.d.ts.map +1 -1
- package/dist/electron/core/serialize-schema.d.ts +35 -0
- package/dist/electron/core/serialize-schema.d.ts.map +1 -0
- package/dist/electron/core/serialize-schema.js +89 -0
- package/dist/electron/core/serialize-schema.js.map +1 -0
- package/dist/electron/core/settings-schema.d.ts +81 -0
- package/dist/electron/core/settings-schema.d.ts.map +1 -0
- package/dist/electron/core/settings-schema.js +1357 -0
- package/dist/electron/core/settings-schema.js.map +1 -0
- package/dist/electron/logger.d.ts.map +1 -1
- package/dist/electron/logger.js +22 -8
- package/dist/electron/logger.js.map +1 -1
- package/dist/electron/main.js +417 -133
- package/dist/electron/modules/accessibility/macos-provider.d.ts +8 -0
- package/dist/electron/modules/accessibility/macos-provider.d.ts.map +1 -0
- package/dist/electron/modules/accessibility/macos-provider.js +94 -0
- package/dist/electron/modules/accessibility/macos-provider.js.map +1 -0
- package/dist/electron/modules/accessibility/provider.d.ts +12 -0
- package/dist/electron/modules/accessibility/provider.d.ts.map +1 -0
- package/dist/electron/modules/accessibility/provider.js +52 -0
- package/dist/electron/modules/accessibility/provider.js.map +1 -0
- package/dist/electron/modules/accessibility/types.d.ts +63 -0
- package/dist/electron/modules/accessibility/types.d.ts.map +1 -0
- package/dist/electron/modules/accessibility/types.js +6 -0
- package/dist/electron/modules/accessibility/types.js.map +1 -0
- package/dist/electron/modules/accessibility/windows-provider.d.ts +8 -0
- package/dist/electron/modules/accessibility/windows-provider.d.ts.map +1 -0
- package/dist/electron/modules/accessibility/windows-provider.js +85 -0
- package/dist/electron/modules/accessibility/windows-provider.js.map +1 -0
- package/dist/electron/modules/api-server.d.ts +4 -1
- package/dist/electron/modules/api-server.d.ts.map +1 -1
- package/dist/electron/modules/api-server.js +1414 -218
- package/dist/electron/modules/api-server.js.map +1 -1
- package/dist/electron/modules/auth.d.ts +14 -0
- package/dist/electron/modules/auth.d.ts.map +1 -1
- package/dist/electron/modules/auth.js +43 -0
- package/dist/electron/modules/auth.js.map +1 -1
- package/dist/electron/modules/azure-speech-realtime.d.ts.map +1 -1
- package/dist/electron/modules/azure-speech-realtime.js +56 -0
- package/dist/electron/modules/azure-speech-realtime.js.map +1 -1
- package/dist/electron/modules/capture.d.ts +8 -0
- package/dist/electron/modules/capture.d.ts.map +1 -1
- package/dist/electron/modules/capture.js +33 -0
- package/dist/electron/modules/capture.js.map +1 -1
- package/dist/electron/modules/compose-screenshots.d.ts +8 -0
- package/dist/electron/modules/compose-screenshots.d.ts.map +1 -0
- package/dist/electron/modules/compose-screenshots.js +86 -0
- package/dist/electron/modules/compose-screenshots.js.map +1 -0
- package/dist/electron/modules/context-menu-detect.d.ts +47 -0
- package/dist/electron/modules/context-menu-detect.d.ts.map +1 -0
- package/dist/electron/modules/context-menu-detect.js +272 -0
- package/dist/electron/modules/context-menu-detect.js.map +1 -0
- package/dist/electron/modules/dictation.d.ts.map +1 -1
- package/dist/electron/modules/dictation.js +12 -7
- package/dist/electron/modules/dictation.js.map +1 -1
- package/dist/electron/modules/gif-util.d.ts +9 -0
- package/dist/electron/modules/gif-util.d.ts.map +1 -0
- package/dist/electron/modules/gif-util.js +63 -0
- package/dist/electron/modules/gif-util.js.map +1 -0
- package/dist/electron/modules/gui-automation-errors.d.ts +11 -0
- package/dist/electron/modules/gui-automation-errors.d.ts.map +1 -0
- package/dist/electron/modules/gui-automation-errors.js +79 -0
- package/dist/electron/modules/gui-automation-errors.js.map +1 -0
- package/dist/electron/modules/gui-automation-telemetry.d.ts +38 -0
- package/dist/electron/modules/gui-automation-telemetry.d.ts.map +1 -0
- package/dist/electron/modules/gui-automation-telemetry.js +200 -0
- package/dist/electron/modules/gui-automation-telemetry.js.map +1 -0
- package/dist/electron/modules/gui-automation.d.ts +1143 -0
- package/dist/electron/modules/gui-automation.d.ts.map +1 -0
- package/dist/electron/modules/gui-automation.js +8769 -0
- package/dist/electron/modules/gui-automation.js.map +1 -0
- package/dist/electron/modules/hotkeys.d.ts +2 -1
- package/dist/electron/modules/hotkeys.d.ts.map +1 -1
- package/dist/electron/modules/hotkeys.js +25 -1
- package/dist/electron/modules/hotkeys.js.map +1 -1
- package/dist/electron/modules/human-input/index.d.ts +35 -0
- package/dist/electron/modules/human-input/index.d.ts.map +1 -0
- package/dist/electron/modules/human-input/index.js +163 -0
- package/dist/electron/modules/human-input/index.js.map +1 -0
- package/dist/electron/modules/human-input/keyboard/timing.d.ts +38 -0
- package/dist/electron/modules/human-input/keyboard/timing.d.ts.map +1 -0
- package/dist/electron/modules/human-input/keyboard/timing.js +57 -0
- package/dist/electron/modules/human-input/keyboard/timing.js.map +1 -0
- package/dist/electron/modules/human-input/mouse/path.d.ts +24 -0
- package/dist/electron/modules/human-input/mouse/path.d.ts.map +1 -0
- package/dist/electron/modules/human-input/mouse/path.js +80 -0
- package/dist/electron/modules/human-input/mouse/path.js.map +1 -0
- package/dist/electron/modules/human-input/mouse/velocity.d.ts +48 -0
- package/dist/electron/modules/human-input/mouse/velocity.d.ts.map +1 -0
- package/dist/electron/modules/human-input/mouse/velocity.js +93 -0
- package/dist/electron/modules/human-input/mouse/velocity.js.map +1 -0
- package/dist/electron/modules/human-input/profiles.d.ts +90 -0
- package/dist/electron/modules/human-input/profiles.d.ts.map +1 -0
- package/dist/electron/modules/human-input/profiles.js +124 -0
- package/dist/electron/modules/human-input/profiles.js.map +1 -0
- package/dist/electron/modules/human-input/rng.d.ts +16 -0
- package/dist/electron/modules/human-input/rng.d.ts.map +1 -0
- package/dist/electron/modules/human-input/rng.js +101 -0
- package/dist/electron/modules/human-input/rng.js.map +1 -0
- package/dist/electron/modules/human-input/salt.d.ts +15 -0
- package/dist/electron/modules/human-input/salt.d.ts.map +1 -0
- package/dist/electron/modules/human-input/salt.js +48 -0
- package/dist/electron/modules/human-input/salt.js.map +1 -0
- package/dist/electron/modules/image-utils.d.ts +20 -0
- package/dist/electron/modules/image-utils.d.ts.map +1 -0
- package/dist/electron/modules/image-utils.js +80 -0
- package/dist/electron/modules/image-utils.js.map +1 -0
- package/dist/electron/modules/ollama/capability.d.ts +32 -0
- package/dist/electron/modules/ollama/capability.d.ts.map +1 -0
- package/dist/electron/modules/ollama/capability.js +117 -0
- package/dist/electron/modules/ollama/capability.js.map +1 -0
- package/dist/electron/modules/ollama/client.d.ts +14 -0
- package/dist/electron/modules/ollama/client.d.ts.map +1 -0
- package/dist/electron/modules/ollama/client.js +134 -0
- package/dist/electron/modules/ollama/client.js.map +1 -0
- package/dist/electron/modules/ollama/detector.d.ts +29 -0
- package/dist/electron/modules/ollama/detector.d.ts.map +1 -0
- package/dist/electron/modules/ollama/detector.js +177 -0
- package/dist/electron/modules/ollama/detector.js.map +1 -0
- package/dist/electron/modules/ollama/dispatcher.d.ts +36 -0
- package/dist/electron/modules/ollama/dispatcher.d.ts.map +1 -0
- package/dist/electron/modules/ollama/dispatcher.js +97 -0
- package/dist/electron/modules/ollama/dispatcher.js.map +1 -0
- package/dist/electron/modules/ollama/router.d.ts +51 -0
- package/dist/electron/modules/ollama/router.d.ts.map +1 -0
- package/dist/electron/modules/ollama/router.js +201 -0
- package/dist/electron/modules/ollama/router.js.map +1 -0
- package/dist/electron/modules/pin-window.d.ts.map +1 -1
- package/dist/electron/modules/pin-window.js +2 -1
- package/dist/electron/modules/pin-window.js.map +1 -1
- package/dist/electron/modules/platform/dpi.d.ts +2 -0
- package/dist/electron/modules/platform/dpi.d.ts.map +1 -0
- package/dist/electron/modules/platform/dpi.js +48 -0
- package/dist/electron/modules/platform/dpi.js.map +1 -0
- package/dist/electron/modules/platform/errors.d.ts +13 -0
- package/dist/electron/modules/platform/errors.d.ts.map +1 -0
- package/dist/electron/modules/platform/errors.js +36 -0
- package/dist/electron/modules/platform/errors.js.map +1 -0
- package/dist/electron/modules/platform/index.d.ts +24 -0
- package/dist/electron/modules/platform/index.d.ts.map +1 -0
- package/dist/electron/modules/platform/index.js +133 -0
- package/dist/electron/modules/platform/index.js.map +1 -0
- package/dist/electron/modules/platform/interfaces.d.ts +140 -0
- package/dist/electron/modules/platform/interfaces.d.ts.map +1 -0
- package/dist/electron/modules/platform/interfaces.js +14 -0
- package/dist/electron/modules/platform/interfaces.js.map +1 -0
- package/dist/electron/modules/platform/macos/ax.d.ts +15 -0
- package/dist/electron/modules/platform/macos/ax.d.ts.map +1 -0
- package/dist/electron/modules/platform/macos/ax.js +222 -0
- package/dist/electron/modules/platform/macos/ax.js.map +1 -0
- package/dist/electron/modules/platform/macos/capture.d.ts +14 -0
- package/dist/electron/modules/platform/macos/capture.d.ts.map +1 -0
- package/dist/electron/modules/platform/macos/capture.js +106 -0
- package/dist/electron/modules/platform/macos/capture.js.map +1 -0
- package/dist/electron/modules/platform/macos/input.d.ts +16 -0
- package/dist/electron/modules/platform/macos/input.d.ts.map +1 -0
- package/dist/electron/modules/platform/macos/input.js +342 -0
- package/dist/electron/modules/platform/macos/input.js.map +1 -0
- package/dist/electron/modules/platform/macos/launch.d.ts +10 -0
- package/dist/electron/modules/platform/macos/launch.d.ts.map +1 -0
- package/dist/electron/modules/platform/macos/launch.js +114 -0
- package/dist/electron/modules/platform/macos/launch.js.map +1 -0
- package/dist/electron/modules/platform/macos/session.d.ts +8 -0
- package/dist/electron/modules/platform/macos/session.d.ts.map +1 -0
- package/dist/electron/modules/platform/macos/session.js +17 -0
- package/dist/electron/modules/platform/macos/session.js.map +1 -0
- package/dist/electron/modules/platform/macos/window.d.ts +31 -0
- package/dist/electron/modules/platform/macos/window.d.ts.map +1 -0
- package/dist/electron/modules/platform/macos/window.js +271 -0
- package/dist/electron/modules/platform/macos/window.js.map +1 -0
- package/dist/electron/modules/platform/shared.d.ts +10 -0
- package/dist/electron/modules/platform/shared.d.ts.map +1 -0
- package/dist/electron/modules/platform/shared.js +201 -0
- package/dist/electron/modules/platform/shared.js.map +1 -0
- package/dist/electron/modules/platform/types.d.ts +182 -0
- package/dist/electron/modules/platform/types.d.ts.map +1 -0
- package/dist/electron/modules/platform/types.js +24 -0
- package/dist/electron/modules/platform/types.js.map +1 -0
- package/dist/electron/modules/platform/windows/ax.d.ts +15 -0
- package/dist/electron/modules/platform/windows/ax.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/ax.js +277 -0
- package/dist/electron/modules/platform/windows/ax.js.map +1 -0
- package/dist/electron/modules/platform/windows/capture.d.ts +14 -0
- package/dist/electron/modules/platform/windows/capture.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/capture.js +115 -0
- package/dist/electron/modules/platform/windows/capture.js.map +1 -0
- package/dist/electron/modules/platform/windows/input.d.ts +17 -0
- package/dist/electron/modules/platform/windows/input.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/input.js +422 -0
- package/dist/electron/modules/platform/windows/input.js.map +1 -0
- package/dist/electron/modules/platform/windows/launch.d.ts +10 -0
- package/dist/electron/modules/platform/windows/launch.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/launch.js +185 -0
- package/dist/electron/modules/platform/windows/launch.js.map +1 -0
- package/dist/electron/modules/platform/windows/session.d.ts +8 -0
- package/dist/electron/modules/platform/windows/session.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/session.js +87 -0
- package/dist/electron/modules/platform/windows/session.js.map +1 -0
- package/dist/electron/modules/platform/windows/tray.d.ts +13 -0
- package/dist/electron/modules/platform/windows/tray.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/tray.js +390 -0
- package/dist/electron/modules/platform/windows/tray.js.map +1 -0
- package/dist/electron/modules/platform/windows/window.d.ts +30 -0
- package/dist/electron/modules/platform/windows/window.d.ts.map +1 -0
- package/dist/electron/modules/platform/windows/window.js +444 -0
- package/dist/electron/modules/platform/windows/window.js.map +1 -0
- package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.d.ts +15 -0
- package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.d.ts.map +1 -0
- package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.js +62 -0
- package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.js.map +1 -0
- package/dist/electron/modules/recording/providers/provider-factory.d.ts.map +1 -1
- package/dist/electron/modules/recording/providers/provider-factory.js +13 -7
- package/dist/electron/modules/recording/providers/provider-factory.js.map +1 -1
- package/dist/electron/modules/scroll-calibration.d.ts +152 -0
- package/dist/electron/modules/scroll-calibration.d.ts.map +1 -0
- package/dist/electron/modules/scroll-calibration.js +271 -0
- package/dist/electron/modules/scroll-calibration.js.map +1 -0
- package/dist/electron/modules/scroll-capture.d.ts +3 -1
- package/dist/electron/modules/scroll-capture.d.ts.map +1 -1
- package/dist/electron/modules/scroll-capture.js +21 -72
- package/dist/electron/modules/scroll-capture.js.map +1 -1
- package/dist/electron/modules/sequence-locate.d.ts +126 -0
- package/dist/electron/modules/sequence-locate.d.ts.map +1 -0
- package/dist/electron/modules/sequence-locate.js +356 -0
- package/dist/electron/modules/sequence-locate.js.map +1 -0
- package/dist/electron/modules/store.d.ts +15 -56
- package/dist/electron/modules/store.d.ts.map +1 -1
- package/dist/electron/modules/store.js +84 -58
- package/dist/electron/modules/store.js.map +1 -1
- package/dist/electron/modules/stt/capability-probe.d.ts +67 -0
- package/dist/electron/modules/stt/capability-probe.d.ts.map +1 -0
- package/dist/electron/modules/stt/capability-probe.js +331 -0
- package/dist/electron/modules/stt/capability-probe.js.map +1 -0
- package/dist/electron/modules/stt/macos-engine.d.ts +20 -0
- package/dist/electron/modules/stt/macos-engine.d.ts.map +1 -0
- package/dist/electron/modules/stt/macos-engine.js +231 -0
- package/dist/electron/modules/stt/macos-engine.js.map +1 -0
- package/dist/electron/modules/stt/model-manager.d.ts +87 -0
- package/dist/electron/modules/stt/model-manager.d.ts.map +1 -0
- package/dist/electron/modules/stt/model-manager.js +321 -0
- package/dist/electron/modules/stt/model-manager.js.map +1 -0
- package/dist/electron/modules/stt/router.d.ts +35 -0
- package/dist/electron/modules/stt/router.d.ts.map +1 -0
- package/dist/electron/modules/stt/router.js +232 -0
- package/dist/electron/modules/stt/router.js.map +1 -0
- package/dist/electron/modules/stt/sherpa-engine.d.ts +43 -0
- package/dist/electron/modules/stt/sherpa-engine.d.ts.map +1 -0
- package/dist/electron/modules/stt/sherpa-engine.js +521 -0
- package/dist/electron/modules/stt/sherpa-engine.js.map +1 -0
- package/dist/electron/modules/stt/types.d.ts +72 -0
- package/dist/electron/modules/stt/types.d.ts.map +1 -0
- package/dist/electron/modules/stt/types.js +16 -0
- package/dist/electron/modules/stt/types.js.map +1 -0
- package/dist/electron/modules/stt/winrt-engine.d.ts +20 -0
- package/dist/electron/modules/stt/winrt-engine.d.ts.map +1 -0
- package/dist/electron/modules/stt/winrt-engine.js +238 -0
- package/dist/electron/modules/stt/winrt-engine.js.map +1 -0
- package/dist/electron/modules/template-match.d.ts +62 -0
- package/dist/electron/modules/template-match.d.ts.map +1 -0
- package/dist/electron/modules/template-match.js +205 -0
- package/dist/electron/modules/template-match.js.map +1 -0
- package/dist/electron/modules/tray.d.ts +2 -0
- package/dist/electron/modules/tray.d.ts.map +1 -1
- package/dist/electron/modules/tray.js +136 -8
- package/dist/electron/modules/tray.js.map +1 -1
- package/dist/electron/modules/undo-stack.d.ts +22 -0
- package/dist/electron/modules/undo-stack.d.ts.map +1 -0
- package/dist/electron/modules/undo-stack.js +41 -0
- package/dist/electron/modules/undo-stack.js.map +1 -0
- package/dist/electron/modules/watchers/active-window-watcher.d.ts +5 -0
- package/dist/electron/modules/watchers/active-window-watcher.d.ts.map +1 -0
- package/dist/electron/modules/watchers/active-window-watcher.js +152 -0
- package/dist/electron/modules/watchers/active-window-watcher.js.map +1 -0
- package/dist/electron/modules/watchers/clipboard-watcher.d.ts +5 -0
- package/dist/electron/modules/watchers/clipboard-watcher.d.ts.map +1 -0
- package/dist/electron/modules/watchers/clipboard-watcher.js +90 -0
- package/dist/electron/modules/watchers/clipboard-watcher.js.map +1 -0
- package/dist/electron/modules/watchers/file-watcher.d.ts +5 -0
- package/dist/electron/modules/watchers/file-watcher.d.ts.map +1 -0
- package/dist/electron/modules/watchers/file-watcher.js +91 -0
- package/dist/electron/modules/watchers/file-watcher.js.map +1 -0
- package/dist/electron/modules/watchers/registry.d.ts +34 -0
- package/dist/electron/modules/watchers/registry.d.ts.map +1 -0
- package/dist/electron/modules/watchers/registry.js +108 -0
- package/dist/electron/modules/watchers/registry.js.map +1 -0
- package/dist/electron/modules/watchers/screen-region-service.d.ts +18 -0
- package/dist/electron/modules/watchers/screen-region-service.d.ts.map +1 -0
- package/dist/electron/modules/watchers/screen-region-service.js +126 -0
- package/dist/electron/modules/watchers/screen-region-service.js.map +1 -0
- package/dist/electron/modules/watchers/screen-region-watcher.d.ts +6 -0
- package/dist/electron/modules/watchers/screen-region-watcher.d.ts.map +1 -0
- package/dist/electron/modules/watchers/screen-region-watcher.js +70 -0
- package/dist/electron/modules/watchers/screen-region-watcher.js.map +1 -0
- package/dist/electron/modules/window-activate.d.ts +103 -0
- package/dist/electron/modules/window-activate.d.ts.map +1 -0
- package/dist/electron/modules/window-activate.js +630 -0
- package/dist/electron/modules/window-activate.js.map +1 -0
- package/dist/electron/modules/window-input.d.ts +43 -0
- package/dist/electron/modules/window-input.d.ts.map +1 -0
- package/dist/electron/modules/window-input.js +623 -0
- package/dist/electron/modules/window-input.js.map +1 -0
- package/dist/electron/modules/window-resolver.d.ts +35 -0
- package/dist/electron/modules/window-resolver.d.ts.map +1 -0
- package/dist/electron/modules/window-resolver.js +210 -0
- package/dist/electron/modules/window-resolver.js.map +1 -0
- package/dist/headless/electron/core/input-injection/index.js +30 -0
- package/dist/headless/electron/core/input-injection/macos.js +13 -0
- package/dist/headless/electron/core/input-injection/windows.js +118 -0
- package/dist/headless/electron/core/json-store.js +61 -47
- package/dist/headless/electron/core/serialize-schema.js +88 -0
- package/dist/headless/electron/core/settings-schema.js +1356 -0
- package/dist/headless/electron/logger.js +22 -8
- package/dist/headless/electron/modules/accessibility/macos-provider.js +93 -0
- package/dist/headless/electron/modules/accessibility/provider.js +51 -0
- package/dist/headless/electron/modules/accessibility/types.js +5 -0
- package/dist/headless/electron/modules/accessibility/windows-provider.js +84 -0
- package/dist/headless/electron/modules/api-server.js +1414 -218
- package/dist/headless/electron/modules/auth.js +43 -0
- package/dist/headless/electron/modules/azure-speech-realtime.js +56 -0
- package/dist/headless/electron/modules/capture.js +33 -0
- package/dist/headless/electron/modules/context-menu-detect.js +271 -0
- package/dist/headless/electron/modules/dictation.js +12 -7
- package/dist/headless/electron/modules/gui-automation-errors.js +78 -0
- package/dist/headless/electron/modules/gui-automation-telemetry.js +199 -0
- package/dist/headless/electron/modules/gui-automation.js +8768 -0
- package/dist/headless/electron/modules/human-input/keyboard/timing.js +56 -0
- package/dist/headless/electron/modules/human-input/mouse/path.js +79 -0
- package/dist/headless/electron/modules/human-input/mouse/velocity.js +92 -0
- package/dist/headless/electron/modules/human-input/profiles.js +123 -0
- package/dist/headless/electron/modules/human-input/rng.js +100 -0
- package/dist/headless/electron/modules/human-input/salt.js +47 -0
- package/dist/headless/electron/modules/image-utils.js +79 -0
- package/dist/headless/electron/modules/ollama/capability.js +116 -0
- package/dist/headless/electron/modules/ollama/client.js +133 -0
- package/dist/headless/electron/modules/ollama/detector.js +176 -0
- package/dist/headless/electron/modules/ollama/dispatcher.js +96 -0
- package/dist/headless/electron/modules/ollama/router.js +200 -0
- package/dist/headless/electron/modules/platform/dpi.js +47 -0
- package/dist/headless/electron/modules/platform/errors.js +35 -0
- package/dist/headless/electron/modules/platform/index.js +132 -0
- package/dist/headless/electron/modules/platform/interfaces.js +13 -0
- package/dist/headless/electron/modules/platform/macos/ax.js +221 -0
- package/dist/headless/electron/modules/platform/macos/capture.js +105 -0
- package/dist/headless/electron/modules/platform/macos/input.js +341 -0
- package/dist/headless/electron/modules/platform/macos/launch.js +113 -0
- package/dist/headless/electron/modules/platform/macos/session.js +16 -0
- package/dist/headless/electron/modules/platform/macos/window.js +270 -0
- package/dist/headless/electron/modules/platform/shared.js +200 -0
- package/dist/headless/electron/modules/platform/types.js +23 -0
- package/dist/headless/electron/modules/platform/windows/ax.js +276 -0
- package/dist/headless/electron/modules/platform/windows/capture.js +114 -0
- package/dist/headless/electron/modules/platform/windows/input.js +421 -0
- package/dist/headless/electron/modules/platform/windows/launch.js +184 -0
- package/dist/headless/electron/modules/platform/windows/session.js +86 -0
- package/dist/headless/electron/modules/platform/windows/tray.js +389 -0
- package/dist/headless/electron/modules/platform/windows/window.js +443 -0
- package/dist/headless/electron/modules/recording/providers/change-detect-shared-wrapper.js +61 -0
- package/dist/headless/electron/modules/recording/providers/provider-factory.js +13 -7
- package/dist/headless/electron/modules/scroll-calibration.js +270 -0
- package/dist/headless/electron/modules/sequence-locate.js +355 -0
- package/dist/headless/electron/modules/store.js +84 -58
- package/dist/headless/electron/modules/stt/capability-probe.js +330 -0
- package/dist/headless/electron/modules/stt/macos-engine.js +230 -0
- package/dist/headless/electron/modules/stt/model-manager.js +320 -0
- package/dist/headless/electron/modules/stt/router.js +231 -0
- package/dist/headless/electron/modules/stt/sherpa-engine.js +520 -0
- package/dist/headless/electron/modules/stt/types.js +15 -0
- package/dist/headless/electron/modules/stt/winrt-engine.js +237 -0
- package/dist/headless/electron/modules/template-match.js +204 -0
- package/dist/headless/electron/modules/undo-stack.js +40 -0
- package/dist/headless/electron/modules/watchers/active-window-watcher.js +151 -0
- package/dist/headless/electron/modules/watchers/clipboard-watcher.js +89 -0
- package/dist/headless/electron/modules/watchers/file-watcher.js +90 -0
- package/dist/headless/electron/modules/watchers/registry.js +107 -0
- package/dist/headless/electron/modules/watchers/screen-region-service.js +125 -0
- package/dist/headless/electron/modules/watchers/screen-region-watcher.js +69 -0
- package/dist/headless/electron/modules/window-activate.js +629 -0
- package/dist/headless/electron/modules/window-input.js +622 -0
- package/dist/headless/electron/modules/window-resolver.js +209 -0
- package/dist/headless/headless/cli.js +60 -7
- package/dist/headless/headless/config-cmd.js +306 -0
- package/dist/headless/headless/doctor.js +599 -0
- package/dist/headless/headless/ollama-cmd.js +211 -0
- package/dist/headless/headless/platform-headless.js +13 -1
- package/dist/headless/headless/server.js +38 -2
- package/dist/headless/headless/stt-cmd.js +213 -0
- package/dist/headless/headless/tui/index.mjs +7 -0
- package/dist/headless/headless/tui/plain-dump.js +41 -0
- package/dist/headless/headless/tui/settings-app.mjs +744 -0
- package/dist/headless/headless/tui/setup-wizard.mjs +257 -0
- package/dist/headless/headless/tui-bridge.js +80 -0
- package/dist/headless/shared/constants.js +3 -1
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +3 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/types.d.ts +8 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/mcp-server/dist/api-client.js +257 -6
- package/mcp-server/dist/index.js +1660 -61
- package/mcp-server/dist/project-sense.js +161 -0
- package/mcp-server/dist/tool-categories.js +161 -0
- package/mcp-server/package.json +8 -2
- package/package.json +33 -5
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Platform adapter singleton — routes to the Windows or macOS implementation at
|
|
3
|
+
// runtime based on `process.platform`. Called at module-load time; no explicit
|
|
4
|
+
// init step required.
|
|
5
|
+
//
|
|
6
|
+
// Public API: import { platform } from './platform' → platform.input.click(...)
|
|
7
|
+
//
|
|
8
|
+
// See GUI_AUTOMATION_ROADMAP.md §0.0 for the full design. Phase 1+ tool handlers
|
|
9
|
+
// must route side-effects through this singleton — no direct Win32 / AppleScript
|
|
10
|
+
// / CoreGraphics calls in tool handlers.
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.PlatformError = exports.NotImplementedError = exports.UnsupportedPlatformError = exports.platform = void 0;
|
|
27
|
+
exports.setPlatformAdaptersForTest = setPlatformAdaptersForTest;
|
|
28
|
+
exports.probeTccOrErrorCode = probeTccOrErrorCode;
|
|
29
|
+
exports.requireTcc = requireTcc;
|
|
30
|
+
const errors_1 = require("./errors");
|
|
31
|
+
const input_1 = require("./windows/input");
|
|
32
|
+
const ax_1 = require("./windows/ax");
|
|
33
|
+
const window_1 = require("./windows/window");
|
|
34
|
+
const capture_1 = require("./windows/capture");
|
|
35
|
+
const launch_1 = require("./windows/launch");
|
|
36
|
+
const session_1 = require("./windows/session");
|
|
37
|
+
const input_2 = require("./macos/input");
|
|
38
|
+
const ax_2 = require("./macos/ax");
|
|
39
|
+
const window_2 = require("./macos/window");
|
|
40
|
+
const capture_2 = require("./macos/capture");
|
|
41
|
+
const launch_2 = require("./macos/launch");
|
|
42
|
+
const session_2 = require("./macos/session");
|
|
43
|
+
function buildAdapters() {
|
|
44
|
+
if (process.platform === 'win32') {
|
|
45
|
+
return {
|
|
46
|
+
kind: 'win32',
|
|
47
|
+
input: new input_1.WindowsInputAdapter(),
|
|
48
|
+
accessibility: new ax_1.WindowsAccessibilityAdapter(),
|
|
49
|
+
window: new window_1.WindowsWindowAdapter(),
|
|
50
|
+
capture: new capture_1.WindowsCaptureAdapter(),
|
|
51
|
+
launch: new launch_1.WindowsLaunchAdapter(),
|
|
52
|
+
session: new session_1.WindowsSessionAdapter(),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (process.platform === 'darwin') {
|
|
56
|
+
return {
|
|
57
|
+
kind: 'darwin',
|
|
58
|
+
input: new input_2.MacosInputAdapter(),
|
|
59
|
+
accessibility: new ax_2.MacosAccessibilityAdapter(),
|
|
60
|
+
window: new window_2.MacosWindowAdapter(),
|
|
61
|
+
capture: new capture_2.MacosCaptureAdapter(),
|
|
62
|
+
launch: new launch_2.MacosLaunchAdapter(),
|
|
63
|
+
session: new session_2.MacosSessionAdapter(),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Linux — out of scope per roadmap Deferred/parked. Return a throw-everywhere
|
|
67
|
+
// shape so Linux smoke paths get a consistent error rather than crashing.
|
|
68
|
+
const unsupported = (method) => {
|
|
69
|
+
throw new errors_1.UnsupportedPlatformError(method, process.platform);
|
|
70
|
+
};
|
|
71
|
+
const throwAll = (name) => new Proxy({}, {
|
|
72
|
+
get: (_t, prop) => () => unsupported(`${name}.${String(prop)}`),
|
|
73
|
+
});
|
|
74
|
+
return {
|
|
75
|
+
kind: 'win32', // nominal only — no adapters will actually be called
|
|
76
|
+
input: throwAll('input'),
|
|
77
|
+
accessibility: throwAll('accessibility'),
|
|
78
|
+
window: throwAll('window'),
|
|
79
|
+
capture: throwAll('capture'),
|
|
80
|
+
launch: throwAll('launch'),
|
|
81
|
+
session: throwAll('session'),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
let _adapters = null;
|
|
85
|
+
/**
|
|
86
|
+
* The platform adapters. Resolved lazily on first access so that test setups
|
|
87
|
+
* can inject their own by calling `setPlatformAdaptersForTest` first.
|
|
88
|
+
*/
|
|
89
|
+
exports.platform = new Proxy({}, {
|
|
90
|
+
get(_target, prop) {
|
|
91
|
+
if (!_adapters)
|
|
92
|
+
_adapters = buildAdapters();
|
|
93
|
+
return _adapters[prop];
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
/** Test seam — swap in a mock for unit tests. Call with `null` to reset. */
|
|
97
|
+
function setPlatformAdaptersForTest(a) {
|
|
98
|
+
_adapters = a;
|
|
99
|
+
}
|
|
100
|
+
async function probeTccOrErrorCode(kind) {
|
|
101
|
+
if (process.platform !== 'darwin')
|
|
102
|
+
return null;
|
|
103
|
+
try {
|
|
104
|
+
const state = await exports.platform.capture.probeTcc(kind);
|
|
105
|
+
if (state.granted)
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// NotImplementedError or any other failure — treat as not-granted until Phase 7.
|
|
110
|
+
}
|
|
111
|
+
return kind === 'accessibility' ? 'ACCESSIBILITY_NOT_GRANTED' : 'SCREEN_RECORDING_NOT_GRANTED';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Convenience object for use by write-tool gates. When non-null, the caller
|
|
115
|
+
* must return an AutomationResult refusal with the given errorCode + hint.
|
|
116
|
+
* The hint deep-links to the TCC pane for one-click remediation.
|
|
117
|
+
*/
|
|
118
|
+
async function requireTcc(kind) {
|
|
119
|
+
const code = await probeTccOrErrorCode(kind);
|
|
120
|
+
if (!code)
|
|
121
|
+
return null;
|
|
122
|
+
const pane = kind === 'accessibility' ? 'Privacy_Accessibility' : 'Privacy_ScreenCapture';
|
|
123
|
+
return {
|
|
124
|
+
errorCode: code,
|
|
125
|
+
hint: `macOS blocks GUI automation until SuperBased has ${kind === 'accessibility' ? 'Accessibility' : 'Screen Recording'} permission. Open System Settings → Privacy & Security → ${kind === 'accessibility' ? 'Accessibility' : 'Screen Recording'} (x-apple.systempreferences:com.apple.preference.security?${pane}) and enable SuperBased. Full first-run UX ships in Phase 7 (S9).`,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
var errors_2 = require("./errors");
|
|
129
|
+
Object.defineProperty(exports, "UnsupportedPlatformError", { enumerable: true, get: function () { return errors_2.UnsupportedPlatformError; } });
|
|
130
|
+
Object.defineProperty(exports, "NotImplementedError", { enumerable: true, get: function () { return errors_2.NotImplementedError; } });
|
|
131
|
+
Object.defineProperty(exports, "PlatformError", { enumerable: true, get: function () { return errors_2.PlatformError; } });
|
|
132
|
+
__exportStar(require("./types"), exports);
|
|
133
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../electron/modules/platform/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,sBAAsB;AACtB,EAAE;AACF,kFAAkF;AAClF,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,yCAAyC;;;;;;;;;;;;;;;;;AA4EzC,gEAEC;AAUD,kDASC;AAOD,gCAQC;AA7GD,qCAAoD;AAEpD,2CAAsD;AACtD,qCAA2D;AAC3D,6CAAwD;AACxD,+CAA0D;AAC1D,6CAAwD;AACxD,+CAA0D;AAE1D,yCAAkD;AAClD,mCAAuD;AACvD,2CAAoD;AACpD,6CAAsD;AACtD,2CAAoD;AACpD,6CAAsD;AAEtD,SAAS,aAAa;IACpB,IAAI,O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B,CAAC,CAAC,CAAC,uBAAuB,CAAC;IAC1F,OAAO;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,oDAAoD,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB,4DAA4D,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB,6DAA6D,IAAI,mEAAmE;KACzX,CAAC;AACJ,CAAC;AAGD,mCAAwF;AAA/E,kHAAA,wBAAwB,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,uGAAA,aAAa,OAAA;AAErE,0CAAwB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { AxNode } from '../accessibility/types';
|
|
2
|
+
import type { ClickOpts, DisplayInfo, DragOpts, DragWaypoint, HotkeyOpts, HoverOpts, IntegrityLevel, LaunchResult, LaunchSpec, Point, RGBA, Rect, ScrollOpts, SessionState, TccKind, TccState, TrayEnumerateOpts, TrayIconInfo, TypeOpts, WaitForWindowOpts, WindowHandle, WindowInfo, WindowState, AxPattern } from './types';
|
|
3
|
+
/** Input injection — keyboard + mouse. */
|
|
4
|
+
export interface PlatformInputAdapter {
|
|
5
|
+
click(handle: WindowHandle | null, x: number, y: number, opts?: ClickOpts): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Type ASCII text via the platform's native keyboard events. Layout-aware.
|
|
8
|
+
* For layout-independent injection use `typeUnicode`.
|
|
9
|
+
*/
|
|
10
|
+
type(handle: WindowHandle | null, text: string, opts?: TypeOpts): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Layout-independent Unicode injection (0.16). Windows: SendInput + VK_PACKET.
|
|
13
|
+
* macOS: CGEventKeyboardSetUnicodeString. Handles AltGr / non-US layouts /
|
|
14
|
+
* emoji correctly.
|
|
15
|
+
*/
|
|
16
|
+
typeUnicode(handle: WindowHandle | null, text: string, opts?: TypeOpts): Promise<void>;
|
|
17
|
+
sendHotkey(handle: WindowHandle | null, combo: string, opts?: HotkeyOpts): Promise<{
|
|
18
|
+
methodUsed: string;
|
|
19
|
+
}>;
|
|
20
|
+
scroll(handle: WindowHandle | null, anchor: Point, opts: ScrollOpts): Promise<void>;
|
|
21
|
+
drag(handle: WindowHandle | null, path: DragWaypoint[], opts?: DragOpts): Promise<void>;
|
|
22
|
+
hover(handle: WindowHandle | null, x: number, y: number, opts?: HoverOpts): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Read the current cursor position in virtual-screen logical-pixel coords
|
|
25
|
+
* (Windows) or points (macOS). Pure query — no input injection. Used by the
|
|
26
|
+
* humanization layer to plot a Bezier from current → target before clicks /
|
|
27
|
+
* hovers, so trajectory classifiers see curved approach paths instead of
|
|
28
|
+
* teleport-then-click. Both adapters implement via nut.mouse.getPosition()
|
|
29
|
+
* which routes to GetCursorPos (win32) / CGEventSourceGetMouseLocation
|
|
30
|
+
* (darwin).
|
|
31
|
+
*/
|
|
32
|
+
getCursorPosition(): Promise<Point>;
|
|
33
|
+
/**
|
|
34
|
+
* 5.2 — Enumerate system-tray / notification-area icons for the current
|
|
35
|
+
* user session. Windows: cross-process read of the Shell_TrayWnd's
|
|
36
|
+
* ToolbarWindow32 buttons (TB_BUTTONCOUNT / TB_GETBUTTON / TB_GETBUTTONTEXT /
|
|
37
|
+
* TB_GETRECT via VirtualAllocEx + ReadProcessMemory into explorer.exe). When
|
|
38
|
+
* opts.includeOverflow is set, also walks NotifyIconOverflowWindow's toolbar.
|
|
39
|
+
* macOS: UnsupportedPlatformError in v1 — NSStatusItem enumeration requires
|
|
40
|
+
* private APIs or menu-bar image-matching (roadmap §268 documented limitation).
|
|
41
|
+
* Callers click an icon by feeding the returned (x, y) into click().
|
|
42
|
+
*/
|
|
43
|
+
enumerateTrayIcons(opts?: TrayEnumerateOpts): Promise<TrayIconInfo[]>;
|
|
44
|
+
}
|
|
45
|
+
/** Accessibility tree read + AX pattern invocation. */
|
|
46
|
+
export interface PlatformAccessibilityAdapter {
|
|
47
|
+
dumpTree(handle: WindowHandle, opts?: {
|
|
48
|
+
maxDepth?: number;
|
|
49
|
+
includeAttributes?: boolean;
|
|
50
|
+
}): Promise<AxNode>;
|
|
51
|
+
findByAutomationId(handle: WindowHandle, id: string): Promise<AxNode | null>;
|
|
52
|
+
findByRoleAndName(handle: WindowHandle, role: string, name: string, opts?: {
|
|
53
|
+
caseSensitive?: boolean;
|
|
54
|
+
}): Promise<AxNode | null>;
|
|
55
|
+
invoke(node: AxNode, pattern: AxPattern, args?: unknown): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/** Window enumeration, resolution, state, and handle encoding. */
|
|
58
|
+
export interface PlatformWindowAdapter {
|
|
59
|
+
enumerate(): Promise<WindowInfo[]>;
|
|
60
|
+
resolve(spec: {
|
|
61
|
+
window?: string;
|
|
62
|
+
processName?: string;
|
|
63
|
+
handle?: WindowHandle;
|
|
64
|
+
}): Promise<WindowInfo | null>;
|
|
65
|
+
activate(handle: WindowHandle): Promise<void>;
|
|
66
|
+
setState(handle: WindowHandle, state: WindowState, opts?: {
|
|
67
|
+
displayId?: number;
|
|
68
|
+
targetBounds?: Rect;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
resize(handle: WindowHandle, rect: Rect, opts?: {
|
|
71
|
+
contentArea?: boolean;
|
|
72
|
+
}): Promise<Rect>;
|
|
73
|
+
/**
|
|
74
|
+
* Read-only query of a window's current screen rect + minimized / maximized
|
|
75
|
+
* state. No activation, no focus change, no side effects. Windows:
|
|
76
|
+
* GetWindowRect + IsIconic + IsZoomed. macOS: osascript `position` + `size`
|
|
77
|
+
* of the window via System Events AX. Returns null if the handle doesn't
|
|
78
|
+
* resolve to a live window.
|
|
79
|
+
*/
|
|
80
|
+
getBounds(handle: WindowHandle): Promise<{
|
|
81
|
+
rect: Rect;
|
|
82
|
+
minimized: boolean;
|
|
83
|
+
maximized: boolean;
|
|
84
|
+
} | null>;
|
|
85
|
+
/** Encode a platform-native id (HWND on Windows, CGWindowID on macOS) into the opaque WindowHandle. */
|
|
86
|
+
encodeHandle(nativeId: string | number, processId: number): WindowHandle;
|
|
87
|
+
/** Decode a WindowHandle back to its components for adapter-internal use only. */
|
|
88
|
+
decodeHandle(h: WindowHandle): {
|
|
89
|
+
platform: 'win32' | 'darwin';
|
|
90
|
+
nativeId: string;
|
|
91
|
+
processId: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Screen capture, display enumeration, pixel read, TCC (macOS) probes. */
|
|
95
|
+
export interface PlatformCaptureAdapter {
|
|
96
|
+
/**
|
|
97
|
+
* Screenshot as PNG buffer. Target selection order:
|
|
98
|
+
* (a) handle present → capture that window (background path preferred; activation fallback)
|
|
99
|
+
* (b) region present → capture that rect (virtual-screen coords)
|
|
100
|
+
* (c) display present → capture that display's full bounds
|
|
101
|
+
* (d) else → capture full virtual-screen (primary display on legacy callers)
|
|
102
|
+
*/
|
|
103
|
+
screenshot(opts?: {
|
|
104
|
+
handle?: WindowHandle;
|
|
105
|
+
region?: Rect;
|
|
106
|
+
display?: number;
|
|
107
|
+
}): Promise<Buffer>;
|
|
108
|
+
enumerateDisplays(): Promise<DisplayInfo[]>;
|
|
109
|
+
readPixel(x: number, y: number): Promise<RGBA>;
|
|
110
|
+
/** macOS TCC probes — Windows implementations return { granted: true, canPrompt: false }. */
|
|
111
|
+
probeTcc(kind: TccKind): Promise<TccState>;
|
|
112
|
+
/** macOS: open the relevant TCC pane. Windows: no-op. */
|
|
113
|
+
openTccSettings(kind: TccKind): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
/** App launch, URL open, and wait-for-window. */
|
|
116
|
+
export interface PlatformLaunchAdapter {
|
|
117
|
+
launch(spec: LaunchSpec): Promise<LaunchResult>;
|
|
118
|
+
openUrl(url: string, opts?: {
|
|
119
|
+
browser?: string;
|
|
120
|
+
}): Promise<LaunchResult>;
|
|
121
|
+
waitForWindow(opts: WaitForWindowOpts): Promise<WindowInfo | null>;
|
|
122
|
+
}
|
|
123
|
+
/** Session state probes + kill-switch hotkey registration. */
|
|
124
|
+
export interface PlatformSessionAdapter {
|
|
125
|
+
probeSessionState(): Promise<SessionState>;
|
|
126
|
+
/** Returns an unregister function. */
|
|
127
|
+
registerAbortHotkey(combo: string, handler: () => void): Promise<() => void>;
|
|
128
|
+
/** Integrity level of the current process — used by session-state guard to detect UIPI mismatch. */
|
|
129
|
+
getCurrentProcessIntegrityLevel(): Promise<IntegrityLevel>;
|
|
130
|
+
}
|
|
131
|
+
export interface PlatformAdapters {
|
|
132
|
+
readonly kind: 'win32' | 'darwin';
|
|
133
|
+
readonly input: PlatformInputAdapter;
|
|
134
|
+
readonly accessibility: PlatformAccessibilityAdapter;
|
|
135
|
+
readonly window: PlatformWindowAdapter;
|
|
136
|
+
readonly capture: PlatformCaptureAdapter;
|
|
137
|
+
readonly launch: PlatformLaunchAdapter;
|
|
138
|
+
readonly session: PlatformSessionAdapter;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../electron/modules/platform/interfaces.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,UAAU,EACV,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACV,MAAM,SAAS,CAAC;AAEjB,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,CAAC,EAAE,MAA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,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACzE,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACpE;AAED,8DAA8D;AAC9D,MAAM,WAAW,sBAAsB;IACrC,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,sCAAsC;IACtC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IAC7E,oGAAoG;IACpG,+BAA+B,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,4BAA4B,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;CAC1C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Platform capability interfaces — the seam that makes the GUI automation
|
|
3
|
+
// suite cross-platform from S0. See GUI_AUTOMATION_ROADMAP.md design
|
|
4
|
+
// principle 8 and item 0.0.
|
|
5
|
+
//
|
|
6
|
+
// Every Phase 1+ tool handler must route its side-effects through one of
|
|
7
|
+
// these adapters. Tool handlers NEVER call Win32 / AppleScript / Core
|
|
8
|
+
// Graphics directly.
|
|
9
|
+
//
|
|
10
|
+
// Unimplemented capabilities throw `UnsupportedPlatformError` (macOS in
|
|
11
|
+
// early phases) or `NotImplementedError` (scheduled but not yet built).
|
|
12
|
+
// Callers convert these into AutomationResult.errorCode for the MCP layer.
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../electron/modules/platform/interfaces.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,4BAA4B;AAC5B,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,qBAAqB;AACrB,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PlatformAccessibilityAdapter } from '../interfaces';
|
|
2
|
+
import type { AxPattern, WindowHandle } from '../types';
|
|
3
|
+
import type { AxNode } from '../../accessibility/types';
|
|
4
|
+
export declare class MacosAccessibilityAdapter implements PlatformAccessibilityAdapter {
|
|
5
|
+
dumpTree(handle: WindowHandle, opts?: {
|
|
6
|
+
maxDepth?: number;
|
|
7
|
+
includeAttributes?: boolean;
|
|
8
|
+
}): Promise<AxNode>;
|
|
9
|
+
findByAutomationId(handle: WindowHandle, id: string): Promise<AxNode | null>;
|
|
10
|
+
findByRoleAndName(handle: WindowHandle, role: string, name: string, opts?: {
|
|
11
|
+
caseSensitive?: boolean;
|
|
12
|
+
}): Promise<AxNode | null>;
|
|
13
|
+
invoke(node: AxNode, pattern: AxPattern, args?: unknown): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ax.d.ts","sourceRoot":"","sources":["../../../../../electron/modules/platform/macos/ax.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AA6CxD,qBAAa,yBAA0B,YAAW,4BAA4B;IACtE,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB1G,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAO5E,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAsC/H,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAyF9E"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// macOS accessibility adapter — dumpTree delegates to @superbased/macos-ax
|
|
3
|
+
// (the optional native binding wired by macos-provider.ts); findBy* walk the
|
|
4
|
+
// dumped tree in pure JS (same as Windows); invoke routes AX pattern actions
|
|
5
|
+
// (Invoke / Toggle / SelectionItem.Select / Value.SetValue /
|
|
6
|
+
// ExpandCollapse.Expand / .Collapse) to System Events actions via osascript.
|
|
7
|
+
//
|
|
8
|
+
// osascript is ~150-250ms per call — comparable cost profile to Windows'
|
|
9
|
+
// PowerShell + UIAutomationClient shell-out. Acceptable for per-intent
|
|
10
|
+
// invocation; not ideal for high-frequency tight loops.
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MacosAccessibilityAdapter = void 0;
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const errors_1 = require("../errors");
|
|
15
|
+
const shared_1 = require("../shared");
|
|
16
|
+
const provider_1 = require("../../accessibility/provider");
|
|
17
|
+
function runOsascript(script, timeoutMs = 10_000) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
(0, child_process_1.execFile)('/usr/bin/osascript', ['-e', script], { timeout: timeoutMs, encoding: 'utf-8' }, (err, stdout, stderr) => {
|
|
20
|
+
if (err) {
|
|
21
|
+
const msg = String(stderr || err.message || '').trim();
|
|
22
|
+
reject(new Error(msg));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
resolve(String(stdout ?? '').trim());
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the process name for a WindowHandle by re-enumerating. Needed
|
|
31
|
+
* because handles carry processId:0 (cross-platform listWindows doesn't
|
|
32
|
+
* surface real PIDs).
|
|
33
|
+
*/
|
|
34
|
+
async function resolveProcessNameFromHandle(handle) {
|
|
35
|
+
const { nativeId } = (0, shared_1.decodeWindowHandle)(handle);
|
|
36
|
+
const wins = await (0, shared_1.listWindowsCrossPlatform)('darwin');
|
|
37
|
+
const hit = wins.find((w) => (0, shared_1.decodeWindowHandle)(w.handle).nativeId === nativeId);
|
|
38
|
+
return hit?.processName ?? null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a real unix PID from the process name via System Events.
|
|
42
|
+
* The macos-ax native binding requires an integer PID for getTreeForPid.
|
|
43
|
+
*/
|
|
44
|
+
async function resolvePidForProcessName(processName) {
|
|
45
|
+
const escaped = processName.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
46
|
+
try {
|
|
47
|
+
const out = await runOsascript(`tell application "System Events" to return unix id of first process whose name is "${escaped}"`);
|
|
48
|
+
const pid = parseInt(out.trim(), 10);
|
|
49
|
+
return Number.isFinite(pid) && pid > 0 ? pid : null;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class MacosAccessibilityAdapter {
|
|
56
|
+
async dumpTree(handle, opts) {
|
|
57
|
+
const provider = (0, provider_1.getProvider)();
|
|
58
|
+
if (!provider) {
|
|
59
|
+
throw new errors_1.PlatformError('UNSUPPORTED_PLATFORM', 'accessibility provider unavailable on macOS', 'Install the optional native binding: `npm install -g superbased --include=optional` — then grant Accessibility in System Settings.');
|
|
60
|
+
}
|
|
61
|
+
const processName = await resolveProcessNameFromHandle(handle);
|
|
62
|
+
if (!processName) {
|
|
63
|
+
throw new errors_1.PlatformError('WINDOW_NOT_FOUND', `dumpTree: handle ${handle} did not match any current window`);
|
|
64
|
+
}
|
|
65
|
+
const pid = await resolvePidForProcessName(processName);
|
|
66
|
+
if (pid === null) {
|
|
67
|
+
throw new errors_1.PlatformError('WINDOW_NOT_FOUND', `dumpTree: could not resolve PID for process "${processName}"`, 'Ensure the target app is running and visible to System Events.');
|
|
68
|
+
}
|
|
69
|
+
return provider.getTree({
|
|
70
|
+
pid,
|
|
71
|
+
maxDepth: opts?.maxDepth,
|
|
72
|
+
includeAttributes: opts?.includeAttributes,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async findByAutomationId(handle, id) {
|
|
76
|
+
// macOS AX uses AXIdentifier — same attribute shape as Windows AutomationId.
|
|
77
|
+
// Walk in pure JS; identical pattern to WindowsAccessibilityAdapter.
|
|
78
|
+
const tree = await this.dumpTree(handle, { maxDepth: 32, includeAttributes: true });
|
|
79
|
+
return findNode(tree, (n) => n.identifier === id || attrMatches(n.attributes, 'AXIdentifier', id) || attrMatches(n.attributes, 'AutomationId', id));
|
|
80
|
+
}
|
|
81
|
+
async findByRoleAndName(handle, role, name, opts) {
|
|
82
|
+
const tree = await this.dumpTree(handle, { maxDepth: 32 });
|
|
83
|
+
const cs = opts?.caseSensitive ?? false;
|
|
84
|
+
const match = (a, b) => {
|
|
85
|
+
if (!a || !b)
|
|
86
|
+
return false;
|
|
87
|
+
return cs ? a === b : a.toLowerCase() === b.toLowerCase();
|
|
88
|
+
};
|
|
89
|
+
const roleMatches = (nodeRole) => {
|
|
90
|
+
if (!nodeRole)
|
|
91
|
+
return false;
|
|
92
|
+
if (match(nodeRole, role))
|
|
93
|
+
return true;
|
|
94
|
+
// Cross-platform role ergonomics: callers writing win/mac-portable code
|
|
95
|
+
// pass UIA-style roles like "Button", "Edit", "CheckBox". Match those
|
|
96
|
+
// against the AX-prefixed native role ("AXButton", "AXTextField"…) so a
|
|
97
|
+
// single locator resolves on both platforms.
|
|
98
|
+
const startsWithAx = /^ax/i.test(role);
|
|
99
|
+
if (!startsWithAx && match(nodeRole, `AX${role}`))
|
|
100
|
+
return true;
|
|
101
|
+
// Common UIA → AX synonyms where the prefix swap isn't enough.
|
|
102
|
+
const lowered = role.toLowerCase();
|
|
103
|
+
const synonyms = {
|
|
104
|
+
edit: ['AXTextField', 'AXTextArea'],
|
|
105
|
+
textbox: ['AXTextField', 'AXTextArea'],
|
|
106
|
+
text: ['AXStaticText', 'AXTextField'],
|
|
107
|
+
combobox: ['AXComboBox', 'AXPopUpButton'],
|
|
108
|
+
listitem: ['AXRow', 'AXOutlineRow'],
|
|
109
|
+
static: ['AXStaticText'],
|
|
110
|
+
hyperlink: ['AXLink'],
|
|
111
|
+
};
|
|
112
|
+
const alts = synonyms[lowered];
|
|
113
|
+
if (alts) {
|
|
114
|
+
for (const alt of alts) {
|
|
115
|
+
if (match(nodeRole, alt))
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
};
|
|
121
|
+
return findNode(tree, (n) => roleMatches(n.role) && (match(n.title, name) || match(n.value, name) || match(n.description, name)));
|
|
122
|
+
}
|
|
123
|
+
async invoke(node, pattern, args) {
|
|
124
|
+
// Element targeting on macOS: AXIdentifier is the stable handle (pyramid
|
|
125
|
+
// top). The macos-ax tree carries pid + identifier on each node; we can
|
|
126
|
+
// address via `tell process id <pid> to <first UI element whose AXIdentifier
|
|
127
|
+
// is "<id>">`. FromPoint fallback isn't directly exposed via System Events
|
|
128
|
+
// — we'd need a Swift helper or private CG API. For v1, require AXIdentifier
|
|
129
|
+
// so the approach is reliable.
|
|
130
|
+
const hasId = typeof node.identifier === 'string' && node.identifier.length > 0;
|
|
131
|
+
if (!hasId) {
|
|
132
|
+
throw new errors_1.PlatformError('LOCATE_NO_MATCH', 'ax_invoke on macOS requires AXIdentifier', 'Resolve via findByAutomationId / findByRoleAndName first — macOS System Events has no FromPoint fallback. Consider synthesizing a click at the node frame center via superbased_click instead.');
|
|
133
|
+
}
|
|
134
|
+
const pid = node.pid;
|
|
135
|
+
if (typeof pid !== 'number' || pid <= 0) {
|
|
136
|
+
throw new errors_1.PlatformError('LOCATE_NO_MATCH', 'ax_invoke node missing pid', 'The node produced by dumpTree should carry pid — re-resolve via findByAutomationId.');
|
|
137
|
+
}
|
|
138
|
+
const identifier = node.identifier;
|
|
139
|
+
const escapedId = identifier.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
140
|
+
// Build the `tell` header once — `tell application "System Events" to tell (first process whose unix id is <pid>)`.
|
|
141
|
+
// Then scope UI element lookup to `entire contents` so we can find nested elements by AXIdentifier.
|
|
142
|
+
// System Events doesn't expose a fully general "find first descendant with AXIdentifier X" across
|
|
143
|
+
// arbitrary windows, so we use `whose value of attribute "AXIdentifier" is "<id>"` on `UI elements of window 1`.
|
|
144
|
+
const tellHeader = `tell application "System Events" to tell (first process whose unix id is ${pid})`;
|
|
145
|
+
const targetExpr = `(first UI element of (entire contents of window 1) whose value of attribute "AXIdentifier" is "${escapedId}")`;
|
|
146
|
+
const argRec = args ?? {};
|
|
147
|
+
const valueArg = typeof argRec.value === 'string' ? argRec.value : '';
|
|
148
|
+
let actionScript;
|
|
149
|
+
switch (pattern) {
|
|
150
|
+
case 'Invoke':
|
|
151
|
+
// AXPress is the System Events equivalent of UIA Invoke — clicks
|
|
152
|
+
// buttons, toggles menu items, activates links.
|
|
153
|
+
actionScript = `${tellHeader} to perform action "AXPress" of ${targetExpr}`;
|
|
154
|
+
break;
|
|
155
|
+
case 'Toggle':
|
|
156
|
+
// macOS AX has no dedicated Toggle pattern; controls that behave like
|
|
157
|
+
// checkboxes/radio use AXPress. Matches user expectation — Toggle a
|
|
158
|
+
// checkbox via System Events clicks it.
|
|
159
|
+
actionScript = `${tellHeader} to perform action "AXPress" of ${targetExpr}`;
|
|
160
|
+
break;
|
|
161
|
+
case 'SelectionItem.Select':
|
|
162
|
+
// AXPress selects list items / tabs / radio buttons. NSTableView + NSOutlineView
|
|
163
|
+
// rows respond; for hidden-row virtualization edge cases, scroll the row into
|
|
164
|
+
// view first via superbased_scroll.
|
|
165
|
+
actionScript = `${tellHeader} to perform action "AXPress" of ${targetExpr}`;
|
|
166
|
+
break;
|
|
167
|
+
case 'Value.SetValue': {
|
|
168
|
+
const escapedValue = valueArg.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
169
|
+
// NSAccessibility exposes AXValue settable on text fields, sliders,
|
|
170
|
+
// and stepper-like controls. For text inputs this is equivalent to
|
|
171
|
+
// Windows ValuePattern.SetValue — fast, skips synthetic typing.
|
|
172
|
+
actionScript = `${tellHeader} to set value of ${targetExpr} to "${escapedValue}"`;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
case 'ExpandCollapse.Expand':
|
|
176
|
+
// AXShowMenu / AXPress on disclosure triangles expands; the specific
|
|
177
|
+
// action name varies by control. AXPress is the universal first try.
|
|
178
|
+
actionScript = `${tellHeader} to perform action "AXPress" of ${targetExpr}`;
|
|
179
|
+
break;
|
|
180
|
+
case 'ExpandCollapse.Collapse':
|
|
181
|
+
actionScript = `${tellHeader} to perform action "AXPress" of ${targetExpr}`;
|
|
182
|
+
break;
|
|
183
|
+
default:
|
|
184
|
+
throw new errors_1.PlatformError('UNSUPPORTED_YET', `unknown AX pattern "${pattern}"`, 'Supported: Invoke / Toggle / SelectionItem.Select / Value.SetValue / ExpandCollapse.Expand / ExpandCollapse.Collapse.');
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
await runOsascript(actionScript);
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
const msg = err.message || String(err);
|
|
191
|
+
// osascript's error messages are informative enough to classify common cases.
|
|
192
|
+
if (/does not have any element whose/i.test(msg) || /can.t get first UI element/i.test(msg)) {
|
|
193
|
+
throw new errors_1.PlatformError('LOCATE_NO_MATCH', `ax_invoke could not find element with AXIdentifier "${identifier}"`, 'The element may have been removed or a different window is frontmost. Re-resolve via findByAutomationId and retry.');
|
|
194
|
+
}
|
|
195
|
+
if (/not authorized/i.test(msg) || /accessibility/i.test(msg)) {
|
|
196
|
+
throw new errors_1.PlatformError('ACCESSIBILITY_NOT_GRANTED', 'System Events is not trusted for Accessibility', 'Open System Settings → Privacy & Security → Accessibility and enable SuperBased.');
|
|
197
|
+
}
|
|
198
|
+
throw new errors_1.PlatformError('TARGET_HOSTILE', `ax_invoke(${pattern}) failed: ${msg}`, 'If the element supports AXPress / AXValue, the target process may be rejecting synthetic AX actions (sandboxing or private-window hardening).');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.MacosAccessibilityAdapter = MacosAccessibilityAdapter;
|
|
203
|
+
function findNode(root, predicate) {
|
|
204
|
+
if (predicate(root))
|
|
205
|
+
return root;
|
|
206
|
+
if (!root.children)
|
|
207
|
+
return null;
|
|
208
|
+
for (const child of root.children) {
|
|
209
|
+
const hit = findNode(child, predicate);
|
|
210
|
+
if (hit)
|
|
211
|
+
return hit;
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
function attrMatches(attrs, key, value) {
|
|
216
|
+
if (!attrs)
|
|
217
|
+
return false;
|
|
218
|
+
if (Array.isArray(attrs))
|
|
219
|
+
return false;
|
|
220
|
+
return attrs[key] === value;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=ax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../../../electron/modules/platform/macos/ax.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,6DAA6D;AAC7D,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,wDAAwD;;;AAExD,iDAAyC;AAIzC,sCAA0C;AAC1C,sCAAyE;AACzE,2DAA2D;AAE3D,SAAS,YAAY,CAAC,MAAc,EAAE,SAAS,GAAG,MAAM;IACtD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAA,wBAAQ,EAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YAChH,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,IAAK,GAAa,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAClE,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvB,OAAO;YACT,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,4BAA4B,CAAC,MAAoB;IAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,2BA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AC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,KAA2B,EAAE,GAAW,EAAE,KAAa;IAC1E,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlatformCaptureAdapter } from '../interfaces';
|
|
2
|
+
import type { DisplayInfo, Rect, RGBA, TccKind, TccState, WindowHandle } from '../types';
|
|
3
|
+
export declare class MacosCaptureAdapter implements PlatformCaptureAdapter {
|
|
4
|
+
screenshot(opts?: {
|
|
5
|
+
handle?: WindowHandle;
|
|
6
|
+
region?: Rect;
|
|
7
|
+
display?: number;
|
|
8
|
+
}): Promise<Buffer>;
|
|
9
|
+
enumerateDisplays(): Promise<DisplayInfo[]>;
|
|
10
|
+
readPixel(x: number, y: number): Promise<RGBA>;
|
|
11
|
+
probeTcc(kind: TccKind): Promise<TccState>;
|
|
12
|
+
openTccSettings(kind: TccKind): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../../../electron/modules/platform/macos/capture.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIzF,qBAAa,mBAAoB,YAAW,sBAAsB;IAC1D,UAAU,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,YAAY,CAAC;QAAC,MAAM,CAAC,EAAE,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB9F,iBAAiB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI3C,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB9C,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IA+B1C,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAWpD"}
|