@developerz.ai/ui-debugger-mcp 1.10.0 → 1.11.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.
Files changed (178) hide show
  1. package/README.md +9 -5
  2. package/dist/adapters/android/abortable.d.ts +6 -0
  3. package/dist/adapters/android/abortable.js +22 -0
  4. package/dist/adapters/android/abortable.js.map +1 -0
  5. package/dist/adapters/android/android-adapter.d.ts +7 -39
  6. package/dist/adapters/android/android-adapter.js +54 -436
  7. package/dist/adapters/android/android-adapter.js.map +1 -1
  8. package/dist/adapters/android/commands.d.ts +10 -0
  9. package/dist/adapters/android/commands.js +22 -0
  10. package/dist/adapters/android/commands.js.map +1 -1
  11. package/dist/adapters/android/emulator.d.ts +41 -0
  12. package/dist/adapters/android/emulator.js +115 -0
  13. package/dist/adapters/android/emulator.js.map +1 -0
  14. package/dist/adapters/android/logcat.d.ts +87 -0
  15. package/dist/adapters/android/logcat.js +352 -0
  16. package/dist/adapters/android/logcat.js.map +1 -0
  17. package/dist/adapters/browser/browser-adapter.js +30 -42
  18. package/dist/adapters/browser/browser-adapter.js.map +1 -1
  19. package/dist/adapters/browser/cdp.d.ts +7 -10
  20. package/dist/adapters/browser/cdp.js +93 -69
  21. package/dist/adapters/browser/cdp.js.map +1 -1
  22. package/dist/adapters/browser/exchange-read.d.ts +39 -0
  23. package/dist/adapters/browser/exchange-read.js +102 -0
  24. package/dist/adapters/browser/exchange-read.js.map +1 -0
  25. package/dist/adapters/browser/extractor.js +9 -2
  26. package/dist/adapters/browser/extractor.js.map +1 -1
  27. package/dist/adapters/browser/lifecycle.d.ts +33 -0
  28. package/dist/adapters/browser/lifecycle.js +47 -4
  29. package/dist/adapters/browser/lifecycle.js.map +1 -1
  30. package/dist/adapters/browser/locate.d.ts +18 -2
  31. package/dist/adapters/browser/locate.js +48 -3
  32. package/dist/adapters/browser/locate.js.map +1 -1
  33. package/dist/adapters/browser/log-filters.d.ts +1 -1
  34. package/dist/adapters/browser/log-filters.js +15 -4
  35. package/dist/adapters/browser/log-filters.js.map +1 -1
  36. package/dist/adapters/browser/log-format.d.ts +12 -0
  37. package/dist/adapters/browser/log-format.js +123 -7
  38. package/dist/adapters/browser/log-format.js.map +1 -1
  39. package/dist/adapters/contract.d.ts +22 -5
  40. package/dist/adapters/desktop/atspi-busctl.js +3 -1
  41. package/dist/adapters/desktop/atspi-busctl.js.map +1 -1
  42. package/dist/adapters/desktop/atspi.d.ts +6 -0
  43. package/dist/adapters/desktop/atspi.js.map +1 -1
  44. package/dist/adapters/desktop/desktop-adapter.d.ts +2 -0
  45. package/dist/adapters/desktop/desktop-adapter.js +132 -98
  46. package/dist/adapters/desktop/desktop-adapter.js.map +1 -1
  47. package/dist/adapters/desktop/input.d.ts +1 -1
  48. package/dist/adapters/desktop/input.js +14 -3
  49. package/dist/adapters/desktop/input.js.map +1 -1
  50. package/dist/adapters/desktop/managed-app.d.ts +43 -0
  51. package/dist/adapters/desktop/managed-app.js +114 -0
  52. package/dist/adapters/desktop/managed-app.js.map +1 -0
  53. package/dist/adapters/desktop/proc.d.ts +2 -0
  54. package/dist/adapters/desktop/proc.js +4 -0
  55. package/dist/adapters/desktop/proc.js.map +1 -1
  56. package/dist/adapters/desktop/wait-poll.d.ts +17 -0
  57. package/dist/adapters/desktop/wait-poll.js +38 -0
  58. package/dist/adapters/desktop/wait-poll.js.map +1 -0
  59. package/dist/adapters/factory.d.ts +1 -1
  60. package/dist/adapters/factory.js +1 -1
  61. package/dist/adapters/log-format.d.ts +6 -0
  62. package/dist/adapters/log-format.js +10 -2
  63. package/dist/adapters/log-format.js.map +1 -1
  64. package/dist/agent/belt/act.d.ts +6 -3
  65. package/dist/agent/belt/act.js +40 -60
  66. package/dist/agent/belt/act.js.map +1 -1
  67. package/dist/agent/belt/look.d.ts +9 -3
  68. package/dist/agent/belt/look.js +21 -5
  69. package/dist/agent/belt/look.js.map +1 -1
  70. package/dist/agent/belt/observe.d.ts +9 -43
  71. package/dist/agent/belt/observe.js +66 -242
  72. package/dist/agent/belt/observe.js.map +1 -1
  73. package/dist/agent/belt/redact-output.d.ts +20 -0
  74. package/dist/agent/belt/redact-output.js +70 -0
  75. package/dist/agent/belt/redact-output.js.map +1 -0
  76. package/dist/agent/belt/same-origin.d.ts +21 -0
  77. package/dist/agent/belt/same-origin.js +38 -0
  78. package/dist/agent/belt/same-origin.js.map +1 -0
  79. package/dist/agent/belt/target-refs.d.ts +39 -0
  80. package/dist/agent/belt/target-refs.js +60 -0
  81. package/dist/agent/belt/target-refs.js.map +1 -0
  82. package/dist/agent/belt/tree-targets.d.ts +79 -0
  83. package/dist/agent/belt/tree-targets.js +242 -0
  84. package/dist/agent/belt/tree-targets.js.map +1 -0
  85. package/dist/agent/loop-frames.d.ts +26 -0
  86. package/dist/agent/loop-frames.js +106 -0
  87. package/dist/agent/loop-frames.js.map +1 -0
  88. package/dist/agent/loop.d.ts +13 -24
  89. package/dist/agent/loop.js +40 -104
  90. package/dist/agent/loop.js.map +1 -1
  91. package/dist/agent/prompts/debug-agent.js +3 -2
  92. package/dist/agent/prompts/debug-agent.js.map +1 -1
  93. package/dist/agent/prompts/web-addendum.d.ts +2 -2
  94. package/dist/agent/prompts/web-addendum.js +21 -32
  95. package/dist/agent/prompts/web-addendum.js.map +1 -1
  96. package/dist/agent/provider.d.ts +3 -1
  97. package/dist/agent/provider.js +4 -2
  98. package/dist/agent/provider.js.map +1 -1
  99. package/dist/boot.js +3 -1
  100. package/dist/boot.js.map +1 -1
  101. package/dist/cli/chromium-libs.d.ts +6 -1
  102. package/dist/cli/chromium-libs.js +27 -3
  103. package/dist/cli/chromium-libs.js.map +1 -1
  104. package/dist/cli/control.js +30 -5
  105. package/dist/cli/control.js.map +1 -1
  106. package/dist/config/load.js +10 -0
  107. package/dist/config/load.js.map +1 -1
  108. package/dist/config/schema.js +12 -10
  109. package/dist/config/schema.js.map +1 -1
  110. package/dist/errors.d.ts +17 -16
  111. package/dist/errors.js +33 -32
  112. package/dist/errors.js.map +1 -1
  113. package/dist/index.d.ts +1 -1
  114. package/dist/index.js +1 -1
  115. package/dist/mcp/server.js +10 -1
  116. package/dist/mcp/server.js.map +1 -1
  117. package/dist/mcp/tools/end-session.js +2 -1
  118. package/dist/mcp/tools/end-session.js.map +1 -1
  119. package/dist/mcp/tools/output.d.ts +7 -0
  120. package/dist/mcp/tools/output.js +5 -0
  121. package/dist/mcp/tools/output.js.map +1 -1
  122. package/dist/mcp/tools/result.js +4 -1
  123. package/dist/mcp/tools/result.js.map +1 -1
  124. package/dist/redact.d.ts +20 -4
  125. package/dist/redact.js +134 -19
  126. package/dist/redact.js.map +1 -1
  127. package/dist/services/auth-persona.d.ts +19 -0
  128. package/dist/services/auth-persona.js +32 -0
  129. package/dist/services/auth-persona.js.map +1 -0
  130. package/dist/services/debug-api.d.ts +7 -0
  131. package/dist/services/debug-service.d.ts +1 -1
  132. package/dist/services/debug-service.js +64 -65
  133. package/dist/services/debug-service.js.map +1 -1
  134. package/dist/services/foreign-findings.d.ts +22 -0
  135. package/dist/services/foreign-findings.js +38 -0
  136. package/dist/services/foreign-findings.js.map +1 -0
  137. package/dist/services/login-failure.d.ts +10 -0
  138. package/dist/services/login-failure.js +24 -0
  139. package/dist/services/login-failure.js.map +1 -0
  140. package/dist/services/login-selectors.d.ts +18 -0
  141. package/dist/services/login-selectors.js +44 -0
  142. package/dist/services/login-selectors.js.map +1 -0
  143. package/dist/services/login-session.d.ts +25 -0
  144. package/dist/services/login-session.js +59 -0
  145. package/dist/services/login-session.js.map +1 -0
  146. package/dist/services/login.d.ts +9 -27
  147. package/dist/services/login.js +78 -80
  148. package/dist/services/login.js.map +1 -1
  149. package/dist/services/replay.js +15 -3
  150. package/dist/services/replay.js.map +1 -1
  151. package/dist/services/session-builder.js +19 -4
  152. package/dist/services/session-builder.js.map +1 -1
  153. package/dist/services/shutdown.d.ts +8 -4
  154. package/dist/services/shutdown.js +21 -8
  155. package/dist/services/shutdown.js.map +1 -1
  156. package/dist/services/start-guards.d.ts +6 -1
  157. package/dist/services/start-guards.js +13 -2
  158. package/dist/services/start-guards.js.map +1 -1
  159. package/dist/session/cleanup.d.ts +3 -2
  160. package/dist/session/cleanup.js +6 -2
  161. package/dist/session/cleanup.js.map +1 -1
  162. package/dist/session/finalize.d.ts +45 -0
  163. package/dist/session/finalize.js +150 -0
  164. package/dist/session/finalize.js.map +1 -0
  165. package/dist/session/flock-backend.d.ts +117 -0
  166. package/dist/session/flock-backend.js +293 -0
  167. package/dist/session/flock-backend.js.map +1 -0
  168. package/dist/session/owner-lock.d.ts +4 -95
  169. package/dist/session/owner-lock.js +7 -288
  170. package/dist/session/owner-lock.js.map +1 -1
  171. package/dist/session/session.js +11 -134
  172. package/dist/session/session.js.map +1 -1
  173. package/dist/session/state-file.js +9 -1
  174. package/dist/session/state-file.js.map +1 -1
  175. package/dist/session/workspace.d.ts +32 -2
  176. package/dist/session/workspace.js +65 -4
  177. package/dist/session/workspace.js.map +1 -1
  178. package/package.json +8 -8
@@ -32,7 +32,7 @@
32
32
  * projection in `catalog.ts`, the retained snapshot in `retained-snapshot.ts`
33
33
  * and the start-time refusals in `start-guards.ts`.
34
34
  */
35
- import { type Findings } from '../findings/schema.js';
35
+ import type { Findings } from '../findings/schema.js';
36
36
  import type { Ack, DebugApi, DebugServiceDeps, DescribeInput, DescribeResult, EndInput, GetFindingsInput, SendInput, StartInput, StartResult } from './debug-api.js';
37
37
  export type { Ack, DebugApi, DebugServiceDeps, DescribeInput, DescribeResult, EndInput, GetFindingsInput, RunInfo, SendInput, StartInput, StartResult, TargetInfo, } from './debug-api.js';
38
38
  /** Default wall-clock cap on a debug run before it auto-ends (overridable per run). */
@@ -33,27 +33,14 @@
33
33
  * and the start-time refusals in `start-guards.ts`.
34
34
  */
35
35
  import { SessionBusyError, SessionNotFoundError, SessionSettledError } from '../errors.js';
36
- import { FindingsSchema } from '../findings/schema.js';
37
36
  import { noopStatePort } from '../session/state-file.js';
38
- import { generateSessionId, workspacePaths } from '../session/workspace.js';
37
+ import { allocateSessionId, workspacePaths } from '../session/workspace.js';
39
38
  import { selectTargets } from './catalog.js';
39
+ import { foreignSnapshot, projectFindings } from './foreign-findings.js';
40
40
  import { RetainedSnapshot } from './retained-snapshot.js';
41
- import { assertConfigFresh, assertNoForeignRun } from './start-guards.js';
41
+ import { assertConfigFresh, assertNoForeignRun, assertStartNotAborted } from './start-guards.js';
42
42
  /** Default wall-clock cap on a debug run before it auto-ends (overridable per run). */
43
43
  export const DEFAULT_SESSION_TIMEOUT_MS = 300_000;
44
- /**
45
- * Narrow a findings object to the requested keys — the `fields` projection for a
46
- * snapshot read off disk (a live {@link Session} projects its own).
47
- */
48
- function projectFindings(findings, fields) {
49
- const out = {};
50
- for (const field of fields) {
51
- // Assigning key-by-key off a validated object; the index signature is what
52
- // makes this need the cast, not any doubt about the value's type.
53
- out[field] = findings[field];
54
- }
55
- return out;
56
- }
57
44
  export class DebugService {
58
45
  #manager;
59
46
  #config;
@@ -82,6 +69,13 @@ export class DebugService {
82
69
  * *and wait for it*, instead of exiting with a half-launched Chrome on the lock.
83
70
  */
84
71
  #starting;
72
+ /**
73
+ * The run the last `end_session` closed, with its teardown — what makes a REPEAT
74
+ * of that call a no-op that still waits for (and fails with) the first one.
75
+ */
76
+ #ended;
77
+ /** The teardown in flight (or the last one, settled) — a barrier, so it never rejects. */
78
+ #tearing = Promise.resolve();
85
79
  constructor(deps) {
86
80
  this.#manager = deps.manager;
87
81
  this.#config = deps.config;
@@ -175,7 +169,10 @@ export class DebugService {
175
169
  // takeover's `clear()` cannot wipe the record of the run replacing it.
176
170
  if (replace === true)
177
171
  await this.#takeOverActive();
178
- const id = generateSessionId(this.#now());
172
+ // Skips an id whose session dir already exists: a server restarted within the
173
+ // same second restarts its counter too, and the session create is exclusive.
174
+ const workspace = workspacePaths(cwd, this.#config.workspace);
175
+ const id = await allocateSessionId(workspace, this.#now());
179
176
  // The breadcrumb goes down BEFORE the launch: a cold Chrome start takes 5-20s,
180
177
  // and until `state.json` exists the run is invisible out-of-band — `status`
181
178
  // prints "no debug run recorded" and `stop` never signals, while a real browser
@@ -187,7 +184,7 @@ export class DebugService {
187
184
  // pid and session), so the loser never hides the winner's live run.
188
185
  await this.#state.record({ sessionId: id, target, goal });
189
186
  try {
190
- this.#assertStartNotAborted(signal, id);
187
+ assertStartNotAborted(signal, id);
191
188
  const built = await this.#build({
192
189
  id,
193
190
  target,
@@ -198,7 +195,7 @@ export class DebugService {
198
195
  timeoutMs: remaining(),
199
196
  });
200
197
  try {
201
- this.#assertStartNotAborted(signal, id);
198
+ assertStartNotAborted(signal, id);
202
199
  this.#manager.start(cwd, built.session);
203
200
  }
204
201
  catch (err) {
@@ -210,7 +207,7 @@ export class DebugService {
210
207
  this.#retained.clear();
211
208
  try {
212
209
  await built.open(remaining());
213
- this.#assertStartNotAborted(signal, id);
210
+ assertStartNotAborted(signal, id);
214
211
  built.session.start(built.run);
215
212
  }
216
213
  catch (err) {
@@ -230,17 +227,6 @@ export class DebugService {
230
227
  throw err;
231
228
  }
232
229
  }
233
- /**
234
- * Stop a start that the shutdown path has cancelled (SIGTERM, a CLI `stop`, the
235
- * MCP client dying). The caller tears down whatever it had already built.
236
- */
237
- #assertStartNotAborted(signal, id) {
238
- if (!signal.aborted)
239
- return;
240
- throw new SessionSettledError(`Debug run '${id}' was torn down while it was still starting — this ui-debugger-mcp server ` +
241
- 'is shutting down (SIGTERM, `ui-debugger-mcp stop`, or the MCP client disconnected). ' +
242
- 'Nothing was left running; start again once the server is back.');
243
- }
244
230
  /**
245
231
  * `replace: true` — end the run this server holds so the new one can have it.
246
232
  * No-op when nothing is active: replacing nothing is just a start.
@@ -265,7 +251,9 @@ export class DebugService {
265
251
  this.#clearTimeout();
266
252
  this.#timer = setTimeout(() => {
267
253
  this.#timer = undefined;
268
- void this.endActive().catch(() => undefined);
254
+ // Ends the run it was armed for, and ONLY that: `endActive` would also abort
255
+ // a `replace:true` start in flight, failing it as "server is shutting down".
256
+ void this.#endRetaining().catch(() => undefined);
269
257
  }, ms);
270
258
  }
271
259
  /** Cancel the active run's wall-clock timer, if any. */
@@ -281,7 +269,8 @@ export class DebugService {
281
269
  * drains the inbox, so an ack then would drop the message.
282
270
  */
283
271
  send({ session_id, message }) {
284
- const session = this.#require(session_id);
272
+ // Readable, not just active: an auto-ended run answers "settled", not "no such session".
273
+ const session = this.#requireReadable(session_id);
285
274
  if (session.status !== 'running') {
286
275
  throw new SessionSettledError(`Debug run '${session_id}' has already settled ('${session.status}') — the driver is no ` +
287
276
  'longer listening. Read its results with get_findings, or start a new run with start_debug.');
@@ -303,24 +292,13 @@ export class DebugService {
303
292
  // Our own memory has no such run — but another live server on this project
304
293
  // might, and `start_debug` has already named that session to this caller.
305
294
  // Answering "no such session" there is a contradiction; serve what it flushed.
306
- const foreign = await this.#foreignSnapshot(session_id);
295
+ const foreign = await foreignSnapshot(this.#state, session_id, error);
307
296
  if (foreign)
308
297
  return fields ? projectFindings(foreign, fields) : foreign;
309
298
  throw error;
310
299
  }
311
300
  return fields ? session.snapshot(fields, wait) : session.snapshot(undefined, wait);
312
301
  }
313
- /**
314
- * A foreign run's findings as last flushed to disk, or `null` if this id names no
315
- * such run — we do not own that run, so there is nothing to long-poll.
316
- */
317
- async #foreignSnapshot(session_id) {
318
- const raw = await this.#state.foreignFindings(session_id);
319
- if (raw === null)
320
- return null;
321
- const parsed = FindingsSchema.safeParse(raw);
322
- return parsed.success ? parsed.data : null;
323
- }
324
302
  /** List configured targets (the whole catalog, or one when named) plus resolved models/workspace. */
325
303
  describe({ target }) {
326
304
  const targets = selectTargets(this.#config.targets, target, this.#platform);
@@ -356,23 +334,44 @@ export class DebugService {
356
334
  * retained snapshot, so `end_session` stays the one explicit forget.
357
335
  */
358
336
  async end({ session_id }) {
359
- if (this.#forgetRetained(session_id))
337
+ const retained = this.#retained.peek();
338
+ if (retained !== undefined && this.#forgetRetained(session_id)) {
339
+ this.#ended = { session: retained, done: Promise.resolve() };
360
340
  return { ok: true, session_id };
361
- this.#require(session_id);
362
- this.#clearTimeout();
363
- try {
364
- await this.#manager.end(this.#cwd);
365
341
  }
366
- finally {
367
- // Clear the breadcrumb even when the close throws: the manager frees the slot
368
- // before closing, so a stale `running` state.json would make a later CLI
369
- // `stop` SIGTERM a healthy server. The close error still propagates. Scoped
370
- // to `session_id` — `#require` verified it — so a successor that records
371
- // itself while this teardown is in flight is untouched.
372
- await this.#state.clear(session_id);
342
+ // Idempotent: a repeat for the run it just ended succeeds and says so — once that
343
+ // teardown SETTLED (final status; its close error too). Other unknown ids fail loud.
344
+ const ended = this.#ended;
345
+ if (ended?.session.id === session_id) {
346
+ await ended.done;
347
+ return { ok: true, session_id, already_ended: { status: ended.session.status } };
373
348
  }
349
+ const session = this.#require(session_id);
350
+ this.#clearTimeout();
351
+ const done = this.#teardown(session_id);
352
+ this.#ended = { session, done };
353
+ await done;
374
354
  return { ok: true, session_id };
375
355
  }
356
+ /**
357
+ * Close the active run, then drop its breadcrumb — even when the close throws.
358
+ * The ONE teardown, for every way a run ends, so {@link endActive} can wait on it.
359
+ */
360
+ #teardown(session_id) {
361
+ const done = (async () => {
362
+ try {
363
+ await this.#manager.end(this.#cwd);
364
+ }
365
+ finally {
366
+ // The manager frees the slot before closing, so a stale `running` state.json
367
+ // would make a later CLI `stop` SIGTERM a healthy server. Scoped to
368
+ // `session_id`: a successor recording itself mid-teardown is untouched.
369
+ await this.#state.clear(session_id);
370
+ }
371
+ })();
372
+ this.#tearing = done.catch(() => undefined);
373
+ return done;
374
+ }
376
375
  /**
377
376
  * End whatever run is active for this cwd, if any — the graceful-shutdown path
378
377
  * for a SIGTERM/SIGINT, a CLI `stop`, or the wall-clock timeout firing.
@@ -387,6 +386,13 @@ export class DebugService {
387
386
  starting.controller.abort();
388
387
  await starting.settled;
389
388
  }
389
+ // Slot-free is not torn-down: a timeout or `end_session` teardown in flight has
390
+ // emptied the manager, and shutdown must not exit before that close has settled.
391
+ await this.#tearing;
392
+ await this.#endRetaining();
393
+ }
394
+ /** End the active run (if any) nobody asked to end, keeping it readable. */
395
+ async #endRetaining() {
390
396
  if (!this.#manager.has(this.#cwd))
391
397
  return;
392
398
  // Nobody asked for this end, so nobody has read the results yet: retain the
@@ -394,14 +400,7 @@ export class DebugService {
394
400
  // before the close, so a failing teardown leaves them reachable anyway.
395
401
  const ending = this.#manager.get(this.#cwd);
396
402
  this.#retained.retain(ending);
397
- // Same contract as `end()`: the breadcrumb clears even when the close throws —
398
- // scoped to the run being ENDED, never a successor's.
399
- try {
400
- await this.#manager.end(this.#cwd);
401
- }
402
- finally {
403
- await this.#state.clear(ending.id);
404
- }
403
+ await this.#teardown(ending.id);
405
404
  }
406
405
  /**
407
406
  * Resolve the session a read names: the active run, or — once the manager is
@@ -1 +1 @@
1
- {"version":3,"file":"debug-service.js","sourceRoot":"","sources":["../../src/services/debug-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAiB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAkB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAc7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAkB1E,uFAAuF;AACvF,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAElD;;;GAGG;AACH,SAAS,eAAe,CAAC,QAAkB,EAAE,MAAgC;IAC3E,MAAM,GAAG,GAAsB,EAAE,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;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,MAAM,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,UAAkB;QACjC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACxE,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,UAAkB;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED,sFAAsF;IACtF,QAAQ,CAAC,UAAkB;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,OAAO,CAAC,EAAE,KAAK,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,oBAAoB,CAC5B,4BAA4B,UAAU,UAAU,IAAI,CAAC,IAAI,yBAAyB,OAAO,CAAC,EAAE,KAAK,CAClG,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Findings of a run ANOTHER live server holds on this project, read off disk.
3
+ *
4
+ * `start_debug` names that run in its refusal, so `get_findings` answering "no
5
+ * such session" for the same id would be a contradiction — it serves what the
6
+ * owner last flushed instead. Split out of `debug-service.ts` (500-LOC cap).
7
+ */
8
+ import { type Findings } from '../findings/schema.js';
9
+ import type { SnapshotField } from '../session/session.js';
10
+ import type { StatePort } from '../session/state-file.js';
11
+ /** The `fields` projection for a snapshot read off disk (a live `Session` projects its own). */
12
+ export declare function projectFindings(findings: Findings, fields: readonly SnapshotField[]): Partial<Findings>;
13
+ /**
14
+ * A foreign run's findings as last flushed to disk, or `null` if `sessionId` names
15
+ * no such run — we do not own it, so there is nothing to long-poll.
16
+ *
17
+ * `notFound` is the miss this lookup is the fallback for. A lookup that itself
18
+ * FAILS must not replace it: the caller asked about a session, and "EACCES on
19
+ * state.json" alone does not say theirs was not found. Both are surfaced — the
20
+ * original message, the lookup failure appended and chained as `cause`.
21
+ */
22
+ export declare function foreignSnapshot(state: StatePort, sessionId: string, notFound: unknown): Promise<Findings | null>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Findings of a run ANOTHER live server holds on this project, read off disk.
3
+ *
4
+ * `start_debug` names that run in its refusal, so `get_findings` answering "no
5
+ * such session" for the same id would be a contradiction — it serves what the
6
+ * owner last flushed instead. Split out of `debug-service.ts` (500-LOC cap).
7
+ */
8
+ import { SessionNotFoundError } from '../errors.js';
9
+ import { FindingsSchema } from '../findings/schema.js';
10
+ /** The `fields` projection for a snapshot read off disk (a live `Session` projects its own). */
11
+ export function projectFindings(findings, fields) {
12
+ return Object.fromEntries(fields.filter((field) => field in findings).map((field) => [field, findings[field]]));
13
+ }
14
+ /**
15
+ * A foreign run's findings as last flushed to disk, or `null` if `sessionId` names
16
+ * no such run — we do not own it, so there is nothing to long-poll.
17
+ *
18
+ * `notFound` is the miss this lookup is the fallback for. A lookup that itself
19
+ * FAILS must not replace it: the caller asked about a session, and "EACCES on
20
+ * state.json" alone does not say theirs was not found. Both are surfaced — the
21
+ * original message, the lookup failure appended and chained as `cause`.
22
+ */
23
+ export async function foreignSnapshot(state, sessionId, notFound) {
24
+ let raw;
25
+ try {
26
+ raw = await state.foreignFindings(sessionId);
27
+ }
28
+ catch (lookup) {
29
+ const reason = (error) => (error instanceof Error ? error.message : String(error));
30
+ throw new SessionNotFoundError(`${reason(notFound)} Checking whether another ui-debugger-mcp server holds it failed too: ` +
31
+ `${reason(lookup)}`, { cause: lookup });
32
+ }
33
+ if (raw === null)
34
+ return null;
35
+ const parsed = FindingsSchema.safeParse(raw);
36
+ return parsed.success ? parsed.data : null;
37
+ }
38
+ //# sourceMappingURL=foreign-findings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-findings.js","sourceRoot":"","sources":["../../src/services/foreign-findings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAiB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAItE,gGAAgG;AAChG,MAAM,UAAU,eAAe,CAC7B,QAAkB,EAClB,MAAgC;IAEhC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAU,CAAC,CACzE,CAAC;AACzB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,KAAgB,EAChB,SAAiB,EACjB,QAAiB;IAEjB,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5F,MAAM,IAAI,oBAAoB,CAC5B,GAAG,MAAM,CAAC,QAAQ,CAAC,wEAAwE;YACzF,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EACrB,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Redacting the pre-run login's failure — split out of `login.ts` (500-LOC cap).
3
+ */
4
+ import type { Redactor } from '../redact.js';
5
+ /**
6
+ * A login failure with the run's secrets masked out of its message — it IS the
7
+ * `start_debug` result, past every log sink. Keeps the class and `name` of the
8
+ * error it replaces; the original is never chained as `cause` (it holds the secret).
9
+ */
10
+ export declare function redactFailure(error: unknown, redact: Redactor): unknown;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Redacting the pre-run login's failure — split out of `login.ts` (500-LOC cap).
3
+ */
4
+ import { AuthError, UiDebuggerError } from '../errors.js';
5
+ /**
6
+ * A login failure with the run's secrets masked out of its message — it IS the
7
+ * `start_debug` result, past every log sink. Keeps the class and `name` of the
8
+ * error it replaces; the original is never chained as `cause` (it holds the secret).
9
+ */
10
+ export function redactFailure(error, redact) {
11
+ const message = error instanceof Error ? error.message : String(error);
12
+ const clean = redact(message);
13
+ if (clean === message)
14
+ return error;
15
+ if (!(error instanceof UiDebuggerError)) {
16
+ const replaced = new AuthError(clean);
17
+ if (error instanceof Error)
18
+ replaced.name = error.name;
19
+ return replaced;
20
+ }
21
+ // Every `UiDebuggerError` subclass takes `(message, options?)` and names itself.
22
+ return new error.constructor(clean);
23
+ }
24
+ //# sourceMappingURL=login-failure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-failure.js","sourceRoot":"","sources":["../../src/services/login-failure.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG1D;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,MAAgB;IAC5D,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,KAAK,YAAY,KAAK;YAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iFAAiF;IACjF,OAAO,IAAK,KAAK,CAAC,WAAwD,CAAC,KAAK,CAAC,CAAC;AACpF,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Selector candidates for a persona's `fields` keys and `submit` label — the
3
+ * pure half of the pre-run login (`login.ts`): a config string in, the ordered
4
+ * selectors to try out. Split out to keep `login.ts` under the 500-LOC cap.
5
+ */
6
+ /**
7
+ * Selectors to try for a field, most specific first — `name`, then `id`/`type`,
8
+ * then `data-testid`, then the two label-ish attributes.
9
+ *
10
+ * Ordered candidates rather than one comma-joined list on purpose: a CSS list
11
+ * resolves in DOCUMENT order, so `{"password": …}` on a page with a "Forgot
12
+ * password?" link above the input would type the password into the link.
13
+ */
14
+ export declare function fieldCandidates(key: string): string[];
15
+ /** Selectors to try for the submit control — the named button, then link, then plain text. */
16
+ export declare function submitCandidates(submit: string): string[];
17
+ /** How to fix a field key that matched nothing. */
18
+ export declare const FIELD_KEY_HINT: string;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Selector candidates for a persona's `fields` keys and `submit` label — the
3
+ * pure half of the pre-run login (`login.ts`): a config string in, the ordered
4
+ * selectors to try out. Split out to keep `login.ts` under the 500-LOC cap.
5
+ */
6
+ /**
7
+ * A field key / submit label that is already a selector — used verbatim, never
8
+ * expanded. Deliberately narrow (a leading `.`/`#`/`[`, a `tag#id`/`tag[attr]`, an
9
+ * explicit engine prefix, or XPath) so an ordinary label like `Email address` or
10
+ * `Sign in` is never mistaken for one.
11
+ */
12
+ const SELECTORISH = /^[.#[]|^[a-zA-Z][\w-]*[#[]|^(css|role|text|id|data-testid|xpath)=|^\/\//;
13
+ /** A key safe to interpolate into an `#id` / `[type=…]` selector without quoting. */
14
+ const IDENTIFIER = /^[a-zA-Z][\w-]*$/;
15
+ /**
16
+ * Selectors to try for a field, most specific first — `name`, then `id`/`type`,
17
+ * then `data-testid`, then the two label-ish attributes.
18
+ *
19
+ * Ordered candidates rather than one comma-joined list on purpose: a CSS list
20
+ * resolves in DOCUMENT order, so `{"password": …}` on a page with a "Forgot
21
+ * password?" link above the input would type the password into the link.
22
+ */
23
+ export function fieldCandidates(key) {
24
+ if (SELECTORISH.test(key))
25
+ return [key];
26
+ const v = JSON.stringify(key); // quoted + escaped for an attribute value
27
+ const candidates = [`css=input[name=${v} i], textarea[name=${v} i]`];
28
+ if (IDENTIFIER.test(key)) {
29
+ candidates.push(`css=input#${key}, textarea#${key}`, `css=input[type="${key.toLowerCase()}" i]`);
30
+ }
31
+ 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]`);
32
+ return candidates;
33
+ }
34
+ /** Selectors to try for the submit control — the named button, then link, then plain text. */
35
+ export function submitCandidates(submit) {
36
+ if (SELECTORISH.test(submit))
37
+ return [submit];
38
+ const v = JSON.stringify(submit);
39
+ return [`role=button[name=${v} i]`, `role=link[name=${v} i]`, `text=${submit}`];
40
+ }
41
+ /** How to fix a field key that matched nothing. */
42
+ export const FIELD_KEY_HINT = "Rename the key to the field's name/id/type/data-testid/aria-label/placeholder, " +
43
+ 'or use a selector as the key (e.g. "#user", "[data-testid=\'email\']").';
44
+ //# sourceMappingURL=login-selectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-selectors.js","sourceRoot":"","sources":["../../src/services/login-selectors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,GAAG,yEAAyE,CAAC;AAE9F,qFAAqF;AACrF,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,0CAA0C;IACzE,MAAM,UAAU,GAAa,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC/E,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,UAAU,CAAC,IAAI,CACb,aAAa,GAAG,cAAc,GAAG,EAAE,EACnC,mBAAmB,GAAG,CAAC,WAAW,EAAE,MAAM,CAC3C,CAAC;IACJ,CAAC;IACD,UAAU,CAAC,IAAI,CACb,yBAAyB,CAAC,6BAA6B,CAAC,KAAK,EAC7D,yBAAyB,CAAC,6BAA6B,CAAC,KAAK,EAC7D,0BAA0B,CAAC,8BAA8B,CAAC,KAAK,EAC/D,qBAAqB,CAAC,KAAK,CAC5B,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,QAAQ,MAAM,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,cAAc,GACzB,iFAAiF;IACjF,yEAAyE,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Reusing a session the browser profile already holds — the pre-run login's one
3
+ * way to succeed WITHOUT submitting the form. Split out of `login.ts` (500-LOC cap).
4
+ */
5
+ import type { Adapter } from '../adapters/contract.js';
6
+ import type { LoginOptions } from './login.js';
7
+ /**
8
+ * The login page ended up on `url` with no `key` input. That is an existing
9
+ * session ONLY with positive proof — never by default, or a moved login page plus
10
+ * a mistyped key would run the whole goal signed out:
11
+ * - this persona is the target's ONLY one (who is signed in cannot be read off a
12
+ * redirect), AND
13
+ * - its `expect` marker shows there, within `waitMs`.
14
+ *
15
+ * The marker is checked FIRST and is the whole proof — which is why it should
16
+ * identify the ACCOUNT (the username shown), not just "someone is signed in". A
17
+ * password input does not veto it (a dashboard has a change-password form); it
18
+ * only decides which failure this is once the marker has been waited for and is
19
+ * absent — the wait is the same either way, since a marker renders late too.
20
+ *
21
+ * A persona with no `expect` is never reused. The ABSENCE of a login form proves
22
+ * nothing: `/login` also redirects to a public error or maintenance page, which
23
+ * has no password field either. Everything else fails loud, saying which it was.
24
+ */
25
+ export declare function assertAlreadySignedIn(adapter: Adapter, { name, persona, loginUrl, solePersona }: LoginOptions, key: string, url: string, waitMs: number): Promise<void>;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Reusing a session the browser profile already holds — the pre-run login's one
3
+ * way to succeed WITHOUT submitting the form. Split out of `login.ts` (500-LOC cap).
4
+ */
5
+ import { AuthError } from '../errors.js';
6
+ import { FIELD_KEY_HINT } from './login-selectors.js';
7
+ /** Any password input — its presence means the page is still ASKING for a login. */
8
+ const PASSWORD_INPUT = 'css=input[type="password" i]';
9
+ /**
10
+ * The login page ended up on `url` with no `key` input. That is an existing
11
+ * session ONLY with positive proof — never by default, or a moved login page plus
12
+ * a mistyped key would run the whole goal signed out:
13
+ * - this persona is the target's ONLY one (who is signed in cannot be read off a
14
+ * redirect), AND
15
+ * - its `expect` marker shows there, within `waitMs`.
16
+ *
17
+ * The marker is checked FIRST and is the whole proof — which is why it should
18
+ * identify the ACCOUNT (the username shown), not just "someone is signed in". A
19
+ * password input does not veto it (a dashboard has a change-password form); it
20
+ * only decides which failure this is once the marker has been waited for and is
21
+ * absent — the wait is the same either way, since a marker renders late too.
22
+ *
23
+ * A persona with no `expect` is never reused. The ABSENCE of a login form proves
24
+ * nothing: `/login` also redirects to a public error or maintenance page, which
25
+ * has no password field either. Everything else fails loud, saying which it was.
26
+ */
27
+ export async function assertAlreadySignedIn(adapter, { name, persona, loginUrl, solePersona }, key, url, waitMs) {
28
+ const marker = solePersona === true ? persona.expect : undefined;
29
+ if (marker !== undefined) {
30
+ try {
31
+ await adapter.waitFor({ query: marker, timeout: waitMs });
32
+ return;
33
+ }
34
+ catch {
35
+ // absent — diagnosed below
36
+ }
37
+ }
38
+ const asksForPassword = (await adapter.find({ query: PASSWORD_INPUT })) !== null;
39
+ const landed = `auth persona '${name}': opening ${loginUrl} landed on ${url}`;
40
+ if (asksForPassword) {
41
+ throw new AuthError(`${landed}, which still shows a password field — a login page, not a signed-in profile — ` +
42
+ `but no input matching field '${key}'. ${FIELD_KEY_HINT} If the login page moved, point ` +
43
+ "the persona's 'path' at it.");
44
+ }
45
+ let why = `'${persona.expect}' ('expect') never appeared there`;
46
+ if (solePersona !== true) {
47
+ why = "this target has other personas, so the session may be someone else's";
48
+ }
49
+ else if (persona.expect === undefined) {
50
+ why =
51
+ "the persona has no 'expect' to prove it (a page with no login form may just as well be an " +
52
+ "error page) — set 'expect' to a selector that only exists once signed in AS THIS ACCOUNT " +
53
+ '(e.g. the username shown), and the next run reuses the session';
54
+ }
55
+ throw new AuthError(`${landed} — the app redirected away from its login page, so this browser profile is ` +
56
+ `probably ALREADY signed in, but ${why}. Otherwise sign that session out, or delete the ` +
57
+ "target's profile dir (chrome-user-data), then start again.");
58
+ }
59
+ //# sourceMappingURL=login-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-session.js","sourceRoot":"","sources":["../../src/services/login-session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,oFAAoF;AACpF,MAAM,cAAc,GAAG,8BAA8B,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAgB,EAChB,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAgB,EACtD,GAAW,EACX,GAAW,EACX,MAAc;IAEd,MAAM,MAAM,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAC1D,OAAO;QACT,CAAC;QAAC,MAAM,CAAC;YACP,2BAA2B;QAC7B,CAAC;IACH,CAAC;IAED,MAAM,eAAe,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;IACjF,MAAM,MAAM,GAAG,iBAAiB,IAAI,cAAc,QAAQ,cAAc,GAAG,EAAE,CAAC;IAC9E,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,IAAI,SAAS,CACjB,GAAG,MAAM,iFAAiF;YACxF,gCAAgC,GAAG,MAAM,cAAc,kCAAkC;YACzF,6BAA6B,CAChC,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,mCAAmC,CAAC;IAChE,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACzB,GAAG,GAAG,sEAAsE,CAAC;IAC/E,CAAC;SAAM,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACxC,GAAG;YACD,4FAA4F;gBAC5F,2FAA2F;gBAC3F,gEAAgE,CAAC;IACrE,CAAC;IACD,MAAM,IAAI,SAAS,CACjB,GAAG,MAAM,6EAA6E;QACpF,mCAAmC,GAAG,mDAAmD;QACzF,4DAA4D,CAC/D,CAAC;AACJ,CAAC"}
@@ -30,39 +30,18 @@
30
30
  * driver decision, with the values never written down.
31
31
  */
32
32
  import type { Adapter } from '../adapters/contract.js';
33
- import type { AuthPersona, Target } from '../config/schema.js';
34
33
  import type { Step } from '../findings/schema.js';
35
- /** What `start_debug({as})` resolved to — the persona plus the key that named it. */
36
- export interface ResolvedAuth {
37
- /** The `as` key, as the caller typed it — every failure names it. */
38
- name: string;
39
- persona: AuthPersona;
40
- }
41
- /**
42
- * Resolve `start_debug({as})` against the target's configured personas.
43
- *
44
- * Fails loud ({@link ConfigError}) on an unknown key, listing the valid ones — an
45
- * `as` typo must NEVER fall through to a signed-out run, because every screen
46
- * behind the login then reads as a broken UI.
47
- */
48
- export declare function resolveAuth(target: Target, targetName: string, as: string | undefined): ResolvedAuth | undefined;
49
- /**
50
- * Selectors to try for a field, most specific first — `name`, then `id`/`type`,
51
- * then `data-testid`, then the two label-ish attributes.
52
- *
53
- * Ordered candidates rather than one comma-joined list on purpose: a CSS list
54
- * resolves in DOCUMENT order, so `{"password": …}` on a page with a "Forgot
55
- * password?" link above the input would type the password into the link.
56
- */
57
- export declare function fieldCandidates(key: string): string[];
58
- /** Selectors to try for the submit control — the named button, then link, then plain text. */
59
- export declare function submitCandidates(submit: string): string[];
34
+ import type { ResolvedAuth } from './auth-persona.js';
35
+ export { type ResolvedAuth, resolveAuth } from './auth-persona.js';
36
+ export { fieldCandidates, submitCandidates } from './login-selectors.js';
60
37
  /** Everything {@link performLogin} needs beyond the adapter itself. */
61
38
  export interface LoginOptions extends ResolvedAuth {
62
39
  /** Absolute login URL — `persona.path` already resolved against the target url. */
63
40
  loginUrl: string;
64
41
  /** The run's remaining wall-clock budget (ms); only ever shortens the login's waits. */
65
42
  timeoutMs?: number;
43
+ /** This persona is the target's ONLY one — an already-signed-in profile can only be it. */
44
+ solePersona?: boolean;
66
45
  /**
67
46
  * Breadcrumb sink (`logs/agent.log`). The caller's sink is already secret-redacting.
68
47
  * MAY return a promise (an awaited flush): both breadcrumbs are `await`ed, so when
@@ -79,5 +58,8 @@ export interface LoginOptions extends ResolvedAuth {
79
58
  * a run's worth of findings about a login page.
80
59
  */
81
60
  export declare function performLogin(adapter: Adapter, options: LoginOptions): Promise<Step[]>;
82
- /** Same origin + same path — the query/hash a login flow adds (`?error=1`) does not make it a new page. */
61
+ /**
62
+ * Same origin + same path — the query/hash a login flow adds (`?error=1`) does not
63
+ * make it a new page, and neither does the trailing slash a server appends.
64
+ */
83
65
  export declare function samePage(a: string, b: string): boolean;