@mseep/clawdcursor 1.5.5
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/CHANGELOG.md +2264 -0
- package/LICENSE +21 -0
- package/README.md +385 -0
- package/SECURITY.md +44 -0
- package/SKILL.md +503 -0
- package/dist/core/agent-loop/agent.d.ts +42 -0
- package/dist/core/agent-loop/agent.js +1023 -0
- package/dist/core/agent-loop/agent.js.map +1 -0
- package/dist/core/agent-loop/batch-tool.d.ts +25 -0
- package/dist/core/agent-loop/batch-tool.js +218 -0
- package/dist/core/agent-loop/batch-tool.js.map +1 -0
- package/dist/core/agent-loop/coord-scale.d.ts +72 -0
- package/dist/core/agent-loop/coord-scale.js +89 -0
- package/dist/core/agent-loop/coord-scale.js.map +1 -0
- package/dist/core/agent-loop/focus-guard.d.ts +24 -0
- package/dist/core/agent-loop/focus-guard.js +29 -0
- package/dist/core/agent-loop/focus-guard.js.map +1 -0
- package/dist/core/agent-loop/project-mcp.d.ts +97 -0
- package/dist/core/agent-loop/project-mcp.js +253 -0
- package/dist/core/agent-loop/project-mcp.js.map +1 -0
- package/dist/core/agent-loop/prompt.d.ts +45 -0
- package/dist/core/agent-loop/prompt.js +426 -0
- package/dist/core/agent-loop/prompt.js.map +1 -0
- package/dist/core/agent-loop/tool-meta.d.ts +93 -0
- package/dist/core/agent-loop/tool-meta.js +651 -0
- package/dist/core/agent-loop/tool-meta.js.map +1 -0
- package/dist/core/agent-loop/tools.d.ts +38 -0
- package/dist/core/agent-loop/tools.js +2134 -0
- package/dist/core/agent-loop/tools.js.map +1 -0
- package/dist/core/agent-loop/types.d.ts +170 -0
- package/dist/core/agent-loop/types.js +12 -0
- package/dist/core/agent-loop/types.js.map +1 -0
- package/dist/core/agent.d.ts +51 -0
- package/dist/core/agent.js +245 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/app-categories.d.ts +67 -0
- package/dist/core/app-categories.js +108 -0
- package/dist/core/app-categories.js.map +1 -0
- package/dist/core/banner.d.ts +70 -0
- package/dist/core/banner.js +245 -0
- package/dist/core/banner.js.map +1 -0
- package/dist/core/classify/capability.d.ts +45 -0
- package/dist/core/classify/capability.js +78 -0
- package/dist/core/classify/capability.js.map +1 -0
- package/dist/core/decompose/llm-decomposer.d.ts +35 -0
- package/dist/core/decompose/llm-decomposer.js +156 -0
- package/dist/core/decompose/llm-decomposer.js.map +1 -0
- package/dist/core/decompose/parser.d.ts +27 -0
- package/dist/core/decompose/parser.js +101 -0
- package/dist/core/decompose/parser.js.map +1 -0
- package/dist/core/observability/correlation.d.ts +19 -0
- package/dist/core/observability/correlation.js +36 -0
- package/dist/core/observability/correlation.js.map +1 -0
- package/dist/core/observability/cost-meter.d.ts +51 -0
- package/dist/core/observability/cost-meter.js +134 -0
- package/dist/core/observability/cost-meter.js.map +1 -0
- package/dist/core/observability/logger.d.ts +61 -0
- package/dist/core/observability/logger.js +550 -0
- package/dist/core/observability/logger.js.map +1 -0
- package/dist/core/router/aliases.d.ts +50 -0
- package/dist/core/router/aliases.js +104 -0
- package/dist/core/router/aliases.js.map +1 -0
- package/dist/core/router/normalize.d.ts +41 -0
- package/dist/core/router/normalize.js +80 -0
- package/dist/core/router/normalize.js.map +1 -0
- package/dist/core/safety.d.ts +126 -0
- package/dist/core/safety.js +568 -0
- package/dist/core/safety.js.map +1 -0
- package/dist/core/sense/a11y-resolver.d.ts +73 -0
- package/dist/core/sense/a11y-resolver.js +76 -0
- package/dist/core/sense/a11y-resolver.js.map +1 -0
- package/dist/core/sense/fingerprint.d.ts +41 -0
- package/dist/core/sense/fingerprint.js +123 -0
- package/dist/core/sense/fingerprint.js.map +1 -0
- package/dist/core/sense/rank.d.ts +70 -0
- package/dist/core/sense/rank.js +192 -0
- package/dist/core/sense/rank.js.map +1 -0
- package/dist/core/sense/reactive-check.d.ts +40 -0
- package/dist/core/sense/reactive-check.js +48 -0
- package/dist/core/sense/reactive-check.js.map +1 -0
- package/dist/core/sense/snapshot.d.ts +19 -0
- package/dist/core/sense/snapshot.js +100 -0
- package/dist/core/sense/snapshot.js.map +1 -0
- package/dist/core/sense/types.d.ts +66 -0
- package/dist/core/sense/types.js +9 -0
- package/dist/core/sense/types.js.map +1 -0
- package/dist/core/sense/ui-map-anchors.d.ts +7 -0
- package/dist/core/sense/ui-map-anchors.js +24 -0
- package/dist/core/sense/ui-map-anchors.js.map +1 -0
- package/dist/core/sense/ui-map-elements.d.ts +5 -0
- package/dist/core/sense/ui-map-elements.js +33 -0
- package/dist/core/sense/ui-map-elements.js.map +1 -0
- package/dist/core/sense/ui-map-find.d.ts +56 -0
- package/dist/core/sense/ui-map-find.js +153 -0
- package/dist/core/sense/ui-map-find.js.map +1 -0
- package/dist/core/sense/ui-map-fuse.d.ts +4 -0
- package/dist/core/sense/ui-map-fuse.js +44 -0
- package/dist/core/sense/ui-map-fuse.js.map +1 -0
- package/dist/core/sense/ui-map-geom.d.ts +3 -0
- package/dist/core/sense/ui-map-geom.js +16 -0
- package/dist/core/sense/ui-map-geom.js.map +1 -0
- package/dist/core/sense/ui-map-holder.d.ts +58 -0
- package/dist/core/sense/ui-map-holder.js +87 -0
- package/dist/core/sense/ui-map-holder.js.map +1 -0
- package/dist/core/sense/ui-map-normalize.d.ts +19 -0
- package/dist/core/sense/ui-map-normalize.js +65 -0
- package/dist/core/sense/ui-map-normalize.js.map +1 -0
- package/dist/core/sense/ui-map-render.d.ts +4 -0
- package/dist/core/sense/ui-map-render.js +34 -0
- package/dist/core/sense/ui-map-render.js.map +1 -0
- package/dist/core/sense/ui-map-resolve.d.ts +41 -0
- package/dist/core/sense/ui-map-resolve.js +59 -0
- package/dist/core/sense/ui-map-resolve.js.map +1 -0
- package/dist/core/sense/ui-map-types.d.ts +66 -0
- package/dist/core/sense/ui-map-types.js +11 -0
- package/dist/core/sense/ui-map-types.js.map +1 -0
- package/dist/core/sense/ui-map.d.ts +29 -0
- package/dist/core/sense/ui-map.js +113 -0
- package/dist/core/sense/ui-map.js.map +1 -0
- package/dist/core/verify/assertions.d.ts +132 -0
- package/dist/core/verify/assertions.js +284 -0
- package/dist/core/verify/assertions.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/browser-config.d.ts +36 -0
- package/dist/llm/browser-config.js +83 -0
- package/dist/llm/browser-config.js.map +1 -0
- package/dist/llm/client.d.ts +268 -0
- package/dist/llm/client.js +1094 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/llm/config.d.ts +79 -0
- package/dist/llm/config.js +375 -0
- package/dist/llm/config.js.map +1 -0
- package/dist/llm/credentials.d.ts +35 -0
- package/dist/llm/credentials.js +491 -0
- package/dist/llm/credentials.js.map +1 -0
- package/dist/llm/external-creds.d.ts +42 -0
- package/dist/llm/external-creds.js +169 -0
- package/dist/llm/external-creds.js.map +1 -0
- package/dist/llm/providers.d.ts +123 -0
- package/dist/llm/providers.js +717 -0
- package/dist/llm/providers.js.map +1 -0
- package/dist/paths.d.ts +31 -0
- package/dist/paths.js +147 -0
- package/dist/paths.js.map +1 -0
- package/dist/platform/accessibility.d.ts +139 -0
- package/dist/platform/accessibility.js +670 -0
- package/dist/platform/accessibility.js.map +1 -0
- package/dist/platform/cdp-driver.d.ts +318 -0
- package/dist/platform/cdp-driver.js +1179 -0
- package/dist/platform/cdp-driver.js.map +1 -0
- package/dist/platform/index.d.ts +11 -0
- package/dist/platform/index.js +69 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/keys.d.ts +17 -0
- package/dist/platform/keys.js +129 -0
- package/dist/platform/keys.js.map +1 -0
- package/dist/platform/launch-poll.d.ts +101 -0
- package/dist/platform/launch-poll.js +177 -0
- package/dist/platform/launch-poll.js.map +1 -0
- package/dist/platform/linux.d.ts +173 -0
- package/dist/platform/linux.js +1253 -0
- package/dist/platform/linux.js.map +1 -0
- package/dist/platform/macos.d.ts +136 -0
- package/dist/platform/macos.js +976 -0
- package/dist/platform/macos.js.map +1 -0
- package/dist/platform/native-desktop.d.ts +145 -0
- package/dist/platform/native-desktop.js +936 -0
- package/dist/platform/native-desktop.js.map +1 -0
- package/dist/platform/native-helper.d.ts +130 -0
- package/dist/platform/native-helper.js +592 -0
- package/dist/platform/native-helper.js.map +1 -0
- package/dist/platform/ocr-engine.d.ts +78 -0
- package/dist/platform/ocr-engine.js +363 -0
- package/dist/platform/ocr-engine.js.map +1 -0
- package/dist/platform/ps-runner.d.ts +28 -0
- package/dist/platform/ps-runner.js +228 -0
- package/dist/platform/ps-runner.js.map +1 -0
- package/dist/platform/types.d.ts +397 -0
- package/dist/platform/types.js +15 -0
- package/dist/platform/types.js.map +1 -0
- package/dist/platform/uri-handler.d.ts +75 -0
- package/dist/platform/uri-handler.js +273 -0
- package/dist/platform/uri-handler.js.map +1 -0
- package/dist/platform/wayland-backend.d.ts +53 -0
- package/dist/platform/wayland-backend.js +348 -0
- package/dist/platform/wayland-backend.js.map +1 -0
- package/dist/platform/windows.d.ts +232 -0
- package/dist/platform/windows.js +1210 -0
- package/dist/platform/windows.js.map +1 -0
- package/dist/postbuild.d.ts +10 -0
- package/dist/postbuild.js +98 -0
- package/dist/postbuild.js.map +1 -0
- package/dist/schema/snapshot.d.ts +33 -0
- package/dist/schema/snapshot.js +90 -0
- package/dist/schema/snapshot.js.map +1 -0
- package/dist/shortcuts.d.ts +30 -0
- package/dist/shortcuts.js +261 -0
- package/dist/shortcuts.js.map +1 -0
- package/dist/surface/cli.d.ts +7 -0
- package/dist/surface/cli.js +1556 -0
- package/dist/surface/cli.js.map +1 -0
- package/dist/surface/dashboard.d.ts +8 -0
- package/dist/surface/dashboard.js +1193 -0
- package/dist/surface/dashboard.js.map +1 -0
- package/dist/surface/doctor.d.ts +29 -0
- package/dist/surface/doctor.js +1514 -0
- package/dist/surface/doctor.js.map +1 -0
- package/dist/surface/format.d.ts +10 -0
- package/dist/surface/format.js +37 -0
- package/dist/surface/format.js.map +1 -0
- package/dist/surface/http-utility.d.ts +65 -0
- package/dist/surface/http-utility.js +336 -0
- package/dist/surface/http-utility.js.map +1 -0
- package/dist/surface/mcp-server.d.ts +91 -0
- package/dist/surface/mcp-server.js +280 -0
- package/dist/surface/mcp-server.js.map +1 -0
- package/dist/surface/onboarding.d.ts +15 -0
- package/dist/surface/onboarding.js +184 -0
- package/dist/surface/onboarding.js.map +1 -0
- package/dist/surface/pidfile.d.ts +79 -0
- package/dist/surface/pidfile.js +263 -0
- package/dist/surface/pidfile.js.map +1 -0
- package/dist/surface/readiness.d.ts +45 -0
- package/dist/surface/readiness.js +230 -0
- package/dist/surface/readiness.js.map +1 -0
- package/dist/surface/report.d.ts +68 -0
- package/dist/surface/report.js +341 -0
- package/dist/surface/report.js.map +1 -0
- package/dist/surface/skill-register.d.ts +14 -0
- package/dist/surface/skill-register.js +150 -0
- package/dist/surface/skill-register.js.map +1 -0
- package/dist/surface/version.d.ts +6 -0
- package/dist/surface/version.js +27 -0
- package/dist/surface/version.js.map +1 -0
- package/dist/tools/a11y.d.ts +8 -0
- package/dist/tools/a11y.js +545 -0
- package/dist/tools/a11y.js.map +1 -0
- package/dist/tools/a11y_depth.d.ts +19 -0
- package/dist/tools/a11y_depth.js +455 -0
- package/dist/tools/a11y_depth.js.map +1 -0
- package/dist/tools/agent.d.ts +15 -0
- package/dist/tools/agent.js +248 -0
- package/dist/tools/agent.js.map +1 -0
- package/dist/tools/batch.d.ts +46 -0
- package/dist/tools/batch.js +230 -0
- package/dist/tools/batch.js.map +1 -0
- package/dist/tools/cdp.d.ts +8 -0
- package/dist/tools/cdp.js +233 -0
- package/dist/tools/cdp.js.map +1 -0
- package/dist/tools/compact.d.ts +63 -0
- package/dist/tools/compact.js +418 -0
- package/dist/tools/compact.js.map +1 -0
- package/dist/tools/cost-class.d.ts +38 -0
- package/dist/tools/cost-class.js +117 -0
- package/dist/tools/cost-class.js.map +1 -0
- package/dist/tools/desktop.d.ts +9 -0
- package/dist/tools/desktop.js +346 -0
- package/dist/tools/desktop.js.map +1 -0
- package/dist/tools/electron_bridge.d.ts +41 -0
- package/dist/tools/electron_bridge.js +261 -0
- package/dist/tools/electron_bridge.js.map +1 -0
- package/dist/tools/extras.d.ts +22 -0
- package/dist/tools/extras.js +942 -0
- package/dist/tools/extras.js.map +1 -0
- package/dist/tools/favorites.d.ts +13 -0
- package/dist/tools/favorites.js +137 -0
- package/dist/tools/favorites.js.map +1 -0
- package/dist/tools/introspection.d.ts +13 -0
- package/dist/tools/introspection.js +55 -0
- package/dist/tools/introspection.js.map +1 -0
- package/dist/tools/ocr.d.ts +8 -0
- package/dist/tools/ocr.js +66 -0
- package/dist/tools/ocr.js.map +1 -0
- package/dist/tools/orchestration.d.ts +7 -0
- package/dist/tools/orchestration.js +377 -0
- package/dist/tools/orchestration.js.map +1 -0
- package/dist/tools/playbooks/extract-compose.d.ts +22 -0
- package/dist/tools/playbooks/extract-compose.js +85 -0
- package/dist/tools/playbooks/extract-compose.js.map +1 -0
- package/dist/tools/playbooks/find-replace.d.ts +11 -0
- package/dist/tools/playbooks/find-replace.js +56 -0
- package/dist/tools/playbooks/find-replace.js.map +1 -0
- package/dist/tools/playbooks/index.d.ts +63 -0
- package/dist/tools/playbooks/index.js +70 -0
- package/dist/tools/playbooks/index.js.map +1 -0
- package/dist/tools/playbooks/keys-blocklist.d.ts +24 -0
- package/dist/tools/playbooks/keys-blocklist.js +89 -0
- package/dist/tools/playbooks/keys-blocklist.js.map +1 -0
- package/dist/tools/registry.d.ts +40 -0
- package/dist/tools/registry.js +560 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/safety-gate.d.ts +16 -0
- package/dist/tools/safety-gate.js +70 -0
- package/dist/tools/safety-gate.js.map +1 -0
- package/dist/tools/scheduler.d.ts +76 -0
- package/dist/tools/scheduler.js +413 -0
- package/dist/tools/scheduler.js.map +1 -0
- package/dist/tools/shortcuts.d.ts +13 -0
- package/dist/tools/shortcuts.js +205 -0
- package/dist/tools/shortcuts.js.map +1 -0
- package/dist/tools/smart.d.ts +15 -0
- package/dist/tools/smart.js +785 -0
- package/dist/tools/smart.js.map +1 -0
- package/dist/tools/types.d.ts +174 -0
- package/dist/tools/types.js +67 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/window-text.d.ts +15 -0
- package/dist/tools/window-text.js +39 -0
- package/dist/tools/window-text.js.map +1 -0
- package/dist/types.d.ts +122 -0
- package/dist/types.js +41 -0
- package/dist/types.js.map +1 -0
- package/native/Package.swift +38 -0
- package/native/README.md +113 -0
- package/native/Sources/ClawdCursorHelper/main.swift +602 -0
- package/native/Sources/ClawdCursorHost/main.swift +182 -0
- package/native/Sources/PermissionCheck/main.swift +53 -0
- package/native/Sources/ScreenshotHelper/main.swift +219 -0
- package/native/build.sh +139 -0
- package/native/entitlements.plist +12 -0
- package/package.json +115 -0
- package/scripts/banner.ps1 +112 -0
- package/scripts/coord-accuracy.ps1 +140 -0
- package/scripts/coord-uwp.ps1 +80 -0
- package/scripts/edge-glow.ps1 +180 -0
- package/scripts/find-element.ps1 +198 -0
- package/scripts/get-foreground-window.ps1 +71 -0
- package/scripts/get-screen-context.ps1 +183 -0
- package/scripts/get-windows.ps1 +66 -0
- package/scripts/install-panic-hotkey.ps1 +46 -0
- package/scripts/interact-element.ps1 +431 -0
- package/scripts/invoke-element.ps1 +314 -0
- package/scripts/linux/atspi-bridge.py +356 -0
- package/scripts/linux/ocr-recognize.py +154 -0
- package/scripts/mac/_window-picker.jxa +163 -0
- package/scripts/mac/find-element.jxa +0 -0
- package/scripts/mac/find-element.sh +161 -0
- package/scripts/mac/focus-window.jxa +284 -0
- package/scripts/mac/get-focused-element.jxa +102 -0
- package/scripts/mac/get-foreground-window.jxa +173 -0
- package/scripts/mac/get-screen-context.jxa +197 -0
- package/scripts/mac/get-ui-tree.sh +141 -0
- package/scripts/mac/get-windows.jxa +117 -0
- package/scripts/mac/interact-element.sh +235 -0
- package/scripts/mac/invoke-element.jxa +408 -0
- package/scripts/mac/ocr-recognize.swift +124 -0
- package/scripts/ocr-recognize.ps1 +102 -0
- package/scripts/postinstall-native.js +48 -0
- package/scripts/ps-bridge.ps1 +830 -0
- package/scripts/smoke-mcp.ps1 +119 -0
- package/scripts/sync-version.ts +178 -0
- package/scripts/verify-install.js +81 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* v0.8.2 — Electron / WebView2 / WKWebView detection + CDP bridging hints.
|
|
4
|
+
*
|
|
5
|
+
* Modern "native" apps on Windows and macOS are frequently Electron or
|
|
6
|
+
* WebView2 wrappers around Chromium. Their accessibility trees often
|
|
7
|
+
* contain only the window chrome — the entire document body is inside
|
|
8
|
+
* the web view and is NOT reachable via UIA or AX directly.
|
|
9
|
+
*
|
|
10
|
+
* Examples on Windows (WebView2 / Electron):
|
|
11
|
+
* - New Outlook (olk)
|
|
12
|
+
* - Microsoft Teams
|
|
13
|
+
* - Discord
|
|
14
|
+
* - Slack
|
|
15
|
+
* - VS Code
|
|
16
|
+
* - GitHub Desktop
|
|
17
|
+
* - Notion
|
|
18
|
+
*
|
|
19
|
+
* The clean fix is to bridge to their embedded Chromium via CDP. That
|
|
20
|
+
* requires the app to be launched with a remote-debugging port. We
|
|
21
|
+
* cannot attach to an already-running app that wasn't launched that
|
|
22
|
+
* way, but we CAN:
|
|
23
|
+
*
|
|
24
|
+
* 1. Detect which running processes are Electron/WebView2 shells by
|
|
25
|
+
* process-name heuristics + module snooping (on Windows).
|
|
26
|
+
* 2. Scan the common Electron remote-debug port range for already-
|
|
27
|
+
* enabled /json endpoints.
|
|
28
|
+
* 3. Tell the agent HOW to relaunch the app with debugging enabled
|
|
29
|
+
* so a bridge can attach.
|
|
30
|
+
*
|
|
31
|
+
* This file ships two tools:
|
|
32
|
+
* - `detect_webview_apps` — enumerate candidates + their CDP status
|
|
33
|
+
* - `attach_webview_cdp` — discover the debugger URL and connect
|
|
34
|
+
* the existing cdp_driver to it
|
|
35
|
+
*
|
|
36
|
+
* Linux TODO: the same heuristics apply (look for
|
|
37
|
+
* /proc/{pid}/cmdline containing `--type=renderer` or `.asar`), but
|
|
38
|
+
* AT-SPI already gives us a richer tree on Linux Electron apps than
|
|
39
|
+
* UIA does on Windows. Follow-up.
|
|
40
|
+
*/
|
|
41
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
42
|
+
if (k2 === undefined) k2 = k;
|
|
43
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
44
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
45
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
46
|
+
}
|
|
47
|
+
Object.defineProperty(o, k2, desc);
|
|
48
|
+
}) : (function(o, m, k, k2) {
|
|
49
|
+
if (k2 === undefined) k2 = k;
|
|
50
|
+
o[k2] = m[k];
|
|
51
|
+
}));
|
|
52
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
53
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
54
|
+
}) : function(o, v) {
|
|
55
|
+
o["default"] = v;
|
|
56
|
+
});
|
|
57
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
58
|
+
var ownKeys = function(o) {
|
|
59
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
60
|
+
var ar = [];
|
|
61
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
62
|
+
return ar;
|
|
63
|
+
};
|
|
64
|
+
return ownKeys(o);
|
|
65
|
+
};
|
|
66
|
+
return function (mod) {
|
|
67
|
+
if (mod && mod.__esModule) return mod;
|
|
68
|
+
var result = {};
|
|
69
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
70
|
+
__setModuleDefault(result, mod);
|
|
71
|
+
return result;
|
|
72
|
+
};
|
|
73
|
+
})();
|
|
74
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
+
exports.getElectronBridgeTools = getElectronBridgeTools;
|
|
76
|
+
const KNOWN_APPS = [
|
|
77
|
+
// Windows New Outlook — WebView2
|
|
78
|
+
{ processNames: ['olk'], titleSubstrings: ['- outlook'], displayName: 'New Outlook', kind: 'webview2' },
|
|
79
|
+
// Teams (v2 is WebView2, v1 was Electron)
|
|
80
|
+
{ processNames: ['ms-teams', 'teams'], titleSubstrings: ['microsoft teams'], displayName: 'Microsoft Teams', kind: 'webview2' },
|
|
81
|
+
// Discord — Electron
|
|
82
|
+
{ processNames: ['discord'], titleSubstrings: ['discord'], displayName: 'Discord', kind: 'electron', debugFlag: '--remote-debugging-port=9222' },
|
|
83
|
+
// Slack — Electron
|
|
84
|
+
{ processNames: ['slack'], titleSubstrings: ['slack'], displayName: 'Slack', kind: 'electron', debugFlag: '--remote-debugging-port=9222' },
|
|
85
|
+
// VS Code — Electron
|
|
86
|
+
{ processNames: ['code', 'code - insiders'], titleSubstrings: ['visual studio code'], displayName: 'VS Code', kind: 'electron', debugFlag: '--inspect=9222' },
|
|
87
|
+
// GitHub Desktop — Electron
|
|
88
|
+
{ processNames: ['github desktop', 'githubdesktop'], titleSubstrings: ['github desktop'], displayName: 'GitHub Desktop', kind: 'electron' },
|
|
89
|
+
// Notion — Electron
|
|
90
|
+
{ processNames: ['notion'], titleSubstrings: ['notion'], displayName: 'Notion', kind: 'electron' },
|
|
91
|
+
// Obsidian — Electron
|
|
92
|
+
{ processNames: ['obsidian'], titleSubstrings: ['obsidian'], displayName: 'Obsidian', kind: 'electron' },
|
|
93
|
+
// Spotify — Chromium shell
|
|
94
|
+
{ processNames: ['spotify'], titleSubstrings: ['spotify'], displayName: 'Spotify', kind: 'chromium-shell' },
|
|
95
|
+
];
|
|
96
|
+
/**
|
|
97
|
+
* Match a window to a known WebView app fingerprint. Returns null when
|
|
98
|
+
* the window is a plain native app.
|
|
99
|
+
*/
|
|
100
|
+
function matchFingerprint(processName, title) {
|
|
101
|
+
const pn = processName.toLowerCase();
|
|
102
|
+
const t = (title || '').toLowerCase();
|
|
103
|
+
for (const fp of KNOWN_APPS) {
|
|
104
|
+
const pnMatch = fp.processNames.some(n => pn.startsWith(n.toLowerCase()));
|
|
105
|
+
const titleMatch = fp.titleSubstrings.some(s => t.includes(s));
|
|
106
|
+
if (pnMatch || titleMatch)
|
|
107
|
+
return fp;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
/** Probe a single TCP port for a running /json Chrome DevTools endpoint. */
|
|
112
|
+
async function probeCdpPort(port) {
|
|
113
|
+
try {
|
|
114
|
+
const res = await fetch(`http://127.0.0.1:${port}/json/version`, {
|
|
115
|
+
signal: AbortSignal.timeout(500),
|
|
116
|
+
});
|
|
117
|
+
return res.ok;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Scan the common Electron remote-debug port range. */
|
|
124
|
+
async function findLiveCdpPort() {
|
|
125
|
+
// Electron defaults to 9222; developers sometimes pick 9223/9229. Chrome
|
|
126
|
+
// and Edge when launched with --remote-debugging-port also use 9222.
|
|
127
|
+
const candidates = [9222, 9223, 9229, 8315];
|
|
128
|
+
for (const p of candidates) {
|
|
129
|
+
if (await probeCdpPort(p))
|
|
130
|
+
return p;
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
function buildHint(fp, cdpPort, title) {
|
|
135
|
+
if (cdpPort !== null) {
|
|
136
|
+
return (`${fp.displayName} detected and CDP is already live on port ${cdpPort}. ` +
|
|
137
|
+
`Call \`browser({"action":"connect","port":${cdpPort}})\` (or \`cdp_connect\` in granular mode) to attach, then ` +
|
|
138
|
+
`\`browser({"action":"page_context"})\` to enumerate its DOM elements — far richer than the UIA tree.`);
|
|
139
|
+
}
|
|
140
|
+
const flag = fp.debugFlag ?? '--remote-debugging-port=9222';
|
|
141
|
+
return (`${fp.displayName} ("${title}") is a ${fp.kind} app whose accessibility tree is largely empty — ` +
|
|
142
|
+
`its UI is inside an embedded Chromium. To get a reliable DOM-level bridge, ask the user to relaunch it ` +
|
|
143
|
+
`with \`${flag}\` (e.g. \`${fp.processNames[0]} ${flag}\`). Then call ` +
|
|
144
|
+
`\`browser({"action":"connect"})\` to attach. ` +
|
|
145
|
+
`Until then, fall back to \`system({"action":"ocr"})\` + coord clicks, OR \`accessibility({"action":"invoke","name":"..."})\` against whatever names DO show up.`);
|
|
146
|
+
}
|
|
147
|
+
function getElectronBridgeTools() {
|
|
148
|
+
return [
|
|
149
|
+
{
|
|
150
|
+
name: 'detect_webview_apps',
|
|
151
|
+
description: 'Enumerate running Electron / WebView2 / Chromium-shell apps (e.g. New Outlook, Teams, Discord, Slack, VS Code) whose ' +
|
|
152
|
+
'accessibility trees are typically sparse because the UI is rendered inside a web view. Returns each candidate with a ' +
|
|
153
|
+
'CDP-discovery hint — if a remote-debugging port is already live, you can attach to it via `browser({"action":"connect"})`; ' +
|
|
154
|
+
'otherwise the hint shows the relaunch command the user should run to enable CDP. Use this WHEN `read_screen` returns an ' +
|
|
155
|
+
'unexpectedly empty tree on a "native" app.',
|
|
156
|
+
parameters: {},
|
|
157
|
+
category: 'perception',
|
|
158
|
+
compactGroup: 'system',
|
|
159
|
+
safetyTier: 0,
|
|
160
|
+
handler: async (_params, ctx) => {
|
|
161
|
+
await ctx.ensureInitialized();
|
|
162
|
+
if (!ctx.platform) {
|
|
163
|
+
return { text: 'detect_webview_apps: platform adapter not initialized', isError: true };
|
|
164
|
+
}
|
|
165
|
+
const windows = await ctx.platform.listWindows();
|
|
166
|
+
const candidates = [];
|
|
167
|
+
// Port scan is cheap; do it once and reuse.
|
|
168
|
+
const cdpPort = await findLiveCdpPort();
|
|
169
|
+
const seenPids = new Set();
|
|
170
|
+
for (const w of windows) {
|
|
171
|
+
const fp = matchFingerprint(w.processName, w.title);
|
|
172
|
+
if (!fp)
|
|
173
|
+
continue;
|
|
174
|
+
// Apps can expose multiple top-level windows for the same process
|
|
175
|
+
// (e.g. Outlook's main window + a hidden notification host). One
|
|
176
|
+
// candidate per pid is what callers actually want.
|
|
177
|
+
if (seenPids.has(w.processId))
|
|
178
|
+
continue;
|
|
179
|
+
seenPids.add(w.processId);
|
|
180
|
+
candidates.push({
|
|
181
|
+
processName: w.processName,
|
|
182
|
+
processId: w.processId,
|
|
183
|
+
title: w.title,
|
|
184
|
+
displayName: fp.displayName,
|
|
185
|
+
kind: fp.kind,
|
|
186
|
+
cdpPort,
|
|
187
|
+
hint: buildHint(fp, cdpPort, w.title),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (candidates.length === 0) {
|
|
191
|
+
return {
|
|
192
|
+
text: 'No known Electron / WebView2 apps detected in the current window list. ' +
|
|
193
|
+
`${cdpPort !== null ? `A CDP endpoint IS live on port ${cdpPort} — call browser({"action":"connect"}) to attach.` : 'No CDP endpoint is currently live on the standard ports (9222/9223/9229/8315).'}`,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return { text: JSON.stringify({ candidates, cdpPort }, null, 2) };
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'relaunch_with_cdp',
|
|
201
|
+
description: 'Relaunch a WebView2 / Electron app with a remote-debugging port enabled so `browser` tools can attach. ' +
|
|
202
|
+
'The relaunch closes the existing instance (asks the OS to close politely via window_close first), then ' +
|
|
203
|
+
'starts a new one with `--remote-debugging-port=<port>`. The user MUST consent — this WILL lose any unsaved work ' +
|
|
204
|
+
'in the app. Returns instructions + the new port. Prefer the hint from `detect_webview_apps` when possible.',
|
|
205
|
+
parameters: {
|
|
206
|
+
appName: { type: 'string', description: 'Process name of the app (e.g. "discord", "slack", "olk")', required: true },
|
|
207
|
+
port: { type: 'number', description: 'Port to open for CDP. Default 9222.', required: false, default: 9222 },
|
|
208
|
+
},
|
|
209
|
+
category: 'orchestration',
|
|
210
|
+
compactGroup: 'system',
|
|
211
|
+
safetyTier: 3,
|
|
212
|
+
handler: async ({ appName, port }, ctx) => {
|
|
213
|
+
await ctx.ensureInitialized();
|
|
214
|
+
if (!ctx.platform) {
|
|
215
|
+
return { text: 'relaunch_with_cdp: platform adapter not initialized', isError: true };
|
|
216
|
+
}
|
|
217
|
+
const p = typeof port === 'number' ? port : 9222;
|
|
218
|
+
const name = String(appName);
|
|
219
|
+
// Try to close the existing instance gracefully.
|
|
220
|
+
await ctx.platform.setWindowState('close', { processName: name }).catch(() => false);
|
|
221
|
+
// Wait briefly for the close to propagate.
|
|
222
|
+
await new Promise(r => setTimeout(r, 600));
|
|
223
|
+
try {
|
|
224
|
+
// Relaunch with the debug flag. On Windows we pass args via launchApp's
|
|
225
|
+
// url field as a positional argument to Start-Process — adapter handles
|
|
226
|
+
// the quoting.
|
|
227
|
+
const flag = `--remote-debugging-port=${p}`;
|
|
228
|
+
if (ctx.platform.platform === 'win32') {
|
|
229
|
+
const { spawn } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
230
|
+
const child = spawn('powershell.exe', [
|
|
231
|
+
'-NoProfile', '-Command',
|
|
232
|
+
`Start-Process -FilePath '${name.replace(/'/g, "''")}' -ArgumentList '${flag}'`,
|
|
233
|
+
], { stdio: 'ignore', detached: true, windowsHide: true });
|
|
234
|
+
child.unref();
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
// macOS / Linux — open -a / direct spawn.
|
|
238
|
+
await ctx.platform.launchApp(name, { url: flag }).catch(() => ({}));
|
|
239
|
+
}
|
|
240
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
241
|
+
const alive = await fetch(`http://127.0.0.1:${p}/json/version`, { signal: AbortSignal.timeout(2000) })
|
|
242
|
+
.then(r => r.ok).catch(() => false);
|
|
243
|
+
return {
|
|
244
|
+
text: JSON.stringify({
|
|
245
|
+
appName: name, port: p, cdpLive: alive,
|
|
246
|
+
nextStep: alive ? `Call browser({"action":"connect","port":${p}}).` : 'Relaunch attempted but CDP endpoint not detected. The app may not support this flag.',
|
|
247
|
+
}, null, 2),
|
|
248
|
+
isError: !alive,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
return {
|
|
253
|
+
text: `relaunch_with_cdp failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
254
|
+
isError: true,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=electron_bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"electron_bridge.js","sourceRoot":"","sources":["../../src/tools/electron_bridge.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GH,wDAqHC;AA9MD,MAAM,UAAU,GAAyB;IACvC,iCAAiC;IACjC,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE;IACvG,0CAA0C;IAC1C,EAAE,YAAY,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC,iBAAiB,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE;IAC/H,qBAAqB;IACrB,EAAE,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,8BAA8B,EAAE;IAChJ,mBAAmB;IACnB,EAAE,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,8BAA8B,EA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tranche 1A.
|
|
4
|
+
*
|
|
5
|
+
* Every tool here is OS-agnostic by construction: it calls through
|
|
6
|
+
* `ctx.platform.*` and the adapter decides how to land the action on
|
|
7
|
+
* the current OS (Windows PowerShell + UIA, macOS osascript + nut-js,
|
|
8
|
+
* Linux wmctrl/xdotool/nut-js). When a primitive isn't supported on the
|
|
9
|
+
* current OS, the adapter returns a falsy value and the tool reports it
|
|
10
|
+
* as `not_supported_on_platform` rather than throwing.
|
|
11
|
+
*
|
|
12
|
+
* Coordinate convention: all mouse tools here take IMAGE-SPACE coords
|
|
13
|
+
* (matching desktop_screenshot), scaled through `getMouseScaleFactor()`
|
|
14
|
+
* just like the existing `mouse_click`. Window / keyboard tools do not
|
|
15
|
+
* carry coords.
|
|
16
|
+
*
|
|
17
|
+
* Safety tier: tools default to 'input' via `safety/layer.ts` TOOL_TIER;
|
|
18
|
+
* `close_window` is tagged 'destructive' and will require confirm when
|
|
19
|
+
* SafetyLayer surfaces block/confirm.
|
|
20
|
+
*/
|
|
21
|
+
import type { ToolDefinition } from './types';
|
|
22
|
+
export declare function getExtraTools(): ToolDefinition[];
|