@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,119 @@
|
|
|
1
|
+
param([int]$Port = 3847, [int]$TimeoutSec = 30)
|
|
2
|
+
|
|
3
|
+
$token = (Get-Content "$env:USERPROFILE\.clawdcursor\token" -Raw).Trim()
|
|
4
|
+
$base = "http://127.0.0.1:$Port/mcp"
|
|
5
|
+
$hdrs = @{
|
|
6
|
+
"Authorization" = "Bearer $token"
|
|
7
|
+
"Accept" = "application/json, text/event-stream"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
$global:jsonRpcId = 0
|
|
11
|
+
function Call-Tool {
|
|
12
|
+
param([string]$Name, [hashtable]$Arguments = @{})
|
|
13
|
+
$global:jsonRpcId++
|
|
14
|
+
$body = @{
|
|
15
|
+
jsonrpc = "2.0"
|
|
16
|
+
id = $global:jsonRpcId
|
|
17
|
+
method = "tools/call"
|
|
18
|
+
params = @{ name = $Name; arguments = $Arguments }
|
|
19
|
+
} | ConvertTo-Json -Depth 10 -Compress
|
|
20
|
+
try {
|
|
21
|
+
$r = Invoke-WebRequest -Uri $base -Method POST -Headers $hdrs -ContentType "application/json" -Body $body -TimeoutSec $TimeoutSec -UseBasicParsing
|
|
22
|
+
$content = $r.Content
|
|
23
|
+
if ($content -match '(?ms)^data:\s*(\{.*?\})\s*$') {
|
|
24
|
+
return ($matches[1] | ConvertFrom-Json)
|
|
25
|
+
}
|
|
26
|
+
return ($content | ConvertFrom-Json)
|
|
27
|
+
} catch {
|
|
28
|
+
return @{ error = @{ message = $_.Exception.Message } }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Tool-Text {
|
|
33
|
+
param($Result)
|
|
34
|
+
if ($Result.error) { return "ERROR: $($Result.error.message)" }
|
|
35
|
+
if ($Result.result.content) {
|
|
36
|
+
return ($Result.result.content | ForEach-Object { $_.text }) -join "`n"
|
|
37
|
+
}
|
|
38
|
+
return ($Result | ConvertTo-Json -Depth 5 -Compress)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Write-Host ""
|
|
42
|
+
Write-Host "========================================="
|
|
43
|
+
Write-Host " Smoke 1: Calculator (Win32 a11y)"
|
|
44
|
+
Write-Host "========================================="
|
|
45
|
+
|
|
46
|
+
$r1 = Call-Tool open_app @{ name = "Calculator" }
|
|
47
|
+
Write-Host "open_app Calculator: $(Tool-Text $r1)"
|
|
48
|
+
Start-Sleep -Seconds 2
|
|
49
|
+
|
|
50
|
+
$r2 = Call-Tool read_screen @{}
|
|
51
|
+
$tree = Tool-Text $r2
|
|
52
|
+
$hasButtons = ($tree -match 'One|Two|Three|Plus|Equals|Button')
|
|
53
|
+
Write-Host "read_screen lines: $($tree.Split([char]10).Count); named buttons: $hasButtons"
|
|
54
|
+
|
|
55
|
+
$r3 = Call-Tool invoke_element @{ name = "Two" }
|
|
56
|
+
Write-Host "invoke Two: $(Tool-Text $r3)"
|
|
57
|
+
Start-Sleep -Milliseconds 200
|
|
58
|
+
$null = Call-Tool invoke_element @{ name = "Plus" }
|
|
59
|
+
Start-Sleep -Milliseconds 200
|
|
60
|
+
$null = Call-Tool invoke_element @{ name = "Three" }
|
|
61
|
+
Start-Sleep -Milliseconds 200
|
|
62
|
+
$null = Call-Tool invoke_element @{ name = "Equals" }
|
|
63
|
+
Start-Sleep -Milliseconds 600
|
|
64
|
+
|
|
65
|
+
$r4 = Call-Tool read_screen @{}
|
|
66
|
+
$treeAfter = Tool-Text $r4
|
|
67
|
+
$saysFive = ($treeAfter -match 'Display is 5|\b5\b')
|
|
68
|
+
Write-Host "Result tree mentions 5: $saysFive"
|
|
69
|
+
if ($saysFive) { Write-Host "PASS Calculator 2+3=5 via a11y" } else { Write-Host "FAIL result not in tree" }
|
|
70
|
+
|
|
71
|
+
Write-Host ""
|
|
72
|
+
Write-Host "========================================="
|
|
73
|
+
Write-Host " Smoke 2: Notepad (Win32 typing)"
|
|
74
|
+
Write-Host "========================================="
|
|
75
|
+
|
|
76
|
+
$r5 = Call-Tool open_app @{ name = "Notepad" }
|
|
77
|
+
Write-Host "open_app Notepad: $(Tool-Text $r5)"
|
|
78
|
+
Start-Sleep -Seconds 2
|
|
79
|
+
|
|
80
|
+
$r6 = Call-Tool focus_element @{ name = "Text editor" }
|
|
81
|
+
Write-Host "focus_element Text editor: $(Tool-Text $r6)"
|
|
82
|
+
|
|
83
|
+
$stamp = (Get-Date -Format 'HHmmss')
|
|
84
|
+
$payload = "clawdcursor v0.9 smoke at $stamp"
|
|
85
|
+
$r7 = Call-Tool type_text @{ text = $payload }
|
|
86
|
+
Write-Host "type_text: $(Tool-Text $r7)"
|
|
87
|
+
Start-Sleep -Milliseconds 500
|
|
88
|
+
|
|
89
|
+
$r8 = Call-Tool read_screen @{}
|
|
90
|
+
$treeNotepad = Tool-Text $r8
|
|
91
|
+
$contains = ($treeNotepad -match [regex]::Escape($payload.Substring(0, 20)))
|
|
92
|
+
Write-Host "Notepad tree contains typed prefix: $contains"
|
|
93
|
+
if ($contains) { Write-Host "PASS Notepad type_text via a11y" } else { Write-Host "FAIL typed text not in tree" }
|
|
94
|
+
|
|
95
|
+
Write-Host ""
|
|
96
|
+
Write-Host "========================================="
|
|
97
|
+
Write-Host " Smoke 3: Outlook webview detection"
|
|
98
|
+
Write-Host "========================================="
|
|
99
|
+
|
|
100
|
+
$r9 = Call-Tool open_app @{ name = "Outlook" }
|
|
101
|
+
Write-Host "open_app Outlook: $(Tool-Text $r9)"
|
|
102
|
+
Start-Sleep -Seconds 3
|
|
103
|
+
|
|
104
|
+
$r10 = Call-Tool detect_webview_apps @{}
|
|
105
|
+
Write-Host "detect_webview_apps: $(Tool-Text $r10)"
|
|
106
|
+
|
|
107
|
+
$r11 = Call-Tool read_screen @{}
|
|
108
|
+
$outlookTree = Tool-Text $r11
|
|
109
|
+
$emptyTree = ($outlookTree.Length -lt 400 -or $outlookTree -match 'empty a11y tree|custom-canvas|app may be custom')
|
|
110
|
+
Write-Host "Outlook a11y tree size: $($outlookTree.Length) chars; sparse/empty: $emptyTree"
|
|
111
|
+
if ($emptyTree) {
|
|
112
|
+
Write-Host "REPRO Outlook a11y is sparse/empty (matches your failed run)"
|
|
113
|
+
Write-Host " Agent should have used detect_webview_apps + relaunch_with_cdp"
|
|
114
|
+
} else {
|
|
115
|
+
Write-Host "NEW Outlook surfaced a real tree (webview hint may not be needed)"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
Write-Host ""
|
|
119
|
+
Write-Host "=== SMOKE TESTS DONE ==="
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Propagate package.json version to every other place it appears.
|
|
3
|
+
*
|
|
4
|
+
* Why: SKILL.md frontmatter, the marketing site (docs/index.html), and the
|
|
5
|
+
* install scripts (docs/install.{sh,ps1}) all carry the version as a
|
|
6
|
+
* literal. Hand-syncing them on every release is exactly the kind of
|
|
7
|
+
* task that gets forgotten — leading to a site that advertises the wrong
|
|
8
|
+
* version or an MCP host registry that lies about which version is in
|
|
9
|
+
* the npm package.
|
|
10
|
+
*
|
|
11
|
+
* Wired into npm's `version` lifecycle hook (see package.json scripts).
|
|
12
|
+
* `npm version <bump>` flow:
|
|
13
|
+
* 1. npm bumps package.json
|
|
14
|
+
* 2. THIS script runs — propagates the new version to all other files
|
|
15
|
+
* 3. npm stages the version-bump commit (we git-add the propagated files)
|
|
16
|
+
* 4. npm creates the tag
|
|
17
|
+
*
|
|
18
|
+
* Can also be invoked directly as `tsx scripts/sync-version.ts` to verify
|
|
19
|
+
* everything is in sync without bumping (exits 0 if no changes needed).
|
|
20
|
+
*
|
|
21
|
+
* Adding new sites: append a SyncTarget below. Each target uses an
|
|
22
|
+
* intent-anchored regex (e.g. matched against the surrounding HTML
|
|
23
|
+
* attribute or YAML key) rather than a global "find any v0.x.y" — this
|
|
24
|
+
* avoids accidentally rewriting historical version markers in the
|
|
25
|
+
* CHANGELOG / "What's new" sections.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import * as fs from 'fs';
|
|
29
|
+
import * as path from 'path';
|
|
30
|
+
|
|
31
|
+
const REPO_ROOT = path.resolve(__dirname, '..');
|
|
32
|
+
const PKG = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'package.json'), 'utf-8'));
|
|
33
|
+
const VERSION: string = PKG.version;
|
|
34
|
+
|
|
35
|
+
if (!/^\d+\.\d+\.\d+/.test(VERSION)) {
|
|
36
|
+
console.error(`✗ package.json version "${VERSION}" is not a valid semver`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface SyncTarget {
|
|
41
|
+
file: string;
|
|
42
|
+
pattern: RegExp;
|
|
43
|
+
replacement: string;
|
|
44
|
+
/** Human-readable description of what this target represents. */
|
|
45
|
+
desc: string;
|
|
46
|
+
/** When true, a non-matching pattern is NOT an error (illustrative examples
|
|
47
|
+
* that may be absent depending on the marketing-site layout). */
|
|
48
|
+
optional?: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const TARGETS: SyncTarget[] = [
|
|
52
|
+
// SKILL.md frontmatter — the version field MCP hosts read for skill metadata.
|
|
53
|
+
{
|
|
54
|
+
file: 'SKILL.md',
|
|
55
|
+
pattern: /^(version:\s*)\d+\.\d+\.\d+([^\d.]|$)/m,
|
|
56
|
+
replacement: `$1${VERSION}$2`,
|
|
57
|
+
desc: 'SKILL frontmatter `version:` field',
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// server.json — the MCP registry manifest (added 2026-06-11). Carries the
|
|
61
|
+
// version TWICE: the server entry and the npm package pin. A stale value
|
|
62
|
+
// here makes the official registry advertise an old release.
|
|
63
|
+
{
|
|
64
|
+
file: 'server.json',
|
|
65
|
+
pattern: /("version":\s*")\d+\.\d+\.\d+(")/g,
|
|
66
|
+
replacement: `$1${VERSION}$2`,
|
|
67
|
+
desc: 'server.json registry manifest versions (server + npm package)',
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
// .claude-plugin/plugin.json — the Claude Code plugin manifest. Wraps the
|
|
71
|
+
// same npm release; a stale version here makes the plugin advertise the
|
|
72
|
+
// wrong version to plugin hosts.
|
|
73
|
+
{
|
|
74
|
+
file: '.claude-plugin/plugin.json',
|
|
75
|
+
pattern: /("version":\s*")\d+\.\d+\.\d+(")/,
|
|
76
|
+
replacement: `$1${VERSION}$2`,
|
|
77
|
+
desc: 'Claude Code plugin manifest version',
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
// docs/index.html — marketing site. Several places, all distinct contexts.
|
|
81
|
+
{
|
|
82
|
+
file: 'docs/index.html',
|
|
83
|
+
pattern: /(AGENT-READABLE SUMMARY \(v)\d+\.\d+\.\d+(\))/,
|
|
84
|
+
replacement: `$1${VERSION}$2`,
|
|
85
|
+
desc: 'index.html agent-readable summary header',
|
|
86
|
+
},
|
|
87
|
+
// NOTE: the <title>, meta description, and og:title are intentionally
|
|
88
|
+
// VERSION-FREE (clean branding, 2026-06-14 reframe) — the visible version
|
|
89
|
+
// lives in the hero badge / footer / agent-summary, which ARE synced below.
|
|
90
|
+
{
|
|
91
|
+
file: 'docs/index.html',
|
|
92
|
+
pattern: /(<div class="hero-badge"><div class="pulse"><\/div>\s*v)\d+\.\d+\.\d+/,
|
|
93
|
+
replacement: `$1${VERSION}`,
|
|
94
|
+
desc: 'index.html hero badge',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
file: 'docs/index.html',
|
|
98
|
+
pattern: /(clawd<strong>cursor<\/strong> v)\d+\.\d+\.\d+/,
|
|
99
|
+
replacement: `$1${VERSION}`,
|
|
100
|
+
desc: 'index.html footer brand',
|
|
101
|
+
},
|
|
102
|
+
// The installer-pin examples — PowerShell + bash. These are illustrative and
|
|
103
|
+
// the marketing site may render only one (or neither) depending on layout, so
|
|
104
|
+
// the PowerShell example is OPTIONAL: update it if present, don't error if not.
|
|
105
|
+
{
|
|
106
|
+
file: 'docs/index.html',
|
|
107
|
+
pattern: /(\$env:VERSION='v)\d+\.\d+\.\d+(')/g,
|
|
108
|
+
replacement: `$1${VERSION}$2`,
|
|
109
|
+
desc: 'index.html PowerShell install-pin example',
|
|
110
|
+
optional: true,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
file: 'docs/index.html',
|
|
114
|
+
pattern: /(\bVERSION=v)\d+\.\d+\.\d+(\b)/g,
|
|
115
|
+
replacement: `$1${VERSION}$2`,
|
|
116
|
+
desc: 'index.html bash install-pin example',
|
|
117
|
+
// Optional for the same reason as the PowerShell example above: the
|
|
118
|
+
// npm-first install section may render only one pin example (or neither).
|
|
119
|
+
optional: true,
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
// Installer scripts — header comments that document the example pin.
|
|
123
|
+
// The runtime VERSION="${VERSION:-main}" default below is intentionally
|
|
124
|
+
// dynamic (defaults to main branch) and is NOT touched.
|
|
125
|
+
{
|
|
126
|
+
file: 'docs/install.sh',
|
|
127
|
+
pattern: /(# Specify version: VERSION=v)\d+\.\d+\.\d+/,
|
|
128
|
+
replacement: `$1${VERSION}`,
|
|
129
|
+
desc: 'install.sh header pin example',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
file: 'docs/install.ps1',
|
|
133
|
+
pattern: /(# Specify version: \$env:VERSION='v)\d+\.\d+\.\d+(')/,
|
|
134
|
+
replacement: `$1${VERSION}$2`,
|
|
135
|
+
desc: 'install.ps1 header pin example',
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
let changed = 0;
|
|
140
|
+
const touchedFiles = new Set<string>();
|
|
141
|
+
const errors: string[] = [];
|
|
142
|
+
|
|
143
|
+
for (const t of TARGETS) {
|
|
144
|
+
const fp = path.join(REPO_ROOT, t.file);
|
|
145
|
+
if (!fs.existsSync(fp)) {
|
|
146
|
+
errors.push(`✗ missing file: ${t.file} (target: ${t.desc})`);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const before = fs.readFileSync(fp, 'utf-8');
|
|
150
|
+
const after = before.replace(t.pattern, t.replacement);
|
|
151
|
+
if (before === after) {
|
|
152
|
+
// Either already at the right version, or the pattern didn't match — both
|
|
153
|
+
// are non-fatal but the second case is interesting. We can't distinguish
|
|
154
|
+
// cleanly without re-scanning, so just print a quiet status line.
|
|
155
|
+
if (!t.pattern.test(after) && !t.optional) {
|
|
156
|
+
errors.push(`✗ ${t.desc} pattern did not match in ${t.file}`);
|
|
157
|
+
}
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
fs.writeFileSync(fp, after);
|
|
161
|
+
changed++;
|
|
162
|
+
touchedFiles.add(t.file);
|
|
163
|
+
console.log(` ✓ ${t.desc} → ${t.file}`);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (errors.length > 0) {
|
|
167
|
+
console.error('\nErrors:');
|
|
168
|
+
for (const e of errors) console.error(` ${e}`);
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (changed === 0) {
|
|
173
|
+
console.log(`All version literals already match v${VERSION}.`);
|
|
174
|
+
process.exit(0);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
console.log(`\nUpdated ${changed} site(s) in ${touchedFiles.size} file(s) to v${VERSION}.`);
|
|
178
|
+
console.log('Files: ' + Array.from(touchedFiles).join(', '));
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* verify-install.js — Lightweight post-install verification.
|
|
4
|
+
*
|
|
5
|
+
* Checks Node.js version and critical native dependencies.
|
|
6
|
+
* Runs after `npm install` and before `npm run setup`.
|
|
7
|
+
* Non-blocking: prints warnings but never fails the install.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const MIN_NODE_MAJOR = 20;
|
|
11
|
+
|
|
12
|
+
function check() {
|
|
13
|
+
let ok = true;
|
|
14
|
+
|
|
15
|
+
// ── Node.js version check ──
|
|
16
|
+
const major = parseInt(process.versions.node.split('.')[0], 10);
|
|
17
|
+
if (major < MIN_NODE_MAJOR) {
|
|
18
|
+
console.error(`\n❌ Node.js ${MIN_NODE_MAJOR}+ required (found ${process.versions.node})`);
|
|
19
|
+
console.error(` Download: https://nodejs.org/\n`);
|
|
20
|
+
process.exit(1); // Hard fail — nothing will work
|
|
21
|
+
}
|
|
22
|
+
console.log(`✅ Node.js ${process.versions.node}`);
|
|
23
|
+
|
|
24
|
+
// ── Critical native dependencies ──
|
|
25
|
+
const deps = [
|
|
26
|
+
{ name: '@nut-tree-fork/nut-js', label: 'nut-js (desktop automation)' },
|
|
27
|
+
{ name: 'sharp', label: 'sharp (image processing)' },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
for (const dep of deps) {
|
|
31
|
+
try {
|
|
32
|
+
require(dep.name);
|
|
33
|
+
console.log(`✅ ${dep.label}`);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
ok = false;
|
|
36
|
+
console.warn(`⚠️ ${dep.label} — failed to load`);
|
|
37
|
+
if (process.platform === 'win32') {
|
|
38
|
+
console.warn(` Fix: npm install --global windows-build-tools`);
|
|
39
|
+
console.warn(` Or: Install Visual C++ Build Tools from https://visualstudio.microsoft.com/visual-cpp-build-tools/`);
|
|
40
|
+
} else if (process.platform === 'darwin') {
|
|
41
|
+
console.warn(` Fix: xcode-select --install`);
|
|
42
|
+
} else {
|
|
43
|
+
console.warn(` Fix: sudo apt-get install build-essential libx11-dev`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ── Optional dependencies ──
|
|
49
|
+
try {
|
|
50
|
+
require('playwright');
|
|
51
|
+
console.log(`✅ playwright (browser automation)`);
|
|
52
|
+
} catch {
|
|
53
|
+
console.warn(`⚠️ playwright — not installed (browser/CDP features will be limited)`);
|
|
54
|
+
console.warn(` Fix: npx playwright install chromium`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ── macOS native build check ──
|
|
58
|
+
if (process.platform === 'darwin') {
|
|
59
|
+
const path = require('path');
|
|
60
|
+
const fs = require('fs');
|
|
61
|
+
const appDir = path.join(__dirname, '..', 'native', 'ClawdCursor.app', 'Contents', 'MacOS');
|
|
62
|
+
const requiredBinaries = ['ClawdCursorHost', 'clawdcursor-helper', 'screenshot-helper', 'permission-check'];
|
|
63
|
+
const missing = requiredBinaries.filter(b => !fs.existsSync(path.join(appDir, b)));
|
|
64
|
+
if (missing.length > 0) {
|
|
65
|
+
console.warn(`⚠️ Native macOS binaries not built: ${missing.join(', ')}`);
|
|
66
|
+
console.warn(` Fix: cd native && chmod +x build.sh && ./build.sh`);
|
|
67
|
+
ok = false;
|
|
68
|
+
} else {
|
|
69
|
+
console.log(`✅ Native macOS binaries (ClawdCursor.app)`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (ok) {
|
|
74
|
+
console.log(`\n🐾 All dependencies verified. Run: npm run setup\n`);
|
|
75
|
+
} else {
|
|
76
|
+
console.warn(`\n⚠️ Some dependencies have issues. clawdcursor may still work with reduced functionality.`);
|
|
77
|
+
console.warn(` Run: npm run setup\n`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
check();
|