codeloop-mcp-server 0.1.48 → 0.1.50
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/dist/auth/critical_floors.d.ts +8 -4
- package/dist/auth/critical_floors.d.ts.map +1 -1
- package/dist/auth/critical_floors.js +17 -17
- package/dist/auth/critical_floors.js.map +1 -1
- package/dist/auth/init_hint_cache.d.ts +35 -0
- package/dist/auth/init_hint_cache.d.ts.map +1 -0
- package/dist/auth/init_hint_cache.js +143 -0
- package/dist/auth/init_hint_cache.js.map +1 -0
- package/dist/evidence/screenshot_diff.d.ts +23 -0
- package/dist/evidence/screenshot_diff.d.ts.map +1 -1
- package/dist/evidence/screenshot_diff.js +46 -13
- package/dist/evidence/screenshot_diff.js.map +1 -1
- package/dist/index.js +291 -53
- package/dist/index.js.map +1 -1
- package/dist/runners/csproj_output_path.d.ts +22 -0
- package/dist/runners/csproj_output_path.d.ts.map +1 -0
- package/dist/runners/csproj_output_path.js +108 -0
- package/dist/runners/csproj_output_path.js.map +1 -0
- package/dist/runners/png_dims.d.ts +20 -0
- package/dist/runners/png_dims.d.ts.map +1 -0
- package/dist/runners/png_dims.js +58 -0
- package/dist/runners/png_dims.js.map +1 -0
- package/dist/runners/resolve_project_dir.d.ts +67 -0
- package/dist/runners/resolve_project_dir.d.ts.map +1 -0
- package/dist/runners/resolve_project_dir.js +82 -0
- package/dist/runners/resolve_project_dir.js.map +1 -0
- package/dist/runners/screenshot.d.ts.map +1 -1
- package/dist/runners/screenshot.js +17 -2
- package/dist/runners/screenshot.js.map +1 -1
- package/dist/runners/uia_resolver.d.ts +70 -0
- package/dist/runners/uia_resolver.d.ts.map +1 -0
- package/dist/runners/uia_resolver.js +210 -0
- package/dist/runners/uia_resolver.js.map +1 -0
- package/dist/runners/window_manager.d.ts +45 -4
- package/dist/runners/window_manager.d.ts.map +1 -1
- package/dist/runners/window_manager.js +254 -26
- package/dist/runners/window_manager.js.map +1 -1
- package/dist/tools/design_compare.d.ts.map +1 -1
- package/dist/tools/design_compare.js +85 -33
- package/dist/tools/design_compare.js.map +1 -1
- package/dist/tools/desktop_app_mode.d.ts +48 -0
- package/dist/tools/desktop_app_mode.d.ts.map +1 -0
- package/dist/tools/desktop_app_mode.js +86 -0
- package/dist/tools/desktop_app_mode.js.map +1 -0
- package/dist/tools/diagnose.d.ts.map +1 -1
- package/dist/tools/diagnose.js +32 -1
- package/dist/tools/diagnose.js.map +1 -1
- package/dist/tools/discover_screens.d.ts.map +1 -1
- package/dist/tools/discover_screens.js +94 -2
- package/dist/tools/discover_screens.js.map +1 -1
- package/dist/tools/self_test.d.ts +40 -0
- package/dist/tools/self_test.d.ts.map +1 -0
- package/dist/tools/self_test.js +205 -0
- package/dist/tools/self_test.js.map +1 -0
- package/dist/tools/verify.d.ts.map +1 -1
- package/dist/tools/verify.js +4 -5
- package/dist/tools/verify.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { platform } from "os";
|
|
2
|
+
import { runCommand, checkToolAvailable } from "./base.js";
|
|
3
|
+
/**
|
|
4
|
+
* Walks the UIA tree under the named app window and returns the
|
|
5
|
+
* centre of the FIRST element matching (in priority order):
|
|
6
|
+
* 1. AutomationId exact (the most stable identifier)
|
|
7
|
+
* 2. Name property exact
|
|
8
|
+
* 3. Name property substring (helps when the agent passes a
|
|
9
|
+
* readable label like "Luminaire Photometric Data" that is
|
|
10
|
+
* actually the visible text of a wider control whose Name
|
|
11
|
+
* includes additional context)
|
|
12
|
+
* 4. ControlType.ProgrammaticName
|
|
13
|
+
*
|
|
14
|
+
* Returns `{ found: false, reason }` on any failure path so the
|
|
15
|
+
* caller can log a structured error and fall through to other
|
|
16
|
+
* strategies (e.g. raw coord click).
|
|
17
|
+
*/
|
|
18
|
+
export async function resolveSelectorToXY(opts) {
|
|
19
|
+
if (platform() !== "win32") {
|
|
20
|
+
return { found: false, reason: "win-only" };
|
|
21
|
+
}
|
|
22
|
+
if (!(await checkToolAvailable("powershell"))) {
|
|
23
|
+
return { found: false, reason: "powershell-not-found" };
|
|
24
|
+
}
|
|
25
|
+
const { appName, automationId, text, role } = opts;
|
|
26
|
+
if (!appName)
|
|
27
|
+
return { found: false, reason: "no-appName" };
|
|
28
|
+
if (!automationId && !text && !role) {
|
|
29
|
+
return { found: false, reason: "no-selector" };
|
|
30
|
+
}
|
|
31
|
+
// Single-quote-escape every string we interpolate. PowerShell
|
|
32
|
+
// single-quoted literals only need '' to escape '.
|
|
33
|
+
const psEscape = (s) => s.replace(/'/g, "''");
|
|
34
|
+
const psApp = psEscape(appName);
|
|
35
|
+
const psAuto = automationId ? psEscape(automationId) : "";
|
|
36
|
+
const psText = text ? psEscape(text) : "";
|
|
37
|
+
const psRole = role ? psEscape(role) : "";
|
|
38
|
+
const script = `
|
|
39
|
+
$ErrorActionPreference = 'Stop'
|
|
40
|
+
Add-Type -AssemblyName UIAutomationClient
|
|
41
|
+
Add-Type -AssemblyName UIAutomationTypes
|
|
42
|
+
|
|
43
|
+
$root = [System.Windows.Automation.AutomationElement]::RootElement
|
|
44
|
+
$appCondition = New-Object System.Windows.Automation.PropertyCondition([System.Windows.Automation.AutomationElement]::NameProperty, '${psApp}')
|
|
45
|
+
$app = $root.FindFirst([System.Windows.Automation.TreeScope]::Children, $appCondition)
|
|
46
|
+
if (-not $app) {
|
|
47
|
+
Write-Output (ConvertTo-Json @{ found = $false; reason = 'app-not-found' } -Compress)
|
|
48
|
+
exit 1
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
$target = $null
|
|
52
|
+
$foundBy = ''
|
|
53
|
+
|
|
54
|
+
# 1. AutomationId exact
|
|
55
|
+
if ('${psAuto}' -ne '') {
|
|
56
|
+
$cond = New-Object System.Windows.Automation.PropertyCondition([System.Windows.Automation.AutomationElement]::AutomationIdProperty, '${psAuto}')
|
|
57
|
+
$target = $app.FindFirst([System.Windows.Automation.TreeScope]::Descendants, $cond)
|
|
58
|
+
if ($target) { $foundBy = 'AutomationId' }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
# 2. Name property exact
|
|
62
|
+
if (-not $target -and '${psText}' -ne '') {
|
|
63
|
+
$cond = New-Object System.Windows.Automation.PropertyCondition([System.Windows.Automation.AutomationElement]::NameProperty, '${psText}')
|
|
64
|
+
$target = $app.FindFirst([System.Windows.Automation.TreeScope]::Descendants, $cond)
|
|
65
|
+
if ($target) { $foundBy = 'Name-exact' }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# 3. Name property substring — walk the tree and pick the first
|
|
69
|
+
# descendant whose Name *contains* the requested text.
|
|
70
|
+
if (-not $target -and '${psText}' -ne '') {
|
|
71
|
+
$walker = [System.Windows.Automation.TreeWalker]::ControlViewWalker
|
|
72
|
+
$stack = New-Object System.Collections.Generic.Stack[System.Windows.Automation.AutomationElement]
|
|
73
|
+
$stack.Push($app)
|
|
74
|
+
$needle = '${psText}'
|
|
75
|
+
while ($stack.Count -gt 0 -and -not $target) {
|
|
76
|
+
$cur = $stack.Pop()
|
|
77
|
+
try {
|
|
78
|
+
$name = $cur.Current.Name
|
|
79
|
+
if ($name -and $name.IndexOf($needle, [StringComparison]::OrdinalIgnoreCase) -ge 0) {
|
|
80
|
+
$target = $cur
|
|
81
|
+
$foundBy = 'Name-contains'
|
|
82
|
+
break
|
|
83
|
+
}
|
|
84
|
+
} catch {}
|
|
85
|
+
try {
|
|
86
|
+
$child = $walker.GetFirstChild($cur)
|
|
87
|
+
while ($child -ne $null) {
|
|
88
|
+
$stack.Push($child)
|
|
89
|
+
$child = $walker.GetNextSibling($child)
|
|
90
|
+
}
|
|
91
|
+
} catch {}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
# 4. ControlType.ProgrammaticName
|
|
96
|
+
if (-not $target -and '${psRole}' -ne '') {
|
|
97
|
+
$walker = [System.Windows.Automation.TreeWalker]::ControlViewWalker
|
|
98
|
+
$stack = New-Object System.Collections.Generic.Stack[System.Windows.Automation.AutomationElement]
|
|
99
|
+
$stack.Push($app)
|
|
100
|
+
$roleNeedle = '${psRole}'
|
|
101
|
+
while ($stack.Count -gt 0 -and -not $target) {
|
|
102
|
+
$cur = $stack.Pop()
|
|
103
|
+
try {
|
|
104
|
+
$ct = $cur.Current.ControlType.ProgrammaticName
|
|
105
|
+
if ($ct -and ($ct -eq $roleNeedle -or $ct.EndsWith('.' + $roleNeedle))) {
|
|
106
|
+
$target = $cur
|
|
107
|
+
$foundBy = 'ControlType'
|
|
108
|
+
break
|
|
109
|
+
}
|
|
110
|
+
} catch {}
|
|
111
|
+
try {
|
|
112
|
+
$child = $walker.GetFirstChild($cur)
|
|
113
|
+
while ($child -ne $null) {
|
|
114
|
+
$stack.Push($child)
|
|
115
|
+
$child = $walker.GetNextSibling($child)
|
|
116
|
+
}
|
|
117
|
+
} catch {}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (-not $target) {
|
|
122
|
+
Write-Output (ConvertTo-Json @{ found = $false; reason = 'no-match' } -Compress)
|
|
123
|
+
exit 1
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
# Resolve to a screen-absolute (x, y). UIA's GetClickablePoint() is
|
|
127
|
+
# the most robust path; it accounts for the element's hit-test region
|
|
128
|
+
# (e.g. clicking a button's centre rather than its outer bounds).
|
|
129
|
+
# When unavailable (some controls throw NoClickablePointException),
|
|
130
|
+
# fall back to the BoundingRectangle centre.
|
|
131
|
+
$cx = $null
|
|
132
|
+
$cy = $null
|
|
133
|
+
$rect = $null
|
|
134
|
+
try {
|
|
135
|
+
$rect = $target.Current.BoundingRectangle
|
|
136
|
+
} catch {}
|
|
137
|
+
try {
|
|
138
|
+
$cp = $target.GetClickablePoint()
|
|
139
|
+
$cx = [int]$cp.X
|
|
140
|
+
$cy = [int]$cp.Y
|
|
141
|
+
} catch {
|
|
142
|
+
if ($rect -ne $null -and $rect.Width -gt 0 -and $rect.Height -gt 0) {
|
|
143
|
+
$cx = [int]($rect.X + $rect.Width / 2)
|
|
144
|
+
$cy = [int]($rect.Y + $rect.Height / 2)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if ($cx -eq $null -or $cy -eq $null) {
|
|
149
|
+
Write-Output (ConvertTo-Json @{ found = $false; reason = 'no-clickable-point-no-bounds'; foundBy = $foundBy } -Compress)
|
|
150
|
+
exit 1
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
$payload = @{
|
|
154
|
+
found = $true
|
|
155
|
+
x = $cx
|
|
156
|
+
y = $cy
|
|
157
|
+
foundBy = $foundBy
|
|
158
|
+
}
|
|
159
|
+
if ($rect -ne $null) {
|
|
160
|
+
$payload.bounds = @{
|
|
161
|
+
x = [int]$rect.X
|
|
162
|
+
y = [int]$rect.Y
|
|
163
|
+
width = [int]$rect.Width
|
|
164
|
+
height = [int]$rect.Height
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
Write-Output (ConvertTo-Json $payload -Compress -Depth 6)
|
|
168
|
+
exit 0
|
|
169
|
+
`;
|
|
170
|
+
const result = await runCommand("powershell", ["-NoProfile", "-Command", script], process.cwd());
|
|
171
|
+
const lastJsonLine = result.stdout
|
|
172
|
+
.split(/\r?\n/)
|
|
173
|
+
.map((l) => l.trim())
|
|
174
|
+
.filter((l) => l.startsWith("{"))
|
|
175
|
+
.pop();
|
|
176
|
+
if (!lastJsonLine) {
|
|
177
|
+
return { found: false, reason: result.stderr || "no-output" };
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
const parsed = JSON.parse(lastJsonLine);
|
|
181
|
+
if (!parsed.found) {
|
|
182
|
+
return { found: false, reason: parsed.reason || "no-match" };
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
found: true,
|
|
186
|
+
x: parsed.x,
|
|
187
|
+
y: parsed.y,
|
|
188
|
+
foundBy: parsed.foundBy,
|
|
189
|
+
bounds: parsed.bounds,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
return { found: false, reason: "parse-error" };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Test-only helper exporting the script body so unit tests can pin
|
|
198
|
+
* the priority ordering (AutomationId > Name-exact > Name-contains >
|
|
199
|
+
* ControlType) without needing a live Windows host.
|
|
200
|
+
*/
|
|
201
|
+
export function buildResolveScriptForTest(opts) {
|
|
202
|
+
const psEscape = (s) => s.replace(/'/g, "''");
|
|
203
|
+
return [
|
|
204
|
+
`app='${psEscape(opts.appName)}'`,
|
|
205
|
+
`automationId='${opts.automationId ? psEscape(opts.automationId) : ""}'`,
|
|
206
|
+
`text='${opts.text ? psEscape(opts.text) : ""}'`,
|
|
207
|
+
`role='${opts.role ? psEscape(opts.role) : ""}'`,
|
|
208
|
+
].join(";");
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=uia_resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uia_resolver.js","sourceRoot":"","sources":["../../src/runners/uia_resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AA8C3D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAuB;IAC/D,IAAI,QAAQ,EAAE,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,kBAAkB,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;IAC1D,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,G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AC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;QACxE,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;QAChD,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;KACjD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -5,6 +5,34 @@
|
|
|
5
5
|
* Windows: not needed (uses process handle)
|
|
6
6
|
*/
|
|
7
7
|
export declare function findWindowId(appName: string): Promise<string | null>;
|
|
8
|
+
/**
|
|
9
|
+
* 0.1.50 H8 — structured "window not found" diagnostic.
|
|
10
|
+
*
|
|
11
|
+
* Photometry-DB E2E logs surfaced "App window not found" with NO
|
|
12
|
+
* context — the agent had no idea whether `evidence.target_app` was
|
|
13
|
+
* set, what process names were running, or what the actual window
|
|
14
|
+
* titles looked like. Without that, the agent retried the same
|
|
15
|
+
* lookup or fell back to silent IDE capture (the very regression
|
|
16
|
+
* desktopAppMode existed to prevent).
|
|
17
|
+
*
|
|
18
|
+
* The detailed variant returns:
|
|
19
|
+
* - `candidates`: the process names + main-window titles we saw
|
|
20
|
+
* - `target_app`: the literal value the caller passed (mirrors
|
|
21
|
+
* `evidence.target_app` from .codeloop/config.json)
|
|
22
|
+
* - `next_step`: a one-line directive the agent can act on
|
|
23
|
+
*/
|
|
24
|
+
export interface WindowNotFoundError {
|
|
25
|
+
found: false;
|
|
26
|
+
candidates: string[];
|
|
27
|
+
target_app: string | null;
|
|
28
|
+
next_step: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WindowFound {
|
|
31
|
+
found: true;
|
|
32
|
+
id: string;
|
|
33
|
+
}
|
|
34
|
+
export type WindowLookupResult = WindowFound | WindowNotFoundError;
|
|
35
|
+
export declare function findWindowIdDetailed(appName: string): Promise<WindowLookupResult>;
|
|
8
36
|
/**
|
|
9
37
|
* PowerShell snippet that picks ONE Get-Process row matching $appName with a
|
|
10
38
|
* priority ladder. The previous single `-match '<appName>'` substring/regex
|
|
@@ -32,15 +60,28 @@ export declare function buildWindowsProcessLookup(appName: string): string;
|
|
|
32
60
|
*/
|
|
33
61
|
export declare function bringAppToFront(appName: string): Promise<string>;
|
|
34
62
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
63
|
+
* Window bounds in screen pixels, plus optional DPI scale factors so
|
|
64
|
+
* codeloop_interact can translate logical-pixel coords from a captured
|
|
65
|
+
* screenshot to physical-pixel coords for the OS click APIs.
|
|
66
|
+
*
|
|
67
|
+
* dpi_x / dpi_y are physical-pixel-per-logical ratios (1.0 = 96 DPI
|
|
68
|
+
* baseline; 2.0 = 200% / Retina). Omitted when we couldn't read the
|
|
69
|
+
* value cleanly — translateXY treats absence as 1.0 and clicks
|
|
70
|
+
* unscaled, which preserves legacy behaviour.
|
|
37
71
|
*/
|
|
38
|
-
export
|
|
72
|
+
export type WindowBounds = {
|
|
39
73
|
x: number;
|
|
40
74
|
y: number;
|
|
41
75
|
width: number;
|
|
42
76
|
height: number;
|
|
43
|
-
|
|
77
|
+
dpi_x?: number;
|
|
78
|
+
dpi_y?: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Get the window bounds (position + size) for cropping video capture.
|
|
82
|
+
* Returns { x, y, width, height, dpi_x?, dpi_y? } in screen points.
|
|
83
|
+
*/
|
|
84
|
+
export declare function getWindowBounds(appName: string): Promise<WindowBounds | null>;
|
|
44
85
|
/**
|
|
45
86
|
* Click at screen coordinates using CGEvent (macOS), user32.dll (Windows),
|
|
46
87
|
* or xdotool (Linux). These are low-level HID events that Flutter and all
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window_manager.d.ts","sourceRoot":"","sources":["../../src/runners/window_manager.ts"],"names":[],"mappings":"
|
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