superbased 1.6.4 → 2.0.1
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 +230 -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 +66 -8
- 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,599 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// `superbased doctor` — diagnostic check.
|
|
3
|
+
//
|
|
4
|
+
// Verifies environment health: native module loads, port :47592 owner,
|
|
5
|
+
// auth token presence, data directory writability, ffmpeg availability,
|
|
6
|
+
// app version. Output is human-readable with traffic-light dots.
|
|
7
|
+
//
|
|
8
|
+
// `--bundle` flag prints a copy-pasteable diagnostic block (with secrets
|
|
9
|
+
// redacted) suitable for bug reports.
|
|
10
|
+
//
|
|
11
|
+
// Per Pre-Flight Finding F13: a desktop instance owning :47592 is NOT an
|
|
12
|
+
// error — the headless `mcp` command bridges to it transparently.
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.runDoctor = runDoctor;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const os = __importStar(require("os"));
|
|
51
|
+
const childProcess = __importStar(require("child_process"));
|
|
52
|
+
const paths_1 = require("../electron/core/paths");
|
|
53
|
+
const process_coord_1 = require("../electron/core/process-coord");
|
|
54
|
+
const auth_store_1 = require("../electron/core/auth-store");
|
|
55
|
+
const config_1 = require("../electron/core/config");
|
|
56
|
+
const DOT = {
|
|
57
|
+
green: '\u001b[32m●\u001b[0m',
|
|
58
|
+
yellow: '\u001b[33m●\u001b[0m',
|
|
59
|
+
red: '\u001b[31m●\u001b[0m',
|
|
60
|
+
};
|
|
61
|
+
const STATUS_PLAIN = { green: 'OK', yellow: 'WARN', red: 'FAIL' };
|
|
62
|
+
// ── Individual checks ──
|
|
63
|
+
function checkVersion() {
|
|
64
|
+
return { label: 'SuperBased version', status: 'green', detail: `v${(0, config_1.getVersion)()}` };
|
|
65
|
+
}
|
|
66
|
+
function checkNode() {
|
|
67
|
+
// Runtime requires N-API (stable across Node versions since 8.9) and the
|
|
68
|
+
// features we actually use land in Node 20. The `engines.node: >=22.12.0`
|
|
69
|
+
// pin in package.json is informational and exists for the DESKTOP BUILD
|
|
70
|
+
// toolchain (@electron/notarize + node-abi in `npm run dist:win/mac`),
|
|
71
|
+
// not for the runtime CLI / api-server / MCP / sherpa-onnx paths. Split
|
|
72
|
+
// the signal: red only when runtime is actually broken (< 20); yellow
|
|
73
|
+
// when below the build-toolchain pin but runtime is fine.
|
|
74
|
+
const major = Number(process.versions.node.split('.')[0]);
|
|
75
|
+
if (major < 20) {
|
|
76
|
+
return {
|
|
77
|
+
label: 'Node runtime',
|
|
78
|
+
status: 'red',
|
|
79
|
+
detail: `Node ${process.version} (need ≥ 20; runtime requires Node 20+ for current N-API features)`,
|
|
80
|
+
hint: 'Upgrade Node: https://nodejs.org/',
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (major < 22) {
|
|
84
|
+
return {
|
|
85
|
+
label: 'Node runtime',
|
|
86
|
+
status: 'yellow',
|
|
87
|
+
detail: `Node ${process.version} (runtime OK; build toolchain prefers 22+)`,
|
|
88
|
+
hint: 'Node 22+ is required ONLY for `npm run dist:win` / `dist:mac` (electron-builder + notarize). Runtime paths — CLI, API server, MCP, sherpa-onnx — work on 20 or 22. Upgrade at your leisure, not a correctness issue.',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { label: 'Node runtime', status: 'green', detail: process.version };
|
|
92
|
+
}
|
|
93
|
+
function checkPlatform() {
|
|
94
|
+
return { label: 'Platform', status: 'green', detail: `${process.platform}/${process.arch}` };
|
|
95
|
+
}
|
|
96
|
+
function checkDataDir() {
|
|
97
|
+
try {
|
|
98
|
+
const dir = (0, paths_1.resolveDataDir)();
|
|
99
|
+
if (!fs.existsSync(dir)) {
|
|
100
|
+
return { label: 'Data directory', status: 'yellow', detail: `${dir} (does not exist yet)`, hint: 'Will be created on first capture.' };
|
|
101
|
+
}
|
|
102
|
+
// Test writability
|
|
103
|
+
const probe = path.join(dir, '.write-test');
|
|
104
|
+
fs.writeFileSync(probe, 'ok');
|
|
105
|
+
fs.unlinkSync(probe);
|
|
106
|
+
return { label: 'Data directory', status: 'green', detail: `${dir} (writable)` };
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return { label: 'Data directory', status: 'red', detail: String(err), hint: 'Fix filesystem permissions on ~/.superbased/.' };
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function checkPortOwner() {
|
|
113
|
+
const info = (0, process_coord_1.readPidFile)();
|
|
114
|
+
if (!info) {
|
|
115
|
+
return { label: 'Port :47592', status: 'green', detail: 'free (no instance running)' };
|
|
116
|
+
}
|
|
117
|
+
// F13: desktop already owning the port is not a problem — `superbased mcp` bridges.
|
|
118
|
+
if (info.clientType === 'desktop') {
|
|
119
|
+
return {
|
|
120
|
+
label: 'Port :47592',
|
|
121
|
+
status: 'green',
|
|
122
|
+
detail: `desktop instance running (pid ${info.pid}, since ${info.startedAt})`,
|
|
123
|
+
hint: '`superbased mcp` will bridge to the running desktop app — no separate server needed.',
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
label: 'Port :47592',
|
|
128
|
+
status: 'green',
|
|
129
|
+
detail: `headless instance running (pid ${info.pid}, since ${info.startedAt})`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function checkAuth() {
|
|
133
|
+
try {
|
|
134
|
+
const token = (0, auth_store_1.getTokenStore)().loadToken();
|
|
135
|
+
if (!token) {
|
|
136
|
+
return {
|
|
137
|
+
label: 'Authentication',
|
|
138
|
+
status: 'yellow',
|
|
139
|
+
detail: 'not signed in',
|
|
140
|
+
hint: '`superbased auth login` unlocks cloud AI vision and dictation. Most tools work without it.',
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// Decode JWT payload (no verification — just for diagnostic display)
|
|
144
|
+
const parts = token.split('.');
|
|
145
|
+
if (parts.length !== 3) {
|
|
146
|
+
return { label: 'Authentication', status: 'yellow', detail: 'token present but unparseable' };
|
|
147
|
+
}
|
|
148
|
+
let payload;
|
|
149
|
+
try {
|
|
150
|
+
payload = JSON.parse(Buffer.from(parts[1], 'base64url').toString());
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return { label: 'Authentication', status: 'yellow', detail: 'token present but JSON-decode failed' };
|
|
154
|
+
}
|
|
155
|
+
if (payload.exp && Date.now() / 1000 > payload.exp) {
|
|
156
|
+
return {
|
|
157
|
+
label: 'Authentication',
|
|
158
|
+
status: 'red',
|
|
159
|
+
detail: `token expired ${new Date(payload.exp * 1000).toISOString()}`,
|
|
160
|
+
hint: '`superbased auth logout && superbased auth login` to refresh.',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
label: 'Authentication',
|
|
165
|
+
status: 'green',
|
|
166
|
+
detail: `signed in as ${payload.email || payload.sub} (${payload.plan || 'free'} plan)`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
return { label: 'Authentication', status: 'red', detail: `auth-store error: ${String(err)}` };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function checkNativeModule(name) {
|
|
174
|
+
try {
|
|
175
|
+
require(name);
|
|
176
|
+
return { label: `Native module: ${name}`, status: 'green', detail: 'loadable' };
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
const msg = err.message || String(err);
|
|
180
|
+
return {
|
|
181
|
+
label: `Native module: ${name}`,
|
|
182
|
+
status: 'red',
|
|
183
|
+
detail: msg.split('\n')[0].slice(0, 120),
|
|
184
|
+
hint: `Reinstall: \`npm install -g superbased --force\`. If the binary is missing for your platform, file an issue.`,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function checkFfmpeg() {
|
|
189
|
+
let bundledPath;
|
|
190
|
+
try {
|
|
191
|
+
bundledPath = require('ffmpeg-static');
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
bundledPath = undefined;
|
|
195
|
+
}
|
|
196
|
+
if (bundledPath && fs.existsSync(bundledPath)) {
|
|
197
|
+
try {
|
|
198
|
+
childProcess.execSync(`"${bundledPath}" -hide_banner -version`, { stdio: 'pipe', timeout: 3000 });
|
|
199
|
+
return { label: 'ffmpeg (bundled)', status: 'green', detail: bundledPath };
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return { label: 'ffmpeg (bundled)', status: 'yellow', detail: `${bundledPath} (binary present but not executable)` };
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Fallback: check system ffmpeg
|
|
206
|
+
try {
|
|
207
|
+
childProcess.execSync('ffmpeg -hide_banner -version', { stdio: 'pipe', timeout: 3000 });
|
|
208
|
+
return { label: 'ffmpeg (system)', status: 'green', detail: 'on PATH (no bundled copy)' };
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return {
|
|
212
|
+
label: 'ffmpeg',
|
|
213
|
+
status: 'yellow',
|
|
214
|
+
detail: 'not found',
|
|
215
|
+
hint: 'Mic dictation in headless mode needs ffmpeg. Bundled via ffmpeg-static; reinstall if missing.',
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function checkOsHints() {
|
|
220
|
+
switch (process.platform) {
|
|
221
|
+
case 'darwin':
|
|
222
|
+
return {
|
|
223
|
+
label: 'macOS permissions',
|
|
224
|
+
status: 'yellow',
|
|
225
|
+
detail: 'auto-detection not implemented',
|
|
226
|
+
hint: 'Grant Screen Recording, Accessibility, and Microphone in System Settings → Privacy & Security to your terminal app and (when installed) SuperBased.app.',
|
|
227
|
+
};
|
|
228
|
+
case 'win32':
|
|
229
|
+
return {
|
|
230
|
+
label: 'Windows permissions',
|
|
231
|
+
status: 'green',
|
|
232
|
+
detail: 'no special permissions required for capture/OCR/clipboard',
|
|
233
|
+
hint: 'Mic + AX features may prompt at first use.',
|
|
234
|
+
};
|
|
235
|
+
default:
|
|
236
|
+
return {
|
|
237
|
+
label: 'Linux permissions',
|
|
238
|
+
status: 'yellow',
|
|
239
|
+
detail: 'X11/Wayland-dependent',
|
|
240
|
+
hint: 'X11: works out-of-box. Wayland: screen capture may need portal/pipewire setup; input injection needs uinput access.',
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// sherpa-onnx-node install health — optional native dep used for offline STT.
|
|
245
|
+
// Ships as `optionalDependencies` in desktop/package.json so a failing prebuild
|
|
246
|
+
// doesn't block the whole `npm install -g superbased`. The downside: users
|
|
247
|
+
// hit `superbased_dictate engine="sherpa"` and get `binary_not_installed`
|
|
248
|
+
// without knowing why the binary silently failed to land. This check surfaces
|
|
249
|
+
// the distinction between "module not present at all" (yellow — expected if
|
|
250
|
+
// the user opted out of optional deps) and "module present but fails to load"
|
|
251
|
+
// (yellow — actionable toolchain error, run install-optional.bat to surface
|
|
252
|
+
// the underlying cause with --foreground-scripts).
|
|
253
|
+
function checkSherpaBinary() {
|
|
254
|
+
try {
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
256
|
+
require('sherpa-onnx-node');
|
|
257
|
+
return {
|
|
258
|
+
label: 'sherpa-onnx-node binary',
|
|
259
|
+
status: 'green',
|
|
260
|
+
detail: 'loadable (used for offline STT when engine=sherpa or signed-out auto routing)',
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
catch (err) {
|
|
264
|
+
const msg = err.message || String(err);
|
|
265
|
+
const isMissing = /cannot find module/i.test(msg);
|
|
266
|
+
return {
|
|
267
|
+
label: 'sherpa-onnx-node binary',
|
|
268
|
+
status: 'yellow',
|
|
269
|
+
detail: isMissing
|
|
270
|
+
? 'not installed (optional dep — prebuild may have silently no-opped)'
|
|
271
|
+
: msg.split('\n')[0].slice(0, 120),
|
|
272
|
+
hint: isMissing
|
|
273
|
+
? 'Optional — sherpa is only used when engine="sherpa" or when signed out with auto routing. To install: run `install-optional.bat` on Windows or `npm install sherpa-onnx-node --include=optional --foreground-scripts` elsewhere — the `--foreground-scripts` flag surfaces the prebuild error npm would otherwise swallow. See docs/winrt-spike-notes.md for the optional-dep failure-mode context.'
|
|
274
|
+
: 'Binary installed but failed to dlopen. Usually missing libonnxruntime.so / vc_redist, or arch mismatch. Run `install-optional.bat` (Windows) for a diagnostic reinstall; paste the output if it fails.',
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
// Phase 5.5 — progressive disclosure tip. Shows the current tool-list
|
|
279
|
+
// token cost and the CLI command to flip the setting. Appears whether or
|
|
280
|
+
// not progressive disclosure is on — when it's on, the hint confirms the
|
|
281
|
+
// reduction; when off, it suggests the opt-in.
|
|
282
|
+
function checkMcpToolSurface() {
|
|
283
|
+
try {
|
|
284
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
285
|
+
const pathMod = require('path');
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
287
|
+
const fsMod = require('fs');
|
|
288
|
+
// Snapshot lives in the mcp-server package — follow the compiled path
|
|
289
|
+
// resolution from doctor's build output. __dirname at runtime is
|
|
290
|
+
// dist/headless/headless/; snapshot is at mcp-server/test/. Fall back
|
|
291
|
+
// gracefully when the file isn't found.
|
|
292
|
+
const snapshotCandidate = pathMod.join(__dirname, '..', '..', '..', 'mcp-server', 'test', 'v1-baseline.snap.json');
|
|
293
|
+
let toolCount = 0;
|
|
294
|
+
if (fsMod.existsSync(snapshotCandidate)) {
|
|
295
|
+
const raw = fsMod.readFileSync(snapshotCandidate, 'utf-8');
|
|
296
|
+
const parsed = JSON.parse(raw);
|
|
297
|
+
toolCount = parsed.toolCount || 0;
|
|
298
|
+
}
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
300
|
+
const { getSetting } = require('../electron/core/json-store');
|
|
301
|
+
const progressiveOn = getSetting('progressiveDisclosure.enabled') === true;
|
|
302
|
+
const coreCount = 11;
|
|
303
|
+
const avgBytesPerTool = 705; // measured on current snapshot
|
|
304
|
+
const charsPerToken = 3.5;
|
|
305
|
+
const fullTokens = Math.round((toolCount * avgBytesPerTool) / charsPerToken);
|
|
306
|
+
const coreTokens = Math.round((coreCount * avgBytesPerTool) / charsPerToken);
|
|
307
|
+
if (progressiveOn) {
|
|
308
|
+
return {
|
|
309
|
+
label: 'MCP tool surface',
|
|
310
|
+
status: 'green',
|
|
311
|
+
detail: `${coreCount} core tools advertised (~${coreTokens.toLocaleString()} tokens per list); ${toolCount - coreCount} tools hidden but callable`,
|
|
312
|
+
hint: 'Progressive disclosure is ON. `superbased_tools(category)` lists hidden tools. Disable via `superbased config set progressiveDisclosure.enabled false`.',
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
label: 'MCP tool surface',
|
|
317
|
+
status: 'yellow',
|
|
318
|
+
detail: `${toolCount} tools (~${fullTokens.toLocaleString()} tokens per list)`,
|
|
319
|
+
hint: `\`superbased config set progressiveDisclosure.enabled true\` advertises only ${coreCount} core tools (~${coreTokens.toLocaleString()} tokens). The remaining ${toolCount - coreCount} tools stay callable — agents discover them via \`superbased_tools(category)\`. Some editor-plugin slash commands may need manual invocation if the client strictly enforces the advertised list.`,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
catch (err) {
|
|
323
|
+
return {
|
|
324
|
+
label: 'MCP tool surface',
|
|
325
|
+
status: 'yellow',
|
|
326
|
+
detail: 'unable to measure tool surface',
|
|
327
|
+
hint: err instanceof Error ? err.message : String(err),
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function checkWindowsSttInterim() {
|
|
332
|
+
// Phase 8.2a — probe @superbased/winrt-speech directly. Mirrors the
|
|
333
|
+
// macOS check shape. Three states:
|
|
334
|
+
// 1. Binding not loaded (package absent or failed to load) → yellow
|
|
335
|
+
// with install hint. Sherpa remains the offline fallback.
|
|
336
|
+
// 2. Binding loaded, isSupported() returned false (no speech pack
|
|
337
|
+
// installed for default locale) → yellow with Settings deep-link.
|
|
338
|
+
// 3. Binding loaded + isSupported() true → green. Note: permission
|
|
339
|
+
// state is checked at transcribe time (WinRT compile with status
|
|
340
|
+
// Unauthorized = "Online speech recognition" toggle is off), not
|
|
341
|
+
// here — probing it is a ~100ms WinRT call and would slow doctor.
|
|
342
|
+
if (process.platform !== 'win32')
|
|
343
|
+
return null;
|
|
344
|
+
try {
|
|
345
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
346
|
+
const mod = require('@superbased/winrt-speech');
|
|
347
|
+
if (!mod.isSupported()) {
|
|
348
|
+
return {
|
|
349
|
+
label: 'Windows native STT',
|
|
350
|
+
status: 'yellow',
|
|
351
|
+
detail: 'no speech pack for default locale',
|
|
352
|
+
hint: 'Open Settings → Time & Language → Speech → Add a language to install the speech data pack. Sherpa remains available as the offline fallback.',
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
return {
|
|
356
|
+
label: 'Windows native STT',
|
|
357
|
+
status: 'green',
|
|
358
|
+
detail: 'WinRT SpeechRecognizer ready',
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
catch (err) {
|
|
362
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
363
|
+
const missing = /cannot find module/i.test(msg);
|
|
364
|
+
return {
|
|
365
|
+
label: 'Windows native STT',
|
|
366
|
+
status: 'yellow',
|
|
367
|
+
detail: missing
|
|
368
|
+
? '@superbased/winrt-speech not installed'
|
|
369
|
+
: '@superbased/winrt-speech failed to load',
|
|
370
|
+
hint: missing
|
|
371
|
+
? 'Reinstall with `npm install -g superbased --include=optional`. Sherpa is the current offline engine; signed-in users unchanged.'
|
|
372
|
+
: `Load error: ${msg}. Rebuild with \`npm --prefix %APPDATA%\\npm\\node_modules\\superbased\\node_modules\\@superbased\\winrt-speech run build\`.`,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
// Phase 8.1a — Windows UIA binding row. Mirror of the macOS AX check:
|
|
377
|
+
// visible-on-presence, silent when the package isn't installed, green
|
|
378
|
+
// when CUIAutomation COM server is available, yellow when the binding
|
|
379
|
+
// exists but UIA can't spin up (unusual on Windows 10 1903+).
|
|
380
|
+
function checkWindowsAccessibility() {
|
|
381
|
+
if (process.platform !== 'win32')
|
|
382
|
+
return null;
|
|
383
|
+
try {
|
|
384
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
385
|
+
const mod = require('@superbased/win-uia');
|
|
386
|
+
if (mod.isSupported()) {
|
|
387
|
+
return {
|
|
388
|
+
label: 'Windows UIA',
|
|
389
|
+
status: 'green',
|
|
390
|
+
detail: 'IUIAutomation binding ready',
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
label: 'Windows UIA',
|
|
395
|
+
status: 'yellow',
|
|
396
|
+
detail: 'CUIAutomation COM server unavailable',
|
|
397
|
+
hint: 'Unusual on Windows 10 1903+. Try a reboot; otherwise file an issue with `superbased doctor --bundle` output.',
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
catch (err) {
|
|
401
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
402
|
+
if (/cannot find module/i.test(msg))
|
|
403
|
+
return null; // silence-on-absence
|
|
404
|
+
return {
|
|
405
|
+
label: 'Windows UIA',
|
|
406
|
+
status: 'yellow',
|
|
407
|
+
detail: '@superbased/win-uia failed to load',
|
|
408
|
+
hint: `Load error: ${msg}. Rebuild with \`npm --prefix %APPDATA%\\npm\\node_modules\\superbased\\node_modules\\@superbased\\win-uia run build\`.`,
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// Phase 8.1b — macOS accessibility binding row. Visible-on-presence:
|
|
413
|
+
// only surfaces when the binding is installable (darwin + package
|
|
414
|
+
// present or load-failed). On absent-binding darwin, stays silent
|
|
415
|
+
// since accessibility is opt-in territory (most users don't need it).
|
|
416
|
+
function checkMacosAccessibility() {
|
|
417
|
+
if (process.platform !== 'darwin')
|
|
418
|
+
return null;
|
|
419
|
+
try {
|
|
420
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
421
|
+
const mod = require('@superbased/macos-ax');
|
|
422
|
+
const trusted = mod.isTrusted();
|
|
423
|
+
if (trusted) {
|
|
424
|
+
return {
|
|
425
|
+
label: 'macOS accessibility',
|
|
426
|
+
status: 'green',
|
|
427
|
+
detail: 'AXUIElement binding ready',
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
return {
|
|
431
|
+
label: 'macOS accessibility',
|
|
432
|
+
status: 'yellow',
|
|
433
|
+
detail: 'permission not granted',
|
|
434
|
+
hint: 'Open System Settings → Privacy & Security → Accessibility and enable SuperBased. Until granted, superbased_accessibility_tree returns a structured error (agents fall back to OCR via superbased_locate).',
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
catch (err) {
|
|
438
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
439
|
+
if (/cannot find module/i.test(msg))
|
|
440
|
+
return null; // silence-on-absence
|
|
441
|
+
return {
|
|
442
|
+
label: 'macOS accessibility',
|
|
443
|
+
status: 'yellow',
|
|
444
|
+
detail: '@superbased/macos-ax failed to load',
|
|
445
|
+
hint: `Load error: ${msg}. Rebuild with \`npm --prefix $(npm root -g)/superbased/node_modules/@superbased/macos-ax run build\`.`,
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
// Phase 6.1 — Ollama detection row. Hidden entirely when Ollama is not
|
|
450
|
+
// detected, mirroring M1's "silence on absence" log policy: users who don't
|
|
451
|
+
// run Ollama shouldn't see a check row telling them we looked. Also hidden
|
|
452
|
+
// when `ollama.detection.enabled=false` (user opted out of detection).
|
|
453
|
+
async function checkOllama() {
|
|
454
|
+
try {
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
456
|
+
const { getSetting } = require('../electron/core/json-store');
|
|
457
|
+
const detectionEnabled = getSetting('ollama.detection.enabled');
|
|
458
|
+
if (detectionEnabled === false)
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
catch { /* settings unavailable — fall through to the live probe */ }
|
|
462
|
+
// Prefer the api-server's cached view so we don't duplicate the 500ms hit.
|
|
463
|
+
// If serve isn't running, fall through to silence — "no signal, no row".
|
|
464
|
+
const controller = new AbortController();
|
|
465
|
+
const timer = setTimeout(() => controller.abort(), 800);
|
|
466
|
+
try {
|
|
467
|
+
const res = await fetch('http://127.0.0.1:47592/api/ollama/status', { signal: controller.signal });
|
|
468
|
+
if (!res.ok)
|
|
469
|
+
return null;
|
|
470
|
+
const status = await res.json();
|
|
471
|
+
if (!status.detected)
|
|
472
|
+
return null;
|
|
473
|
+
const modelCount = Array.isArray(status.models) ? status.models.length : 0;
|
|
474
|
+
const sample = Array.isArray(status.models)
|
|
475
|
+
? status.models.slice(0, 3).map((m) => m.name).join(', ')
|
|
476
|
+
: '';
|
|
477
|
+
const sampleSuffix = modelCount > 3 ? `, +${modelCount - 3} more` : '';
|
|
478
|
+
const versionTag = status.version ? ` v${status.version}` : '';
|
|
479
|
+
return {
|
|
480
|
+
label: 'Ollama',
|
|
481
|
+
status: 'green',
|
|
482
|
+
detail: `detected at ${status.host}${versionTag} — ${modelCount} model(s)${sample ? ` (${sample}${sampleSuffix})` : ''}`,
|
|
483
|
+
hint: 'Routing is not yet wired. Phase 6.2 adds settings toggles + per-task overrides; Phase 6.3 adds `provider="ollama"` on superbased_ai / superbased_describe_frames / superbased_narrate.',
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
catch {
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
finally {
|
|
490
|
+
clearTimeout(timer);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
function checkMacosSttInterim() {
|
|
494
|
+
// Phase 8.2b — probe @superbased/macos-speech directly. Three states:
|
|
495
|
+
// 1. Binding not loaded (package absent or failed to load) → yellow
|
|
496
|
+
// with install hint. Sherpa is still the offline fallback.
|
|
497
|
+
// 2. Binding loaded, permission not granted → yellow with the
|
|
498
|
+
// specific remediation path (grant / re-grant / restricted).
|
|
499
|
+
// 3. Binding loaded + permission granted → green, on-device STT ready.
|
|
500
|
+
if (process.platform !== 'darwin')
|
|
501
|
+
return null;
|
|
502
|
+
try {
|
|
503
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
504
|
+
const mod = require('@superbased/macos-speech');
|
|
505
|
+
const status = mod.authorizationStatus();
|
|
506
|
+
if (status === 'authorized') {
|
|
507
|
+
return {
|
|
508
|
+
label: 'macOS native STT',
|
|
509
|
+
status: 'green',
|
|
510
|
+
detail: 'SFSpeechRecognizer ready (on-device)',
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
const remediation = status === 'denied'
|
|
514
|
+
? 'Re-grant Speech Recognition in System Settings → Privacy & Security → Speech Recognition.'
|
|
515
|
+
: status === 'restricted'
|
|
516
|
+
? 'Device is restricted (managed profile / parental controls); no remediation path from within the app.'
|
|
517
|
+
: 'Run the first-run consent prompt or call native macOS engine once to trigger the system dialog.';
|
|
518
|
+
return {
|
|
519
|
+
label: 'macOS native STT',
|
|
520
|
+
status: 'yellow',
|
|
521
|
+
detail: `SFSpeechRecognizer permission: ${status}`,
|
|
522
|
+
hint: `${remediation} Sherpa remains available as the offline fallback; cloud is unchanged for signed-in users.`,
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
catch (err) {
|
|
526
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
527
|
+
const missing = /cannot find module/i.test(msg);
|
|
528
|
+
return {
|
|
529
|
+
label: 'macOS native STT',
|
|
530
|
+
status: 'yellow',
|
|
531
|
+
detail: missing
|
|
532
|
+
? '@superbased/macos-speech not installed'
|
|
533
|
+
: '@superbased/macos-speech failed to load',
|
|
534
|
+
hint: missing
|
|
535
|
+
? 'Reinstall with `npm install -g superbased --include=optional`. Sherpa is the current offline engine; signed-in users unchanged.'
|
|
536
|
+
: `Load error: ${msg}. Rebuild with \`npm --prefix $(npm root -g)/superbased/node_modules/@superbased/macos-speech run build\`.`,
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
// ── Public API ──
|
|
541
|
+
async function runDoctor(opts = {}) {
|
|
542
|
+
const ollamaCheck = await checkOllama();
|
|
543
|
+
const checks = [
|
|
544
|
+
checkVersion(),
|
|
545
|
+
checkNode(),
|
|
546
|
+
checkPlatform(),
|
|
547
|
+
checkDataDir(),
|
|
548
|
+
checkPortOwner(),
|
|
549
|
+
checkAuth(),
|
|
550
|
+
checkFfmpeg(),
|
|
551
|
+
checkNativeModule('sharp'),
|
|
552
|
+
checkNativeModule('better-sqlite3'),
|
|
553
|
+
checkNativeModule('uiohook-napi'),
|
|
554
|
+
checkNativeModule('active-win'),
|
|
555
|
+
checkSherpaBinary(),
|
|
556
|
+
ollamaCheck,
|
|
557
|
+
checkOsHints(),
|
|
558
|
+
checkMcpToolSurface(),
|
|
559
|
+
checkWindowsSttInterim(),
|
|
560
|
+
checkMacosSttInterim(),
|
|
561
|
+
checkMacosAccessibility(),
|
|
562
|
+
checkWindowsAccessibility(),
|
|
563
|
+
].filter((c) => c !== null);
|
|
564
|
+
const counts = { green: 0, yellow: 0, red: 0 };
|
|
565
|
+
for (const c of checks)
|
|
566
|
+
counts[c.status]++;
|
|
567
|
+
if (opts.bundle) {
|
|
568
|
+
// Plain-text bundle for bug reports — no ANSI colors, no secrets.
|
|
569
|
+
const lines = [];
|
|
570
|
+
lines.push(`# SuperBased Doctor — diagnostic bundle`);
|
|
571
|
+
lines.push(`Generated: ${new Date().toISOString()}`);
|
|
572
|
+
lines.push(`Hostname: ${os.hostname().replace(/[a-zA-Z0-9]/g, '*')} (redacted)`);
|
|
573
|
+
lines.push(`Platform: ${process.platform}/${process.arch}`);
|
|
574
|
+
lines.push(`Node: ${process.version}`);
|
|
575
|
+
lines.push(`Counts: ${counts.green} ok, ${counts.yellow} warn, ${counts.red} fail`);
|
|
576
|
+
lines.push('');
|
|
577
|
+
for (const c of checks) {
|
|
578
|
+
lines.push(`[${STATUS_PLAIN[c.status]}] ${c.label}: ${c.detail}`);
|
|
579
|
+
if (c.hint)
|
|
580
|
+
lines.push(` hint: ${c.hint}`);
|
|
581
|
+
}
|
|
582
|
+
process.stdout.write(lines.join('\n') + '\n');
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
process.stdout.write(`SuperBased Doctor — v${(0, config_1.getVersion)()}\n\n`);
|
|
586
|
+
for (const c of checks) {
|
|
587
|
+
process.stdout.write(` ${DOT[c.status]} ${c.label.padEnd(28)} ${c.detail}\n`);
|
|
588
|
+
if (c.hint)
|
|
589
|
+
process.stdout.write(` \u001b[2m${c.hint}\u001b[0m\n`);
|
|
590
|
+
}
|
|
591
|
+
process.stdout.write(`\nSummary: ${counts.green} ok, ${counts.yellow} warn, ${counts.red} fail`);
|
|
592
|
+
if (counts.red > 0) {
|
|
593
|
+
process.stdout.write(`\n\nRun \`superbased doctor --bundle\` and paste into a bug report.\n`);
|
|
594
|
+
process.exitCode = 1;
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
process.stdout.write('\n');
|
|
598
|
+
}
|
|
599
|
+
}
|