superbased 1.6.4 → 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 +1349 -219
- 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 +1349 -219
- 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 +1566 -46
- 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,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// macOS capture adapter — uses Electron's desktopCapturer (already cross-platform
|
|
3
|
+
// in ../../capture.ts) for screenshot + readPixel, and `systemPreferences`
|
|
4
|
+
// for the real 0.13 TCC probes (Accessibility + Screen Recording). openTccSettings
|
|
5
|
+
// deep-links into the right System Settings pane.
|
|
6
|
+
//
|
|
7
|
+
// Window-targeted capture (opts.handle) currently falls back to fullscreen —
|
|
8
|
+
// CGWindowID-scoped capture via `/usr/sbin/screencapture -l<windowId>` requires
|
|
9
|
+
// the CGWindowID, which 7.2 MacosWindowAdapter will surface. Region + display
|
|
10
|
+
// paths are fully cross-platform via the shared captureScreen helpers.
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MacosCaptureAdapter = void 0;
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const shared_1 = require("../shared");
|
|
15
|
+
const capture_1 = require("../../capture");
|
|
16
|
+
class MacosCaptureAdapter {
|
|
17
|
+
async screenshot(opts) {
|
|
18
|
+
// (a) window-targeted — fallback to fullscreen until 7.2 wires CGWindowID
|
|
19
|
+
// resolution from the WindowHandle. Agents needing true background
|
|
20
|
+
// window capture on macOS should call focus_window first and rely on
|
|
21
|
+
// region crop.
|
|
22
|
+
if (opts?.handle) {
|
|
23
|
+
const full = await (0, capture_1.captureScreen)();
|
|
24
|
+
return full;
|
|
25
|
+
}
|
|
26
|
+
// (b) region — capture full, then crop.
|
|
27
|
+
const full = await (0, capture_1.captureScreen)();
|
|
28
|
+
if (opts?.region) {
|
|
29
|
+
return (0, capture_1.cropRegion)(full, opts.region);
|
|
30
|
+
}
|
|
31
|
+
// (c) display — per-display capture via Electron's desktopCapturer display_id.
|
|
32
|
+
if (opts?.display !== undefined && opts.display !== 0) {
|
|
33
|
+
const perDisplay = await (0, capture_1.captureScreenByDisplayId)(opts.display);
|
|
34
|
+
if (perDisplay)
|
|
35
|
+
return perDisplay;
|
|
36
|
+
}
|
|
37
|
+
return full;
|
|
38
|
+
}
|
|
39
|
+
async enumerateDisplays() {
|
|
40
|
+
return (0, shared_1.enumerateDisplaysCrossPlatform)();
|
|
41
|
+
}
|
|
42
|
+
async readPixel(x, y) {
|
|
43
|
+
// Same shape as Windows — sharp on a 1×1 crop of a fullscreen capture.
|
|
44
|
+
// The underlying captureScreen() routes through Electron's desktopCapturer
|
|
45
|
+
// on macOS when the Screen Recording TCC grant is live; a refused grant
|
|
46
|
+
// returns an empty buffer which sharp throws on — the 0.13 probe catches
|
|
47
|
+
// this upstream with a proper SCREEN_RECORDING_NOT_GRANTED code.
|
|
48
|
+
const full = await (0, capture_1.captureScreen)();
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
50
|
+
const sharp = require('sharp');
|
|
51
|
+
const { data } = await sharp(full)
|
|
52
|
+
.extract({ left: Math.max(0, Math.round(x)), top: Math.max(0, Math.round(y)), width: 1, height: 1 })
|
|
53
|
+
.raw()
|
|
54
|
+
.toBuffer({ resolveWithObject: true });
|
|
55
|
+
const r = data[0];
|
|
56
|
+
const g = data[1];
|
|
57
|
+
const b = data[2];
|
|
58
|
+
const a = data.length >= 4 ? data[3] : 255;
|
|
59
|
+
const hex = `#${[r, g, b].map((c) => c.toString(16).padStart(2, '0')).join('').toUpperCase()}`;
|
|
60
|
+
return { r, g, b, a, hex };
|
|
61
|
+
}
|
|
62
|
+
async probeTcc(kind) {
|
|
63
|
+
// Electron's systemPreferences surfaces both TCC kinds natively on macOS.
|
|
64
|
+
// Accessibility: isTrustedAccessibilityClient(false) returns true iff the
|
|
65
|
+
// current process has the Accessibility grant. `false` = don't prompt.
|
|
66
|
+
// Screen recording: getMediaAccessStatus('screen') returns 'granted' |
|
|
67
|
+
// 'denied' | 'not-determined' | 'restricted' | 'unknown'. The TCC pane can
|
|
68
|
+
// prompt on first use (not-determined) but once denied, only the user can
|
|
69
|
+
// reverse it via System Settings.
|
|
70
|
+
try {
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
72
|
+
const { systemPreferences } = require('electron');
|
|
73
|
+
if (kind === 'accessibility') {
|
|
74
|
+
const granted = typeof systemPreferences.isTrustedAccessibilityClient === 'function'
|
|
75
|
+
? systemPreferences.isTrustedAccessibilityClient(false)
|
|
76
|
+
: false;
|
|
77
|
+
return { granted: !!granted, canPrompt: !granted };
|
|
78
|
+
}
|
|
79
|
+
// screenRecording
|
|
80
|
+
const status = typeof systemPreferences.getMediaAccessStatus === 'function'
|
|
81
|
+
? systemPreferences.getMediaAccessStatus('screen')
|
|
82
|
+
: 'unknown';
|
|
83
|
+
const granted = status === 'granted';
|
|
84
|
+
const canPrompt = status === 'not-determined';
|
|
85
|
+
return { granted, canPrompt };
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// Headless / Electron unavailable — conservative default: not granted,
|
|
89
|
+
// can prompt. Keeps the 0.13 error-code path working.
|
|
90
|
+
return { granted: false, canPrompt: true };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async openTccSettings(kind) {
|
|
94
|
+
// x-apple.systempreferences URL scheme opens System Settings at the
|
|
95
|
+
// requested privacy pane. No-wait fire-and-forget — the user follows up
|
|
96
|
+
// in the GUI. Equivalent of clicking the "Open System Settings" button
|
|
97
|
+
// in a native TCC prompt.
|
|
98
|
+
const pane = kind === 'accessibility' ? 'Privacy_Accessibility' : 'Privacy_ScreenCapture';
|
|
99
|
+
const url = `x-apple.systempreferences:com.apple.preference.security?${pane}`;
|
|
100
|
+
await new Promise((resolve) => {
|
|
101
|
+
(0, child_process_1.execFile)('/usr/bin/open', [url], () => resolve());
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.MacosCaptureAdapter = MacosCaptureAdapter;
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// macOS input adapter — thin wrapper over nut-js, which uses CGEventPost +
|
|
3
|
+
// CGEventKeyboardSetUnicodeString under the hood on darwin. Mirrors the
|
|
4
|
+
// WindowsInputAdapter shape intentionally; nut-js helpers (getNut,
|
|
5
|
+
// mapModifiers, resolveKey, sendInputNutJs) are duplicated here rather than
|
|
6
|
+
// extracted to stay surgical — see windows/input.ts for the twin. Divergence:
|
|
7
|
+
//
|
|
8
|
+
// - No PostMessage path on macOS (no HWND message queue → everything is
|
|
9
|
+
// CGEventPost against the foreground app; caller must activate first).
|
|
10
|
+
// - Horizontal scroll uses nut-js scrollLeft/Right (no MOUSEEVENTF_HWHEEL).
|
|
11
|
+
// - typeUnicode already wired via 0.16 (CGEventKeyboardSetUnicodeString).
|
|
12
|
+
// - enumerateTrayIcons stays UnsupportedPlatformError (roadmap §268 —
|
|
13
|
+
// NSStatusItem enumeration needs private AppKit APIs).
|
|
14
|
+
//
|
|
15
|
+
// TCC prerequisites (runtime-granted by the user):
|
|
16
|
+
// - Accessibility permission required for ALL CGEventPost operations
|
|
17
|
+
// (click/type/hotkey/scroll/drag/hover). The 0.13 probe surfaces a
|
|
18
|
+
// System Settings deep-link when refused.
|
|
19
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
23
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}) : (function(o, m, k, k2) {
|
|
27
|
+
if (k2 === undefined) k2 = k;
|
|
28
|
+
o[k2] = m[k];
|
|
29
|
+
}));
|
|
30
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
31
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
32
|
+
}) : function(o, v) {
|
|
33
|
+
o["default"] = v;
|
|
34
|
+
});
|
|
35
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
36
|
+
var ownKeys = function(o) {
|
|
37
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.MacosInputAdapter = void 0;
|
|
54
|
+
const errors_1 = require("../errors");
|
|
55
|
+
let nutJs = null;
|
|
56
|
+
function getNut() {
|
|
57
|
+
if (nutJs)
|
|
58
|
+
return nutJs;
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
60
|
+
nutJs = require('@nut-tree-fork/nut-js');
|
|
61
|
+
nutJs.keyboard.config.autoDelayMs = 5;
|
|
62
|
+
return nutJs;
|
|
63
|
+
}
|
|
64
|
+
function mapModifiers(mods) {
|
|
65
|
+
if (!mods || mods.length === 0)
|
|
66
|
+
return [];
|
|
67
|
+
const nut = getNut();
|
|
68
|
+
return mods.map((m) => {
|
|
69
|
+
switch (m) {
|
|
70
|
+
case 'shift': return nut.Key.LeftShift;
|
|
71
|
+
case 'ctrl': return nut.Key.LeftControl;
|
|
72
|
+
case 'alt': return nut.Key.LeftAlt;
|
|
73
|
+
// `meta` → Cmd on macOS (LeftSuper maps to Command in nut-js darwin).
|
|
74
|
+
case 'meta': return nut.Key.LeftSuper;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function resolveKey(name) {
|
|
79
|
+
const nut = getNut();
|
|
80
|
+
const k = name.replace(/[{}]/g, '').trim();
|
|
81
|
+
const lower = k.toLowerCase();
|
|
82
|
+
// On macOS, `cmd` / `meta` / `win` / `super` all map to Command (LeftSuper
|
|
83
|
+
// in nut-js's cross-platform table). `cmdOrCtrl` resolves to Cmd here (vs
|
|
84
|
+
// Ctrl on Windows) per Electron's standard modifier convention — agents
|
|
85
|
+
// writing cross-platform sequences get the right native key.
|
|
86
|
+
if (['cmd', 'meta', 'win', 'super', 'command'].includes(lower))
|
|
87
|
+
return nut.Key.LeftSuper;
|
|
88
|
+
if (lower === 'cmdorctrl' || lower === 'commandorcontrol')
|
|
89
|
+
return nut.Key.LeftSuper;
|
|
90
|
+
if (lower === 'ctrl' || lower === 'control')
|
|
91
|
+
return nut.Key.LeftControl;
|
|
92
|
+
if (lower === 'shift')
|
|
93
|
+
return nut.Key.LeftShift;
|
|
94
|
+
if (lower === 'alt' || lower === 'option')
|
|
95
|
+
return nut.Key.LeftAlt;
|
|
96
|
+
if (lower === 'enter' || lower === 'return')
|
|
97
|
+
return nut.Key.Return;
|
|
98
|
+
if (lower === 'tab')
|
|
99
|
+
return nut.Key.Tab;
|
|
100
|
+
if (lower === 'esc' || lower === 'escape')
|
|
101
|
+
return nut.Key.Escape;
|
|
102
|
+
if (lower === 'space' || lower === 'spacebar')
|
|
103
|
+
return nut.Key.Space;
|
|
104
|
+
if (lower === 'backspace')
|
|
105
|
+
return nut.Key.Backspace;
|
|
106
|
+
if (lower === 'delete' || lower === 'del')
|
|
107
|
+
return nut.Key.Delete;
|
|
108
|
+
if (lower === 'left')
|
|
109
|
+
return nut.Key.Left;
|
|
110
|
+
if (lower === 'right')
|
|
111
|
+
return nut.Key.Right;
|
|
112
|
+
if (lower === 'up')
|
|
113
|
+
return nut.Key.Up;
|
|
114
|
+
if (lower === 'down')
|
|
115
|
+
return nut.Key.Down;
|
|
116
|
+
if (lower === 'home')
|
|
117
|
+
return nut.Key.Home;
|
|
118
|
+
if (lower === 'end')
|
|
119
|
+
return nut.Key.End;
|
|
120
|
+
if (lower === 'pageup' || lower === 'pgup')
|
|
121
|
+
return nut.Key.PageUp;
|
|
122
|
+
if (lower === 'pagedown' || lower === 'pgdn')
|
|
123
|
+
return nut.Key.PageDown;
|
|
124
|
+
if (/^f([1-9]|1[0-2])$/.test(lower)) {
|
|
125
|
+
const n = Number(lower.slice(1));
|
|
126
|
+
return nut.Key[`F${n}`];
|
|
127
|
+
}
|
|
128
|
+
if (k.length === 1) {
|
|
129
|
+
const upper = k.toUpperCase();
|
|
130
|
+
const nutKey = nut.Key[upper];
|
|
131
|
+
if (nutKey !== undefined)
|
|
132
|
+
return nutKey;
|
|
133
|
+
}
|
|
134
|
+
throw new Error(`unrecognized key: "${name}"`);
|
|
135
|
+
}
|
|
136
|
+
async function sendInputNutJs(combo) {
|
|
137
|
+
const nut = getNut();
|
|
138
|
+
const parts = combo.split('+').map((p) => p.trim()).filter(Boolean);
|
|
139
|
+
const keys = parts.map(resolveKey);
|
|
140
|
+
await nut.keyboard.pressKey(...keys);
|
|
141
|
+
await nut.keyboard.releaseKey(...keys);
|
|
142
|
+
}
|
|
143
|
+
class MacosInputAdapter {
|
|
144
|
+
async click(_handle, x, y, opts) {
|
|
145
|
+
const nut = getNut();
|
|
146
|
+
const mods = mapModifiers(opts?.modifiers);
|
|
147
|
+
if (mods.length)
|
|
148
|
+
await nut.keyboard.pressKey(...mods);
|
|
149
|
+
try {
|
|
150
|
+
await nut.mouse.move([new nut.Point(x, y)]);
|
|
151
|
+
const count = opts?.clickCount ?? 1;
|
|
152
|
+
// Tier A4 — explicit hold-time split. Mirrors WindowsInputAdapter.
|
|
153
|
+
// See its comment for rationale; behavior is identical on darwin.
|
|
154
|
+
const holdMs = (count === 1 && opts?.holdMs && opts.holdMs > 0) ? opts.holdMs : 0;
|
|
155
|
+
if (opts?.button === 'right') {
|
|
156
|
+
if (holdMs > 0) {
|
|
157
|
+
await nut.mouse.pressButton(nut.Button.RIGHT);
|
|
158
|
+
await new Promise((r) => setTimeout(r, holdMs));
|
|
159
|
+
await nut.mouse.releaseButton(nut.Button.RIGHT);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
await nut.mouse.rightClick();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else if (opts?.button === 'middle') {
|
|
166
|
+
await nut.mouse.pressButton(nut.Button.MIDDLE);
|
|
167
|
+
if (holdMs > 0)
|
|
168
|
+
await new Promise((r) => setTimeout(r, holdMs));
|
|
169
|
+
await nut.mouse.releaseButton(nut.Button.MIDDLE);
|
|
170
|
+
}
|
|
171
|
+
else if (count === 2) {
|
|
172
|
+
await nut.mouse.doubleClick();
|
|
173
|
+
}
|
|
174
|
+
else if (count === 3) {
|
|
175
|
+
await nut.mouse.leftClick();
|
|
176
|
+
await nut.mouse.leftClick();
|
|
177
|
+
await nut.mouse.leftClick();
|
|
178
|
+
}
|
|
179
|
+
else if (holdMs > 0) {
|
|
180
|
+
await nut.mouse.pressButton(nut.Button.LEFT);
|
|
181
|
+
await new Promise((r) => setTimeout(r, holdMs));
|
|
182
|
+
await nut.mouse.releaseButton(nut.Button.LEFT);
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
await nut.mouse.leftClick();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
if (mods.length)
|
|
190
|
+
await nut.keyboard.releaseKey(...mods);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async type(_handle, text, opts) {
|
|
194
|
+
const nut = getNut();
|
|
195
|
+
if (opts?.clearFirst) {
|
|
196
|
+
// macOS uses Cmd+A for select-all, not Ctrl+A — inverse of Windows.
|
|
197
|
+
await nut.keyboard.pressKey(nut.Key.LeftSuper, nut.Key.A);
|
|
198
|
+
await nut.keyboard.releaseKey(nut.Key.LeftSuper, nut.Key.A);
|
|
199
|
+
await nut.keyboard.pressKey(nut.Key.Delete);
|
|
200
|
+
await nut.keyboard.releaseKey(nut.Key.Delete);
|
|
201
|
+
}
|
|
202
|
+
if (opts?.delayMs && opts.delayMs > 0) {
|
|
203
|
+
for (const ch of text) {
|
|
204
|
+
await nut.keyboard.type(ch);
|
|
205
|
+
await new Promise((r) => setTimeout(r, opts.delayMs));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
await nut.keyboard.type(text);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async typeUnicode(_handle, text, opts) {
|
|
213
|
+
// 0.16 seam — CGEventKeyboardSetUnicodeString lives in core/input-injection.
|
|
214
|
+
const { typeUnicode } = await Promise.resolve().then(() => __importStar(require('../../../core/input-injection')));
|
|
215
|
+
await typeUnicode(text, { delayMs: opts?.delayMs });
|
|
216
|
+
}
|
|
217
|
+
async sendHotkey(_handle, combo, _opts) {
|
|
218
|
+
// macOS has no HWND message queue — every hotkey goes through CGEventPost
|
|
219
|
+
// against the foreground app. Caller must have activated the target
|
|
220
|
+
// first (superbased_focus_window). Method 'postmessage' is a no-op on
|
|
221
|
+
// darwin; we always use SendInput-equivalent (nut-js CGEventPost).
|
|
222
|
+
await sendInputNutJs(combo);
|
|
223
|
+
return { methodUsed: 'sendinput' };
|
|
224
|
+
}
|
|
225
|
+
async scroll(_handle, anchor, opts) {
|
|
226
|
+
const nut = getNut();
|
|
227
|
+
await nut.mouse.move([new nut.Point(anchor.x, anchor.y)]);
|
|
228
|
+
if (opts.axis === 'x') {
|
|
229
|
+
// nut-js scrollLeft/Right map to CGEventCreateScrollWheelEvent on darwin
|
|
230
|
+
// with horizontal axis — real hardware-style horizontal scroll, not
|
|
231
|
+
// Shift+Wheel-simulated. Chromium / Finder / tables respond correctly.
|
|
232
|
+
if (opts.amount > 0)
|
|
233
|
+
await nut.mouse.scrollRight(opts.amount);
|
|
234
|
+
else if (opts.amount < 0)
|
|
235
|
+
await nut.mouse.scrollLeft(-opts.amount);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (opts.amount > 0)
|
|
239
|
+
await nut.mouse.scrollDown(opts.amount);
|
|
240
|
+
else if (opts.amount < 0)
|
|
241
|
+
await nut.mouse.scrollUp(-opts.amount);
|
|
242
|
+
}
|
|
243
|
+
async drag(_handle, path, opts) {
|
|
244
|
+
if (path.length < 2) {
|
|
245
|
+
throw new Error('drag requires at least 2 points (start + end)');
|
|
246
|
+
}
|
|
247
|
+
const nut = getNut();
|
|
248
|
+
const button = opts?.button === 'right' ? nut.Button.RIGHT : nut.Button.LEFT;
|
|
249
|
+
const totalDuration = opts?.durationMs ?? 200;
|
|
250
|
+
const stepsPerSegment = Math.max(1, opts?.steps ?? 10);
|
|
251
|
+
// Per-segment timing — same shape as Windows 3.3. atMs overrides equal
|
|
252
|
+
// slicing when any waypoint provides it; mixed / inverted atMs values
|
|
253
|
+
// fall back to equal slicing.
|
|
254
|
+
const segments = path.length - 1;
|
|
255
|
+
const usesAtMs = path.some((p) => typeof p.atMs === 'number');
|
|
256
|
+
const perSegmentMsAll = new Array(segments);
|
|
257
|
+
if (usesAtMs) {
|
|
258
|
+
const atMs = path.map((p, i) => {
|
|
259
|
+
if (typeof p.atMs === 'number' && p.atMs >= 0)
|
|
260
|
+
return p.atMs;
|
|
261
|
+
return (i / (path.length - 1)) * totalDuration;
|
|
262
|
+
});
|
|
263
|
+
let sane = true;
|
|
264
|
+
for (let i = 0; i < segments; i++) {
|
|
265
|
+
const d = atMs[i + 1] - atMs[i];
|
|
266
|
+
if (!Number.isFinite(d) || d < 0) {
|
|
267
|
+
sane = false;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
perSegmentMsAll[i] = d;
|
|
271
|
+
}
|
|
272
|
+
if (!sane) {
|
|
273
|
+
const equal = totalDuration / segments;
|
|
274
|
+
for (let i = 0; i < segments; i++)
|
|
275
|
+
perSegmentMsAll[i] = equal;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
const equal = totalDuration / segments;
|
|
280
|
+
for (let i = 0; i < segments; i++)
|
|
281
|
+
perSegmentMsAll[i] = equal;
|
|
282
|
+
}
|
|
283
|
+
const mods = mapModifiers(opts?.modifiers);
|
|
284
|
+
if (mods.length)
|
|
285
|
+
await nut.keyboard.pressKey(...mods);
|
|
286
|
+
try {
|
|
287
|
+
// Primitive press/interp/release sequence. macOS apps (Finder, native
|
|
288
|
+
// NSWindow drag, browser DnD) expect CGEventMouseDragged between
|
|
289
|
+
// mouseDown and mouseUp — nut-js emits these when we setPosition while
|
|
290
|
+
// the button is held.
|
|
291
|
+
await nut.mouse.setPosition(new nut.Point(path[0].x, path[0].y));
|
|
292
|
+
await nut.mouse.pressButton(button);
|
|
293
|
+
try {
|
|
294
|
+
for (let s = 0; s < segments; s++) {
|
|
295
|
+
const a = path[s];
|
|
296
|
+
const b = path[s + 1];
|
|
297
|
+
const segMs = perSegmentMsAll[s];
|
|
298
|
+
const stepDelay = segMs / stepsPerSegment;
|
|
299
|
+
for (let i = 1; i <= stepsPerSegment; i++) {
|
|
300
|
+
const t = i / stepsPerSegment;
|
|
301
|
+
const x = Math.round(a.x + (b.x - a.x) * t);
|
|
302
|
+
const y = Math.round(a.y + (b.y - a.y) * t);
|
|
303
|
+
await nut.mouse.setPosition(new nut.Point(x, y));
|
|
304
|
+
if (stepDelay > 0)
|
|
305
|
+
await new Promise((r) => setTimeout(r, stepDelay));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
finally {
|
|
310
|
+
await nut.mouse.releaseButton(button);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
finally {
|
|
314
|
+
if (mods.length)
|
|
315
|
+
await nut.keyboard.releaseKey(...mods);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
async hover(_handle, x, y, opts) {
|
|
319
|
+
// Pure mouse-move with dwell; no button press. Matches Windows 2.2.
|
|
320
|
+
const nut = getNut();
|
|
321
|
+
await nut.mouse.setPosition(new nut.Point(x, y));
|
|
322
|
+
const dwell = Math.max(0, opts?.dwellMs ?? 0);
|
|
323
|
+
if (dwell > 0)
|
|
324
|
+
await new Promise((r) => setTimeout(r, dwell));
|
|
325
|
+
}
|
|
326
|
+
async getCursorPosition() {
|
|
327
|
+
// nut.mouse.getPosition() routes to CGEventSourceGetMouseLocation on
|
|
328
|
+
// darwin. Returns coords in points (the same logical-pixel space the rest
|
|
329
|
+
// of the macOS adapter accepts), so callers can feed the result back into
|
|
330
|
+
// click/hover/drag without conversion.
|
|
331
|
+
const nut = getNut();
|
|
332
|
+
const p = await nut.mouse.getPosition();
|
|
333
|
+
return { x: p.x, y: p.y };
|
|
334
|
+
}
|
|
335
|
+
async enumerateTrayIcons(_opts) {
|
|
336
|
+
// 5.2 roadmap §268 limitation — NSStatusItem enumeration needs private
|
|
337
|
+
// AppKit APIs or menu-bar image-matching. No v1 implementation.
|
|
338
|
+
throw new errors_1.UnsupportedPlatformError('MacosInputAdapter.enumerateTrayIcons', 'darwin');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
exports.MacosInputAdapter = MacosInputAdapter;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// macOS launch adapter — shells out to /usr/bin/open (the standard launcher
|
|
3
|
+
// entry that NSWorkspace uses internally). Mirrors WindowsLaunchAdapter shape;
|
|
4
|
+
// same three spec fields (path | name | url) and same PID-returned-or-0 contract.
|
|
5
|
+
//
|
|
6
|
+
// /usr/bin/open semantics:
|
|
7
|
+
// - `open -a <AppName>` launch by app name (e.g. "Safari")
|
|
8
|
+
// - `open <path>` launch by absolute path (.app bundle or file)
|
|
9
|
+
// - `open <url>` route through default handler
|
|
10
|
+
// - `open -a <App> --args ...` pass args after the app target
|
|
11
|
+
// - `open -a <App> <url>` open a URL in a specific app
|
|
12
|
+
//
|
|
13
|
+
// open does not reliably surface the launched PID, so launch() returns
|
|
14
|
+
// processId:0 for URL launches and when the target app is already running —
|
|
15
|
+
// callers fall back to waitForWindow(processName | titleMatch) to resolve the
|
|
16
|
+
// window handle after launch.
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MacosLaunchAdapter = void 0;
|
|
19
|
+
const child_process_1 = require("child_process");
|
|
20
|
+
const errors_1 = require("../errors");
|
|
21
|
+
const shared_1 = require("../shared");
|
|
22
|
+
function execOpen(args, timeoutMs = 10_000) {
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
(0, child_process_1.execFile)('/usr/bin/open', args, { timeout: timeoutMs, encoding: 'utf-8' }, (err, stdout, stderr) => {
|
|
25
|
+
const code = err && typeof err.code === 'number' ? err.code : 0;
|
|
26
|
+
resolve({ code: err ? (code || 1) : 0, stdout: String(stdout ?? ''), stderr: String(stderr ?? '') });
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
class MacosLaunchAdapter {
|
|
31
|
+
async launch(spec) {
|
|
32
|
+
if (!spec.path && !spec.name && !spec.url) {
|
|
33
|
+
throw new errors_1.PlatformError('TARGET_HOSTILE', 'launch requires one of { path, name, url }', 'Pass exactly one of the three.');
|
|
34
|
+
}
|
|
35
|
+
// Precedence matches Windows: path → url → name.
|
|
36
|
+
let args;
|
|
37
|
+
if (spec.path) {
|
|
38
|
+
// Absolute path — `open <path> [--args ...]`. For .app bundles this
|
|
39
|
+
// launches the app; for CLI binaries it runs them.
|
|
40
|
+
args = [spec.path];
|
|
41
|
+
if (spec.args && spec.args.length > 0)
|
|
42
|
+
args.push('--args', ...spec.args);
|
|
43
|
+
}
|
|
44
|
+
else if (spec.url) {
|
|
45
|
+
args = [spec.url];
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// name → `open -a <AppName> [--args ...]`. Accepts bundle display name.
|
|
49
|
+
args = ['-a', spec.name];
|
|
50
|
+
if (spec.args && spec.args.length > 0)
|
|
51
|
+
args.push('--args', ...spec.args);
|
|
52
|
+
}
|
|
53
|
+
const res = await execOpen(args);
|
|
54
|
+
if (res.code !== 0) {
|
|
55
|
+
const msg = (res.stderr || res.stdout || `open exited with code ${res.code}`).trim();
|
|
56
|
+
throw new errors_1.PlatformError('TARGET_HOSTILE', `launch failed: ${msg}`, 'Check that the path/name/url resolves and the app is installed. For name, use the exact display name (e.g. "Google Chrome", not "chrome").');
|
|
57
|
+
}
|
|
58
|
+
// open(1) doesn't return the launched PID — return 0 and let callers
|
|
59
|
+
// fall back to waitForWindow for the real window handle.
|
|
60
|
+
return { processId: 0 };
|
|
61
|
+
}
|
|
62
|
+
async openUrl(url, opts) {
|
|
63
|
+
if (typeof url !== 'string' || url.length === 0) {
|
|
64
|
+
throw new errors_1.PlatformError('TARGET_HOSTILE', 'openUrl requires a non-empty url');
|
|
65
|
+
}
|
|
66
|
+
// Without a browser: `open <url>` routes via LaunchServices → default browser.
|
|
67
|
+
if (!opts?.browser) {
|
|
68
|
+
return this.launch({ url });
|
|
69
|
+
}
|
|
70
|
+
// With a browser: `open -a <browser> <url>` opens the URL in that specific app.
|
|
71
|
+
const args = ['-a', opts.browser, url];
|
|
72
|
+
const res = await execOpen(args);
|
|
73
|
+
if (res.code !== 0) {
|
|
74
|
+
const msg = (res.stderr || res.stdout || `open exited with code ${res.code}`).trim();
|
|
75
|
+
throw new errors_1.PlatformError('TARGET_HOSTILE', `openUrl failed: ${msg}`, `Check that "${opts.browser}" resolves to an installed app (e.g. "Google Chrome", "Safari", "Firefox").`);
|
|
76
|
+
}
|
|
77
|
+
return { processId: 0 };
|
|
78
|
+
}
|
|
79
|
+
async waitForWindow(opts) {
|
|
80
|
+
const intervalMs = opts.intervalMs ?? 200;
|
|
81
|
+
const timeoutMs = opts.timeoutMs;
|
|
82
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
83
|
+
throw new errors_1.PlatformError('TARGET_HOSTILE', 'waitForWindow requires a positive timeoutMs');
|
|
84
|
+
}
|
|
85
|
+
const deadline = Date.now() + timeoutMs;
|
|
86
|
+
const titleNeedle = opts.titleMatch?.toLowerCase();
|
|
87
|
+
const procNeedle = opts.processName?.toLowerCase();
|
|
88
|
+
while (Date.now() < deadline) {
|
|
89
|
+
try {
|
|
90
|
+
const wins = await (0, shared_1.listWindowsCrossPlatform)('darwin');
|
|
91
|
+
for (const w of wins) {
|
|
92
|
+
const title = (w.title ?? '').toLowerCase();
|
|
93
|
+
const proc = (w.processName ?? '').toLowerCase();
|
|
94
|
+
if (titleNeedle && !title.includes(titleNeedle))
|
|
95
|
+
continue;
|
|
96
|
+
if (procNeedle && !proc.includes(procNeedle))
|
|
97
|
+
continue;
|
|
98
|
+
// Without either matcher, we'd return the first visible window —
|
|
99
|
+
// refuse that footgun and require at least one.
|
|
100
|
+
if (!titleNeedle && !procNeedle)
|
|
101
|
+
break;
|
|
102
|
+
return w;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// Swallow transient listWindows failures; the polling loop retries.
|
|
107
|
+
}
|
|
108
|
+
await new Promise((r) => setTimeout(r, intervalMs));
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.MacosLaunchAdapter = MacosLaunchAdapter;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MacosSessionAdapter = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
class MacosSessionAdapter {
|
|
6
|
+
async probeSessionState() {
|
|
7
|
+
throw new errors_1.UnsupportedPlatformError('MacosSessionAdapter.probeSessionState', 'darwin');
|
|
8
|
+
}
|
|
9
|
+
async registerAbortHotkey(_combo, _handler) {
|
|
10
|
+
throw new errors_1.UnsupportedPlatformError('MacosSessionAdapter.registerAbortHotkey', 'darwin');
|
|
11
|
+
}
|
|
12
|
+
async getCurrentProcessIntegrityLevel() {
|
|
13
|
+
throw new errors_1.UnsupportedPlatformError('MacosSessionAdapter.getCurrentProcessIntegrityLevel', 'darwin');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.MacosSessionAdapter = MacosSessionAdapter;
|