@developerz.ai/ui-debugger-mcp 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -3
- package/dist/adapters/browser/browser-adapter.d.ts +1 -1
- package/dist/adapters/browser/browser-adapter.js +11 -4
- package/dist/adapters/browser/browser-adapter.js.map +1 -1
- package/dist/adapters/browser/launch.d.ts +12 -0
- package/dist/adapters/browser/launch.js +33 -0
- package/dist/adapters/browser/launch.js.map +1 -1
- package/dist/adapters/browser/log-format.d.ts +17 -5
- package/dist/adapters/browser/log-format.js +41 -4
- package/dist/adapters/browser/log-format.js.map +1 -1
- package/dist/agent/prompts/compose.d.ts +17 -2
- package/dist/agent/prompts/compose.js +24 -4
- package/dist/agent/prompts/compose.js.map +1 -1
- package/dist/config/schema.d.ts +36 -0
- package/dist/config/schema.js +32 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/tools/describe.js +3 -2
- package/dist/mcp/tools/describe.js.map +1 -1
- package/dist/mcp/tools/get-findings.js +16 -4
- package/dist/mcp/tools/get-findings.js.map +1 -1
- package/dist/mcp/tools/output.d.ts +1 -0
- package/dist/mcp/tools/output.js +5 -0
- package/dist/mcp/tools/output.js.map +1 -1
- package/dist/mcp/tools/result.d.ts +17 -3
- package/dist/mcp/tools/result.js +24 -10
- package/dist/mcp/tools/result.js.map +1 -1
- package/dist/mcp/tools/start-debug.js +8 -0
- package/dist/mcp/tools/start-debug.js.map +1 -1
- package/dist/services/debug-service.d.ts +12 -0
- package/dist/services/debug-service.js +19 -3
- package/dist/services/debug-service.js.map +1 -1
- package/dist/services/login.d.ts +78 -0
- package/dist/services/login.js +200 -0
- package/dist/services/login.js.map +1 -0
- package/dist/services/session-builder.d.ts +4 -1
- package/dist/services/session-builder.js +49 -10
- package/dist/services/session-builder.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named auth personas — signing in for the run, before the driver's first step.
|
|
3
|
+
*
|
|
4
|
+
* `debugLogin` skips a CAPTCHA; it never skipped auth. So every goal string had
|
|
5
|
+
* to re-teach the login flow in prose, which cost driver steps on every run and
|
|
6
|
+
* put credentials in a free-text field that gets logged. A persona
|
|
7
|
+
* (`targets.<t>.auth.<name>` — see `config/schema.ts`) states the recipe once and
|
|
8
|
+
* `start_debug({as})` names it.
|
|
9
|
+
*
|
|
10
|
+
* **Out-of-band, not in-trail.** The login runs HERE, through the same adapter
|
|
11
|
+
* contract the belt uses, between `adapter.open()` and the loop's first step —
|
|
12
|
+
* the driver never performs it. Two reasons, both structural:
|
|
13
|
+
*
|
|
14
|
+
* - *The secret must never enter the model's context.* That is already the rule
|
|
15
|
+
* for credential headers and `?token=` params (`log-format.ts`). A recipe
|
|
16
|
+
* composed into the system prompt would ship the password to the provider on
|
|
17
|
+
* EVERY step, which is a strictly worse posture than the one the repo holds
|
|
18
|
+
* everywhere else.
|
|
19
|
+
* - *Steps are the scarce resource.* An in-trail login spends 4-8 of the run's
|
|
20
|
+
* steps, and the run's context, on work that has one correct answer.
|
|
21
|
+
*
|
|
22
|
+
* The cost is that a changed form cannot be improvised around. That is paid back
|
|
23
|
+
* as an {@link AuthError} naming the persona and the control that did not
|
|
24
|
+
* resolve, thrown out of `start_debug` before a step is spent — which is a better
|
|
25
|
+
* answer than a driver quietly reporting empty pages behind a login it never got
|
|
26
|
+
* through.
|
|
27
|
+
*
|
|
28
|
+
* The trail stays honest: every action here is recorded as a {@link Step} the
|
|
29
|
+
* same way `act` records its own, marked as the pre-run login rather than a
|
|
30
|
+
* driver decision, with the values never written down.
|
|
31
|
+
*/
|
|
32
|
+
import { capWait } from '../adapters/budget.js';
|
|
33
|
+
import { AuthError, ConfigError } from '../errors.js';
|
|
34
|
+
/** Whole-login default budget; the run's remaining cap may only shorten it. */
|
|
35
|
+
const LOGIN_TIMEOUT_MS = 30_000;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve `start_debug({as})` against the target's configured personas.
|
|
38
|
+
*
|
|
39
|
+
* Fails loud ({@link ConfigError}) on an unknown key, listing the valid ones — an
|
|
40
|
+
* `as` typo must NEVER fall through to a signed-out run, because every screen
|
|
41
|
+
* behind the login then reads as a broken UI.
|
|
42
|
+
*/
|
|
43
|
+
export function resolveAuth(target, targetName, as) {
|
|
44
|
+
if (as === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
if (target.adapter !== 'browser') {
|
|
47
|
+
throw new ConfigError(`'as' (auth persona) only applies to web targets, but '${targetName}' is '${target.adapter}'`);
|
|
48
|
+
}
|
|
49
|
+
const auth = target.auth;
|
|
50
|
+
// `hasOwn`, never a plain index read — `auth['constructor']` walks the prototype
|
|
51
|
+
// chain and answers truthy, and the run would die deeper with a persona of `{}`.
|
|
52
|
+
const persona = auth && Object.hasOwn(auth, as) ? auth[as] : undefined;
|
|
53
|
+
if (persona)
|
|
54
|
+
return { name: as, persona };
|
|
55
|
+
const configured = Object.keys(auth ?? {});
|
|
56
|
+
const known = configured.length > 0
|
|
57
|
+
? `configured personas: ${configured.map((k) => `'${k}'`).join(', ')}`
|
|
58
|
+
: `target '${targetName}' has no 'auth' block`;
|
|
59
|
+
throw new ConfigError(`unknown auth persona '${as}' for target '${targetName}' — ${known}. ` +
|
|
60
|
+
`Add it under targets.${targetName}.auth in .ui-debugger-mcp.json, or omit 'as' to run signed out.`);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A field key / submit label that is already a selector — used verbatim, never
|
|
64
|
+
* expanded. Deliberately narrow (a leading `.`/`#`/`[`, a `tag#id`/`tag[attr]`, an
|
|
65
|
+
* explicit engine prefix, or XPath) so an ordinary label like `Email address` or
|
|
66
|
+
* `Sign in` is never mistaken for one.
|
|
67
|
+
*/
|
|
68
|
+
const SELECTORISH = /^[.#[]|^[a-zA-Z][\w-]*[#[]|^(css|role|text|id|data-testid|xpath)=|^\/\//;
|
|
69
|
+
/** A key safe to interpolate into an `#id` / `[type=…]` selector without quoting. */
|
|
70
|
+
const IDENTIFIER = /^[a-zA-Z][\w-]*$/;
|
|
71
|
+
/**
|
|
72
|
+
* Selectors to try for a field, most specific first — `name`, then `id`/`type`,
|
|
73
|
+
* then `data-testid`, then the two label-ish attributes.
|
|
74
|
+
*
|
|
75
|
+
* Ordered candidates rather than one comma-joined list on purpose: a CSS list
|
|
76
|
+
* resolves in DOCUMENT order, so `{"password": …}` on a page with a "Forgot
|
|
77
|
+
* password?" link above the input would type the password into the link.
|
|
78
|
+
*/
|
|
79
|
+
export function fieldCandidates(key) {
|
|
80
|
+
if (SELECTORISH.test(key))
|
|
81
|
+
return [key];
|
|
82
|
+
const v = JSON.stringify(key); // quoted + escaped for an attribute value
|
|
83
|
+
const candidates = [`css=input[name=${v} i], textarea[name=${v} i]`];
|
|
84
|
+
if (IDENTIFIER.test(key)) {
|
|
85
|
+
candidates.push(`css=input#${key}, textarea#${key}`, `css=input[type="${key.toLowerCase()}" i]`);
|
|
86
|
+
}
|
|
87
|
+
candidates.push(`css=input[data-testid=${v} i], textarea[data-testid=${v} i]`, `css=input[aria-label*=${v} i], textarea[aria-label*=${v} i]`, `css=input[placeholder*=${v} i], textarea[placeholder*=${v} i]`, `role=textbox[name=${v} i]`);
|
|
88
|
+
return candidates;
|
|
89
|
+
}
|
|
90
|
+
/** Selectors to try for the submit control — the named button, then link, then plain text. */
|
|
91
|
+
export function submitCandidates(submit) {
|
|
92
|
+
if (SELECTORISH.test(submit))
|
|
93
|
+
return [submit];
|
|
94
|
+
const v = JSON.stringify(submit);
|
|
95
|
+
return [`role=button[name=${v} i]`, `role=link[name=${v} i]`, `text=${submit}`];
|
|
96
|
+
}
|
|
97
|
+
/** First candidate that resolves to a node, or `null` when none of them do. */
|
|
98
|
+
async function findFirst(adapter, candidates) {
|
|
99
|
+
for (const query of candidates) {
|
|
100
|
+
const node = await adapter.find({ query });
|
|
101
|
+
if (node)
|
|
102
|
+
return node;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
/** The active tab's URL, or `null` on a target with no tab concept (desktop/android). */
|
|
107
|
+
async function currentUrl(adapter) {
|
|
108
|
+
const tabs = await adapter.tabs?.();
|
|
109
|
+
return tabs?.find((tab) => tab.active)?.url ?? null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Sign in as `persona`, returning the {@link Step}s to splice onto the run's trail.
|
|
113
|
+
*
|
|
114
|
+
* Every failure is an {@link AuthError} that names the persona and the exact
|
|
115
|
+
* control that did not resolve, so the caller fixes the config instead of reading
|
|
116
|
+
* a run's worth of findings about a login page.
|
|
117
|
+
*/
|
|
118
|
+
export async function performLogin(adapter, options) {
|
|
119
|
+
const { name, persona, loginUrl, timeoutMs } = options;
|
|
120
|
+
const log = options.log ?? (() => undefined);
|
|
121
|
+
const budget = capWait(LOGIN_TIMEOUT_MS, timeoutMs);
|
|
122
|
+
const steps = [];
|
|
123
|
+
/** Marks every step here as the pre-run login, not something the driver chose. */
|
|
124
|
+
const note = `auth persona ${JSON.stringify(name)} — signed in before the run's first step`;
|
|
125
|
+
log(`auth: signing in as ${JSON.stringify(name)} at ${loginUrl}`);
|
|
126
|
+
await adapter.open(loginUrl, budget);
|
|
127
|
+
steps.push({ step: `open ${loginUrl}`, ok: true, note });
|
|
128
|
+
for (const [key, value] of Object.entries(persona.fields)) {
|
|
129
|
+
const node = await findFirst(adapter, fieldCandidates(key));
|
|
130
|
+
if (!node) {
|
|
131
|
+
throw new AuthError(`auth persona '${name}': no input matching field '${key}' on ${loginUrl}. ` +
|
|
132
|
+
"Rename the key to the field's name/id/type/data-testid/aria-label/placeholder, " +
|
|
133
|
+
'or use a selector as the key (e.g. "#user", "[data-testid=\'email\']").');
|
|
134
|
+
}
|
|
135
|
+
// `type` APPENDS (it focuses and types, it does not `fill`), so a browser that
|
|
136
|
+
// restored a saved value would produce a spliced credential and a failed login
|
|
137
|
+
// that looks like wrong config. Same clear-then-type as `act({clear:true})`.
|
|
138
|
+
await adapter.type(node, '');
|
|
139
|
+
await adapter.pressKey('Control+a');
|
|
140
|
+
await adapter.pressKey('Delete');
|
|
141
|
+
await adapter.type(node, value);
|
|
142
|
+
// The value is NOT written down — length is the diagnostic part.
|
|
143
|
+
steps.push({ step: `type ${value.length} chars into field "${key}"`, ok: true, note });
|
|
144
|
+
}
|
|
145
|
+
const submit = await findFirst(adapter, submitCandidates(persona.submit));
|
|
146
|
+
if (!submit) {
|
|
147
|
+
throw new AuthError(`auth persona '${name}': no button, link or text matching submit '${persona.submit}' on ${loginUrl}. ` +
|
|
148
|
+
'Use the control\'s visible label, or a selector (e.g. "button[type=submit]").');
|
|
149
|
+
}
|
|
150
|
+
await adapter.click(submit);
|
|
151
|
+
steps.push({ step: `click submit "${persona.submit}"`, ok: true, note });
|
|
152
|
+
await assertSignedIn(adapter, options, budget);
|
|
153
|
+
// Where the login LANDED, not where the run was configured to start: submitting
|
|
154
|
+
// usually redirects, so this is the page the driver's first step actually reads.
|
|
155
|
+
const landed = await currentUrl(adapter);
|
|
156
|
+
log(`auth: signed in as ${JSON.stringify(name)}${landed ? ` → ${landed}` : ''}`);
|
|
157
|
+
steps.push({ step: `signed in as "${name}"${landed ? ` → ${landed}` : ''}`, ok: true, note });
|
|
158
|
+
return steps;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Prove the login took, or fail loud. `expect` is the explicit proof; without one
|
|
162
|
+
* the run requires that submitting LEFT the login page — a real signal, and the
|
|
163
|
+
* error says how to replace it for an app that signs in without navigating.
|
|
164
|
+
*/
|
|
165
|
+
async function assertSignedIn(adapter, { name, persona, loginUrl }, budget) {
|
|
166
|
+
if (persona.expect !== undefined) {
|
|
167
|
+
try {
|
|
168
|
+
await adapter.waitFor({ query: persona.expect, timeout: budget });
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
throw new AuthError(`auth persona '${name}': submitted the form but '${persona.expect}' never appeared — ` +
|
|
172
|
+
`the credentials are probably wrong, or 'expect' names something this app does not render. ` +
|
|
173
|
+
`(${error instanceof Error ? error.message : String(error)})`);
|
|
174
|
+
}
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
await adapter.waitFor({ networkIdle: true, timeout: budget }).catch(() => undefined);
|
|
178
|
+
const after = await currentUrl(adapter);
|
|
179
|
+
if (after === null) {
|
|
180
|
+
throw new AuthError(`auth persona '${name}': this target cannot report its current location, so the login ` +
|
|
181
|
+
"cannot be verified — set 'expect' on the persona to a selector that only exists once signed in.");
|
|
182
|
+
}
|
|
183
|
+
if (samePage(after, loginUrl)) {
|
|
184
|
+
throw new AuthError(`auth persona '${name}': still on ${after} after submitting '${persona.submit}' — the login ` +
|
|
185
|
+
'did not take. Check the credentials and the field keys; if this app signs in WITHOUT ' +
|
|
186
|
+
"navigating away, set 'expect' on the persona to a selector that only exists once signed in.");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/** Same origin + same path — the query/hash a login flow adds (`?error=1`) does not make it a new page. */
|
|
190
|
+
export function samePage(a, b) {
|
|
191
|
+
try {
|
|
192
|
+
const left = new URL(a);
|
|
193
|
+
const right = new URL(b);
|
|
194
|
+
return left.origin === right.origin && left.pathname === right.pathname;
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
return a === b;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/services/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtD,+EAA+E;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C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,SAAS,CACjB,iBAAiB,IAAI,kEAAkE;YACrF,iGAAiG,CACpG,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CACjB,iBAAiB,IAAI,eAAe,KAAK,sBAAsB,OAAO,CAAC,MAAM,gBAAgB;YAC3F,uFAAuF;YACvF,6FAA6F,CAChG,CAAC;IACJ,CAAC;AACH,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,QAAQ,CAAC,CAAS,EAAE,CAAS;IAC3C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -51,6 +51,8 @@ export interface BuildSessionParams {
|
|
|
51
51
|
criteria?: string;
|
|
52
52
|
/** Per-run URL the caller points the driver at (web); overrides the target's configured url. */
|
|
53
53
|
url?: string;
|
|
54
|
+
/** Named auth persona to sign in as before the first step — a key in the target's `auth`. */
|
|
55
|
+
as?: string;
|
|
54
56
|
/**
|
|
55
57
|
* The run's remaining wall-clock budget (ms) at build time. Assembly happens inside
|
|
56
58
|
* the caller's `timeout`, so the launch/connect wait shortens to fit it.
|
|
@@ -62,7 +64,8 @@ export interface BuiltSession {
|
|
|
62
64
|
/** Ready to register with the manager; not yet opened or started. */
|
|
63
65
|
session: Session;
|
|
64
66
|
/**
|
|
65
|
-
* Navigate the adapter to the target (launches/attaches the browser page)
|
|
67
|
+
* Navigate the adapter to the target (launches/attaches the browser page), then
|
|
68
|
+
* — when `as` named a persona — sign in out-of-band, before the loop starts.
|
|
66
69
|
* `timeoutMs` is the run's budget left AFTER the build — the first navigation
|
|
67
70
|
* spends the caller's cap, never a fresh one of its own.
|
|
68
71
|
*/
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* seam; swapping the driver model or the target never touches the service.
|
|
15
15
|
*/
|
|
16
16
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
17
|
+
import { resolveTargetUrl } from '../adapters/browser/launch.js';
|
|
18
|
+
import { createSecretRedactor } from '../adapters/browser/log-format.js';
|
|
17
19
|
import { createAdapter } from '../adapters/factory.js';
|
|
18
20
|
import { createActTool } from '../agent/belt/act.js';
|
|
19
21
|
import { createLookTool, createSelfLookTool } from '../agent/belt/look.js';
|
|
@@ -27,6 +29,7 @@ import { pruneSessions, SESSION_RETENTION } from '../session/cleanup.js';
|
|
|
27
29
|
import { FindingsStore } from '../session/findings-store.js';
|
|
28
30
|
import { Session } from '../session/session.js';
|
|
29
31
|
import { ensureSession, resolveProfileDir, sessionPaths, } from '../session/workspace.js';
|
|
32
|
+
import { performLogin, resolveAuth } from './login.js';
|
|
30
33
|
import { createReplayStep } from './replay.js';
|
|
31
34
|
import { createSummarize } from './summarize.js';
|
|
32
35
|
/** Bind {@link buildSession} to its shared deps, yielding the per-run {@link SessionBuilder}. */
|
|
@@ -167,6 +170,11 @@ export async function buildSession(deps, params) {
|
|
|
167
170
|
// "The boss tells the driver where to go": a per-run `url` overrides the target's
|
|
168
171
|
// configured url. Web targets need one or the other — fail loud before any launch.
|
|
169
172
|
const targetConfig = resolveRunTarget(baseTarget, target, params.url);
|
|
173
|
+
// Before disk, before any launch: an unknown `as` must fail here, not silently
|
|
174
|
+
// run the whole goal signed out — every screen behind the login would then read
|
|
175
|
+
// as a broken UI. Resolved against the run's target so a per-run `url` override
|
|
176
|
+
// still anchors the login path.
|
|
177
|
+
const auth = resolveAuth(targetConfig, target, params.as);
|
|
170
178
|
const effectiveConfig = targetConfig === baseTarget
|
|
171
179
|
? config
|
|
172
180
|
: { ...config, targets: { ...config.targets, [target]: targetConfig } };
|
|
@@ -183,8 +191,13 @@ export async function buildSession(deps, params) {
|
|
|
183
191
|
const origin = runOrigin(targetConfig);
|
|
184
192
|
await writeFile(paths.storyMd, renderStoryMd(target, address, goal, criteriaLines), 'utf8');
|
|
185
193
|
const store = new FindingsStore(paths);
|
|
194
|
+
// Bound once, applied to EVERY durable log line this run writes. A persona's
|
|
195
|
+
// values are typed into the app, so they come back at us through the form POST
|
|
196
|
+
// in `network.log` and through anything an adapter error quotes — the same
|
|
197
|
+
// posture `log-format.ts` already holds for credential headers and `?token=`.
|
|
198
|
+
const redact = createSecretRedactor(auth ? Object.values(auth.persona.fields) : []);
|
|
186
199
|
const onLog = (channel, line) => {
|
|
187
|
-
void store.appendLog(channel, line).catch(() => undefined);
|
|
200
|
+
void store.appendLog(channel, redact(line)).catch(() => undefined);
|
|
188
201
|
};
|
|
189
202
|
// `profile` is a browser-target key — no other adapter has a profile dir. A managed
|
|
190
203
|
// launch lives in it; attach ignores it (that browser keeps its own state).
|
|
@@ -204,8 +217,10 @@ export async function buildSession(deps, params) {
|
|
|
204
217
|
criteria: criteriaLines,
|
|
205
218
|
selfLook,
|
|
206
219
|
address: origin ? address : undefined,
|
|
220
|
+
// Name + path only — never the field values. The prompt is resent every step.
|
|
221
|
+
...(auth && { auth: { persona: auth.name, loginPath: auth.persona.path } }),
|
|
207
222
|
});
|
|
208
|
-
const appendAgentLog = (line) => store.appendLog('agent', `${new Date().toISOString()} ${line}`);
|
|
223
|
+
const appendAgentLog = (line) => store.appendLog('agent', redact(`${new Date().toISOString()} ${line}`));
|
|
209
224
|
// High-frequency, fire-and-forget: the agent's own log sink + per-step tool logs.
|
|
210
225
|
const logAgent = (line) => {
|
|
211
226
|
void appendAgentLog(line).catch(() => undefined);
|
|
@@ -221,14 +236,18 @@ export async function buildSession(deps, params) {
|
|
|
221
236
|
// best-effort: logging must never break or mask the run
|
|
222
237
|
}
|
|
223
238
|
};
|
|
239
|
+
// One trail per run, shared between the `act` tool (which records every step as
|
|
240
|
+
// it finishes, `ok: false` included), the loop (which snapshots it into each
|
|
241
|
+
// running flush) and the `report` tool (which merges it with the driver's
|
|
242
|
+
// reported steps), so the persisted findings and the returned counts derive from
|
|
243
|
+
// the same object. `report` reads it through `settled()`, so an act racing it in
|
|
244
|
+
// the SAME step still makes the verdict.
|
|
245
|
+
//
|
|
246
|
+
// Built HERE rather than inside `run` because the pre-run login (`open`, below)
|
|
247
|
+
// happens first and has to land on the same trail: the driver did not do it, but
|
|
248
|
+
// it did happen to the app, and a trail that omits it is a lie about the run.
|
|
249
|
+
const trail = createActTrail();
|
|
224
250
|
const run = async ({ inbox, progress, signal }) => {
|
|
225
|
-
// One trail per run, shared between the `act` tool (which records every step as
|
|
226
|
-
// it finishes, `ok: false` included), the loop (which snapshots it into each
|
|
227
|
-
// running flush) and the `report` tool (which merges it with the driver's
|
|
228
|
-
// reported steps), so the persisted findings and the returned counts derive from
|
|
229
|
-
// the same object. `report` reads it through `settled()`, so an act racing it in
|
|
230
|
-
// the SAME step still makes the verdict.
|
|
231
|
-
const trail = createActTrail();
|
|
232
251
|
const agent = createDebugAgent({
|
|
233
252
|
model: models.driver,
|
|
234
253
|
tools: {
|
|
@@ -278,8 +297,28 @@ export async function buildSession(deps, params) {
|
|
|
278
297
|
});
|
|
279
298
|
return {
|
|
280
299
|
session,
|
|
281
|
-
open: (timeoutMs) =>
|
|
300
|
+
open: async (timeoutMs) => {
|
|
301
|
+
await adapter.open(openAddress(targetConfig), timeoutMs);
|
|
302
|
+
if (!auth)
|
|
303
|
+
return;
|
|
304
|
+
// Out-of-band and BEFORE the loop: the driver never sees the credentials, and
|
|
305
|
+
// a login that cannot complete fails `start_debug` outright instead of handing
|
|
306
|
+
// back a run that will report every screen behind it as empty. See `login.ts`.
|
|
307
|
+
const steps = await signIn(adapter, auth, targetConfig, logAgent, timeoutMs);
|
|
308
|
+
for (const step of steps)
|
|
309
|
+
trail.record(step);
|
|
310
|
+
},
|
|
282
311
|
run,
|
|
283
312
|
};
|
|
284
313
|
}
|
|
314
|
+
/** Run the persona's login against the opened target, anchoring `path` to the run's url. */
|
|
315
|
+
function signIn(adapter, auth, target, log, timeoutMs) {
|
|
316
|
+
const base = target.adapter === 'browser' ? target.url : undefined;
|
|
317
|
+
return performLogin(adapter, {
|
|
318
|
+
...auth,
|
|
319
|
+
loginUrl: resolveTargetUrl(auth.persona.path, base),
|
|
320
|
+
timeoutMs,
|
|
321
|
+
log,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
285
324
|
//# sourceMappingURL=session-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-builder.js","sourceRoot":"","sources":["../../src/services/session-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAmB,MAAM,6BAA6B,CAAC;AAGnF,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"session-builder.js","sourceRoot":"","sources":["../../src/services/session-builder.ts"],"names":[],"mappings":"AAAA;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AED,4FAA4F;AAC5F,SAAS,MAAM,CACb,OAAgB,EAChB,IAAkB,EAClB,MAAc,EACd,GAA2B,EAC3B,SAAkB;IAElB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,OAAO,YAAY,CAAC,OAAO,EAAE;QAC3B,GAAG,IAAI;QACP,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;QACnD,SAAS;QACT,GAAG;KACJ,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developerz.ai/ui-debugger-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Autonomous UI debugging MCP server. Give a goal; a fast agent drives the browser/desktop, finds bugs + visual issues, and reports back.",
|
|
5
5
|
"mcpName": "io.github.developerz-ai/ui-debugger-mcp",
|
|
6
6
|
"license": "MIT",
|