@developerz.ai/ui-debugger-mcp 1.5.2 → 1.7.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 (43) hide show
  1. package/README.md +71 -3
  2. package/dist/adapters/browser/browser-adapter.d.ts +1 -1
  3. package/dist/adapters/browser/browser-adapter.js +11 -4
  4. package/dist/adapters/browser/browser-adapter.js.map +1 -1
  5. package/dist/adapters/browser/launch.d.ts +12 -0
  6. package/dist/adapters/browser/launch.js +33 -0
  7. package/dist/adapters/browser/launch.js.map +1 -1
  8. package/dist/adapters/browser/log-format.d.ts +17 -5
  9. package/dist/adapters/browser/log-format.js +41 -4
  10. package/dist/adapters/browser/log-format.js.map +1 -1
  11. package/dist/agent/prompts/compose.d.ts +29 -2
  12. package/dist/agent/prompts/compose.js +37 -4
  13. package/dist/agent/prompts/compose.js.map +1 -1
  14. package/dist/config/schema.d.ts +54 -0
  15. package/dist/config/schema.js +62 -0
  16. package/dist/config/schema.js.map +1 -1
  17. package/dist/errors.d.ts +11 -0
  18. package/dist/errors.js +15 -0
  19. package/dist/errors.js.map +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/mcp/tools/describe.js +5 -2
  23. package/dist/mcp/tools/describe.js.map +1 -1
  24. package/dist/mcp/tools/get-findings.js +16 -4
  25. package/dist/mcp/tools/get-findings.js.map +1 -1
  26. package/dist/mcp/tools/output.d.ts +11 -0
  27. package/dist/mcp/tools/output.js +25 -0
  28. package/dist/mcp/tools/output.js.map +1 -1
  29. package/dist/mcp/tools/result.d.ts +17 -3
  30. package/dist/mcp/tools/result.js +24 -10
  31. package/dist/mcp/tools/result.js.map +1 -1
  32. package/dist/mcp/tools/start-debug.js +21 -1
  33. package/dist/mcp/tools/start-debug.js.map +1 -1
  34. package/dist/services/debug-service.d.ts +56 -1
  35. package/dist/services/debug-service.js +85 -11
  36. package/dist/services/debug-service.js.map +1 -1
  37. package/dist/services/login.d.ts +78 -0
  38. package/dist/services/login.js +200 -0
  39. package/dist/services/login.js.map +1 -0
  40. package/dist/services/session-builder.d.ts +4 -1
  41. package/dist/services/session-builder.js +62 -15
  42. package/dist/services/session-builder.js.map +1 -1
  43. package/package.json +1 -1
@@ -10,14 +10,46 @@ export declare const ModelsSchema: z.ZodObject<{
10
10
  vision: z.ZodString;
11
11
  summary: z.ZodOptional<z.ZodString>;
12
12
  }, z.core.$strict>;
13
+ /**
14
+ * One named login persona — how to sign into THIS app as THIS user.
15
+ *
16
+ * The recipe lives in config, not in every `start_debug` goal string: almost
17
+ * every interesting screen is behind a login, so re-teaching the flow in prose
18
+ * per run burned driver steps before the real goal started and put credentials
19
+ * into a free-text field that gets logged. `start_debug({as:"admin"})` names one
20
+ * instead; the run signs in out-of-band before the driver's first step and the
21
+ * values never enter the model's context (see `docs/idea/config.md`).
22
+ */
23
+ declare const AuthPersonaSchema: z.ZodObject<{
24
+ path: z.ZodString;
25
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
26
+ submit: z.ZodString;
27
+ expect: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strict>;
29
+ /**
30
+ * Hard cap on a target's `notes`, in characters.
31
+ *
32
+ * The composed system prompt is resent to the provider on EVERY step, so notes are
33
+ * paid for per step, for the whole run. ~1000 characters is a dozen preconditions —
34
+ * enough for what a driver must not mistake for a bug, short of an essay. Over the
35
+ * cap fails at config validation, loud, instead of quietly inflating every step.
36
+ */
37
+ export declare const TARGET_NOTES_MAX_CHARS = 1000;
13
38
  /** Web target — CDP-driven browser. Managed (default) unless `cdpUrl` attaches. */
14
39
  export declare const WebTargetSchema: z.ZodObject<{
15
40
  adapter: z.ZodLiteral<"browser">;
16
41
  url: z.ZodOptional<z.ZodURL>;
17
42
  headless: z.ZodDefault<z.ZodBoolean>;
43
+ notes: z.ZodOptional<z.ZodString>;
18
44
  debugLogin: z.ZodOptional<z.ZodObject<{
19
45
  param: z.ZodString;
20
46
  }, z.core.$strict>>;
47
+ auth: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
48
+ path: z.ZodString;
49
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
50
+ submit: z.ZodString;
51
+ expect: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strict>>>;
21
53
  executablePath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
54
  profile: z.ZodOptional<z.ZodString>;
23
55
  cdpUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
@@ -33,6 +65,7 @@ export declare const WebTargetSchema: z.ZodObject<{
33
65
  export declare const DesktopTargetSchema: z.ZodObject<{
34
66
  adapter: z.ZodLiteral<"desktop">;
35
67
  launch: z.ZodString;
68
+ notes: z.ZodOptional<z.ZodString>;
36
69
  window: z.ZodOptional<z.ZodObject<{
37
70
  title: z.ZodOptional<z.ZodString>;
38
71
  class: z.ZodOptional<z.ZodString>;
@@ -48,6 +81,7 @@ export declare const DesktopTargetSchema: z.ZodObject<{
48
81
  */
49
82
  export declare const AndroidTargetSchema: z.ZodObject<{
50
83
  adapter: z.ZodLiteral<"android">;
84
+ notes: z.ZodOptional<z.ZodString>;
51
85
  avd: z.ZodOptional<z.ZodString>;
52
86
  emulatorPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
87
  adbSerial: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -57,15 +91,23 @@ export declare const TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
57
91
  adapter: z.ZodLiteral<"browser">;
58
92
  url: z.ZodOptional<z.ZodURL>;
59
93
  headless: z.ZodDefault<z.ZodBoolean>;
94
+ notes: z.ZodOptional<z.ZodString>;
60
95
  debugLogin: z.ZodOptional<z.ZodObject<{
61
96
  param: z.ZodString;
62
97
  }, z.core.$strict>>;
98
+ auth: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
99
+ path: z.ZodString;
100
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
101
+ submit: z.ZodString;
102
+ expect: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strict>>>;
63
104
  executablePath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
105
  profile: z.ZodOptional<z.ZodString>;
65
106
  cdpUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
66
107
  }, z.core.$strict>, z.ZodObject<{
67
108
  adapter: z.ZodLiteral<"desktop">;
68
109
  launch: z.ZodString;
110
+ notes: z.ZodOptional<z.ZodString>;
69
111
  window: z.ZodOptional<z.ZodObject<{
70
112
  title: z.ZodOptional<z.ZodString>;
71
113
  class: z.ZodOptional<z.ZodString>;
@@ -73,6 +115,7 @@ export declare const TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
73
115
  display: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
116
  }, z.core.$strict>, z.ZodObject<{
75
117
  adapter: z.ZodLiteral<"android">;
118
+ notes: z.ZodOptional<z.ZodString>;
76
119
  avd: z.ZodOptional<z.ZodString>;
77
120
  emulatorPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
121
  adbSerial: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -89,15 +132,23 @@ export declare const ConfigSchema: z.ZodObject<{
89
132
  adapter: z.ZodLiteral<"browser">;
90
133
  url: z.ZodOptional<z.ZodURL>;
91
134
  headless: z.ZodDefault<z.ZodBoolean>;
135
+ notes: z.ZodOptional<z.ZodString>;
92
136
  debugLogin: z.ZodOptional<z.ZodObject<{
93
137
  param: z.ZodString;
94
138
  }, z.core.$strict>>;
139
+ auth: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
140
+ path: z.ZodString;
141
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
142
+ submit: z.ZodString;
143
+ expect: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strict>>>;
95
145
  executablePath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
146
  profile: z.ZodOptional<z.ZodString>;
97
147
  cdpUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
98
148
  }, z.core.$strict>, z.ZodObject<{
99
149
  adapter: z.ZodLiteral<"desktop">;
100
150
  launch: z.ZodString;
151
+ notes: z.ZodOptional<z.ZodString>;
101
152
  window: z.ZodOptional<z.ZodObject<{
102
153
  title: z.ZodOptional<z.ZodString>;
103
154
  class: z.ZodOptional<z.ZodString>;
@@ -105,14 +156,17 @@ export declare const ConfigSchema: z.ZodObject<{
105
156
  display: z.ZodOptional<z.ZodNullable<z.ZodString>>;
106
157
  }, z.core.$strict>, z.ZodObject<{
107
158
  adapter: z.ZodLiteral<"android">;
159
+ notes: z.ZodOptional<z.ZodString>;
108
160
  avd: z.ZodOptional<z.ZodString>;
109
161
  emulatorPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
162
  adbSerial: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
163
  }, z.core.$strict>], "adapter">>;
112
164
  }, z.core.$strict>;
113
165
  export type Models = z.infer<typeof ModelsSchema>;
166
+ export type AuthPersona = z.infer<typeof AuthPersonaSchema>;
114
167
  export type WebTarget = z.infer<typeof WebTargetSchema>;
115
168
  export type DesktopTarget = z.infer<typeof DesktopTargetSchema>;
116
169
  export type AndroidTarget = z.infer<typeof AndroidTargetSchema>;
117
170
  export type Target = z.infer<typeof TargetSchema>;
118
171
  export type Config = z.infer<typeof ConfigSchema>;
172
+ export {};
@@ -14,12 +14,72 @@ export const ModelsSchema = z.strictObject({
14
14
  const DebugLoginSchema = z.strictObject({
15
15
  param: z.string(), // query param name, e.g. "debug-ai" → `?debug-ai=true`
16
16
  });
17
+ /**
18
+ * One named login persona — how to sign into THIS app as THIS user.
19
+ *
20
+ * The recipe lives in config, not in every `start_debug` goal string: almost
21
+ * every interesting screen is behind a login, so re-teaching the flow in prose
22
+ * per run burned driver steps before the real goal started and put credentials
23
+ * into a free-text field that gets logged. `start_debug({as:"admin"})` names one
24
+ * instead; the run signs in out-of-band before the driver's first step and the
25
+ * values never enter the model's context (see `docs/idea/config.md`).
26
+ */
27
+ const AuthPersonaSchema = z.strictObject({
28
+ /** Login page — a path resolved against the target url (`/login`) or an absolute URL. */
29
+ path: z.string().min(1),
30
+ /**
31
+ * Field hint → value. The KEY locates the control (`name`/`id`/`type`/
32
+ * `data-testid`/`aria-label`/`placeholder`, in that order, or a selector when it
33
+ * looks like one); the VALUE is typed into it and is redacted everywhere it
34
+ * would otherwise be written down.
35
+ */
36
+ fields: z.record(z.string().min(1), z.string()).refine((f) => Object.keys(f).length > 0, {
37
+ message: 'needs at least one field to type',
38
+ }),
39
+ /** The control that submits the form — a button/link label, or a selector. */
40
+ submit: z.string().min(1),
41
+ /**
42
+ * Proof the login WORKED — a selector/text that only exists once signed in.
43
+ * Omit and the run instead requires that submitting left `path`; an app that
44
+ * signs in without navigating must set this, or the login reads as a failure.
45
+ */
46
+ expect: z.string().min(1).optional(),
47
+ });
48
+ /**
49
+ * Hard cap on a target's `notes`, in characters.
50
+ *
51
+ * The composed system prompt is resent to the provider on EVERY step, so notes are
52
+ * paid for per step, for the whole run. ~1000 characters is a dozen preconditions —
53
+ * enough for what a driver must not mistake for a bug, short of an essay. Over the
54
+ * cap fails at config validation, loud, instead of quietly inflating every step.
55
+ */
56
+ export const TARGET_NOTES_MAX_CHARS = 1000;
57
+ /**
58
+ * Standing facts about a target — what is EXPECTED, so the driver stops reporting
59
+ * it as a defect.
60
+ *
61
+ * Per-target, not per-run: `start_debug`'s `goal` says what to do this time,
62
+ * `notes` says what is always true of this app ("needs seeded data — empty tables
63
+ * are expected on /new", "dark mode by default", "first load shows an onboarding
64
+ * modal — dismiss it"). One fact per line; composed into the prompt once, as its
65
+ * own section (see `agent/prompts/compose.ts`).
66
+ */
67
+ const TargetNotesSchema = z
68
+ .string()
69
+ .min(1)
70
+ .max(TARGET_NOTES_MAX_CHARS, {
71
+ message: `must be at most ${TARGET_NOTES_MAX_CHARS} characters — the system prompt carrying it is ` +
72
+ 'resent to the model on every step. Keep it to the preconditions a driver would ' +
73
+ 'otherwise mis-report as bugs; the per-run `goal` carries the rest.',
74
+ });
17
75
  /** Web target — CDP-driven browser. Managed (default) unless `cdpUrl` attaches. */
18
76
  export const WebTargetSchema = z.strictObject({
19
77
  adapter: z.literal('browser'),
20
78
  url: z.url().optional(), // optional: the caller ("boss") can supply it per-run via start_debug
21
79
  headless: z.boolean().default(true), // docs/idea/config.md promises headless by default
80
+ notes: TargetNotesSchema.optional(), // standing preconditions — see the schema above
22
81
  debugLogin: DebugLoginSchema.optional(),
82
+ auth: z.record(z.string().min(1), AuthPersonaSchema).optional(), // personas, keyed by `as`
23
83
  executablePath: z.string().nullish(), // null = auto-detect Chrome/Chromium (managed)
24
84
  // Persistent profile dir, resolved against the workspace root (absolute path used
25
85
  // as-is); unset = `chrome-user-data/`. Managed mode only — attach keeps its own.
@@ -47,6 +107,7 @@ const WindowMatchSchema = z.strictObject({
47
107
  export const DesktopTargetSchema = z.strictObject({
48
108
  adapter: z.literal('desktop'),
49
109
  launch: z.string(), // command that starts the app (managed, must stay foreground)
110
+ notes: TargetNotesSchema.optional(), // standing preconditions — see the schema above
50
111
  window: WindowMatchSchema.optional(), // which window to drive; omit → `open` must supply a title
51
112
  display: z.string().nullish(), // X11 DISPLAY, e.g. ":99" for Xvfb; null = inherit env
52
113
  });
@@ -60,6 +121,7 @@ export const DesktopTargetSchema = z.strictObject({
60
121
  export const AndroidTargetSchema = z
61
122
  .strictObject({
62
123
  adapter: z.literal('android'),
124
+ notes: TargetNotesSchema.optional(), // standing preconditions — see the schema above
63
125
  avd: z.string().optional(), // required in managed mode (see the refinement below)
64
126
  emulatorPath: z.string().nullish(), // null = auto-detect from SDK (managed)
65
127
  adbSerial: z.string().nullish(), // set → attach to a running device, no start/stop
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6FAA6F;AAC7F,MAA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D;CACpF,CAAC;KACD,WAAW,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;IAC3B,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QACzD,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,KAAK,CAAC;YACb,OAAO,EAAE,uEAAuE;SACjF,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,mHAAmH;AACnH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;IAC1D,eAAe;IACf,mBAAmB;IACnB,mBAAmB;CACpB,CAAC,CAAC;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;IACzC,MAAM,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC;CAC5C,CAAC,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -36,6 +36,17 @@ export declare class ExecTimeoutError extends AdapterError {
36
36
  export declare class AdbError extends AdapterError {
37
37
  constructor(message: string);
38
38
  }
39
+ /**
40
+ * A configured auth persona could not sign in — the login page never rendered, a
41
+ * field/submit control did not resolve, or submitting left the run signed out.
42
+ *
43
+ * Loud on purpose and thrown BEFORE the driver takes a step: a run that silently
44
+ * continues logged out reports "the page is empty" for every screen behind the
45
+ * login, which is indistinguishable from a real UI bug. Never carries a credential.
46
+ */
47
+ export declare class AuthError extends UiDebuggerError {
48
+ constructor(message: string);
49
+ }
39
50
  /** The per-project workspace could not be managed — e.g. old session dirs that refuse to prune. */
40
51
  export declare class WorkspaceError extends UiDebuggerError {
41
52
  constructor(message: string);
package/dist/errors.js CHANGED
@@ -72,6 +72,21 @@ export class AdbError extends AdapterError {
72
72
  Object.setPrototypeOf(this, AdbError.prototype);
73
73
  }
74
74
  }
75
+ /**
76
+ * A configured auth persona could not sign in — the login page never rendered, a
77
+ * field/submit control did not resolve, or submitting left the run signed out.
78
+ *
79
+ * Loud on purpose and thrown BEFORE the driver takes a step: a run that silently
80
+ * continues logged out reports "the page is empty" for every screen behind the
81
+ * login, which is indistinguishable from a real UI bug. Never carries a credential.
82
+ */
83
+ export class AuthError extends UiDebuggerError {
84
+ constructor(message) {
85
+ super(message);
86
+ this.name = 'AuthError';
87
+ Object.setPrototypeOf(this, AuthError.prototype);
88
+ }
89
+ }
75
90
  /** The per-project workspace could not be managed — e.g. old session dirs that refuse to prune. */
76
91
  export class WorkspaceError extends UiDebuggerError {
77
92
  constructor(message) {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,eAAe;IAC9C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IACnD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBA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7B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,eAAe;IAC9C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const NAME = "ui-debugger-mcp";
2
- export declare const VERSION = "1.5.2";
2
+ export declare const VERSION = "1.7.0";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Public package surface. Implementation lands incrementally — see idea/ for design.
2
2
  export const NAME = 'ui-debugger-mcp';
3
- export const VERSION = '1.5.2';
3
+ export const VERSION = '1.7.0';
4
4
  //# sourceMappingURL=index.js.map
@@ -17,8 +17,11 @@ export function describeTool(service) {
17
17
  server.registerTool('describe', {
18
18
  title: 'Describe debug targets',
19
19
  description: 'List the configured targets for this project (name, adapter, managed|attach, whether wired, ' +
20
- 'and web url/headless) plus the resolved per-role models and workspace. Call this first to pick ' +
21
- 'a valid target for start_debug. Pass target to narrow to one.',
20
+ "web url/headless, any named auth personas, and the target's standing notes — what is " +
21
+ 'expected of the app) plus the resolved per-role models and workspace. Call this first to ' +
22
+ 'pick a valid target — and a valid `as` persona — for start_debug. Pass target to narrow ' +
23
+ 'to one. Also reports `session`: the run this project currently holds, so a lost ' +
24
+ 'session_id can be adopted or ended instead of blocking the next start_debug.',
22
25
  annotations: {
23
26
  readOnlyHint: true,
24
27
  },
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/mcp/tools/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EA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gBAChF,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;iBACnB;gBACD,WAAW,EAAE;oBACX,MAAM,EAAE,CAAC;yBACN,MAAM,EAAE;yBACR,GAAG,CAAC,CAAC,CAAC;yBACN,QAAQ,EAAE;yBACV,QAAQ,CAAC,+DAA+D,CAAC;iBAC7E;gBACD,YAAY,EAAE,oBAAoB;aACnC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC/C,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -8,17 +8,28 @@
8
8
  */
9
9
  import { z } from 'zod';
10
10
  import { FindingsSchema } from '../../findings/schema.js';
11
- import { toToolResult } from './result.js';
11
+ import { TRUNCATED_KEY, toToolResult } from './result.js';
12
12
  /** Selectable top-level findings keys, derived from the findings schema. */
13
13
  const FindingsField = FindingsSchema.keyof();
14
14
  /**
15
- * Declared output: the findings object with every key optional.
15
+ * Declared output: the findings object with every key optional, plus the
16
+ * truncation counts a capped whole-object read carries.
16
17
  *
17
18
  * A `fields` projection returns only the requested keys, so no key can be
18
19
  * promised — an all-required schema would make every sparse read fail output
19
20
  * validation. Types stay exact per key; only presence is loose.
21
+ *
22
+ * `truncated` is declared rather than smuggled: it is the structural half of the
23
+ * cap (the prose note is the other), and a caller can only act on what the output
24
+ * schema tells it exists.
20
25
  */
21
- const FindingsOutputSchema = FindingsSchema.partial();
26
+ const FindingsOutputSchema = FindingsSchema.partial().extend({
27
+ [TRUNCATED_KEY]: z
28
+ .record(z.string(), z.object({ returned: z.number().int(), total: z.number().int() }))
29
+ .optional()
30
+ .describe('Present only on a capped whole-object read: per field, how many items came back vs how ' +
31
+ 'many the run has. Re-read with fields=[…] to get them all.'),
32
+ });
22
33
  /** Build the `get_findings` outer tool bound to the debug service. */
23
34
  export function getFindingsTool(service) {
24
35
  return {
@@ -48,7 +59,8 @@ export function getFindingsTool(service) {
48
59
  .min(1)
49
60
  .optional()
50
61
  .describe('Project a subset of findings keys (e.g. ["status","bugs"]). Omit for the whole ' +
51
- 'object, whose lists are capped at 20 items; a projected read returns them in full.'),
62
+ 'object, whose lists are capped at 20 items — a capped read says so in ' +
63
+ '`truncated` ({returned,total} per field); a projected read returns them in full.'),
52
64
  },
53
65
  outputSchema: FindingsOutputSchema,
54
66
  },
@@ -1 +1 @@
1
- {"version":3,"file":"get-findings.js","sourceRoot":"","sources":["../../../src/mcp/tools/get-findings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,4EAA4E;AAC5E,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;AAEtD,sEAAsE;AACtE,MAAM,UAAU,eAAe,CAAC,OAAiB;IAC/C,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,QAAQ,CAAC,MAAM;YACb,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;gBACE,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,0FAA0F;oBAC1F,wFAAwF;oBACxF,2FAA2F;oBAC3F,2FAA2F;oBAC3F,+CAA+C;gBACjD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;iBACnB;gBACD,WAAW,EAAE;oBACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;oBACzE,IAAI,EAAE,CAAC;yBACJ,MAAM,EAAE;yBACR,GAAG,EAAE;yBACL,GAAG,CAAC,CAAC,CAAC;yBACN,GAAG,CAAC,OAAO,CAAC;yBACZ,QAAQ,EAAE;yBACV,Q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EH,sEAAsE;AACtE,MAAM,UAAU,eAAe,CAAC,OAAiB;IAC/C,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,QAAQ,CAAC,MAAM;YACb,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;gBACE,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,0FAA0F;oBAC1F,wFAAwF;oBACxF,2FAA2F;oBAC3F,2FAA2F;oBAC3F,+CAA+C;gBACjD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;iBACnB;gBACD,WAAW,EAAE;oBACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;oBACzE,IAAI,EAAE,CAAC;yBACJ,MAAM,EAAE;yBACR,GAAG,EAAE;yBACL,GAAG,CAAC,CAAC,CAAC;yBACN,GAAG,CAAC,OAAO,CAAC;yBACZ,QAAQ,EAAE;yBACV,QAAQ,CACP,yFAAyF,CAC1F;oBACH,MAAM,EAAE,CAAC;yBACN,KAAK,CAAC,aAAa,CAAC;yBACpB,GAAG,CAAC,CAAC,CAAC;yBACN,QAAQ,EAAE;yBACV,QAAQ,CACP,iFAAiF;wBAC/E,wEAAwE;wBACxE,kFAAkF,CACrF;iBACJ;gBACD,YAAY,EAAE,oBAAoB;aACnC;YACD,2EAA2E;YAC3E,wEAAwE;YACxE,yCAAyC;YACzC,KAAK,EAAE,IAAI,EAAE,EAAE,CACb,YAAY,CAAC,MAAM,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC,CACzF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -40,6 +40,8 @@ export declare const DescribeResultSchema: z.ZodObject<{
40
40
  operational: z.ZodBoolean;
41
41
  url: z.ZodOptional<z.ZodString>;
42
42
  headless: z.ZodOptional<z.ZodBoolean>;
43
+ personas: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
+ notes: z.ZodOptional<z.ZodString>;
43
45
  }, z.core.$strip>>;
44
46
  models: z.ZodObject<{
45
47
  driver: z.ZodString;
@@ -47,4 +49,13 @@ export declare const DescribeResultSchema: z.ZodObject<{
47
49
  summary: z.ZodString;
48
50
  }, z.core.$strip>;
49
51
  workspace: z.ZodString;
52
+ session: z.ZodOptional<z.ZodObject<{
53
+ id: z.ZodString;
54
+ status: z.ZodEnum<{
55
+ running: "running";
56
+ passed: "passed";
57
+ failed: "failed";
58
+ }>;
59
+ goal: z.ZodString;
60
+ }, z.core.$strip>>;
50
61
  }, z.core.$strip>;
@@ -39,6 +39,28 @@ const TargetInfoSchema = z.object({
39
39
  operational: z.boolean().describe('Whether this adapter is wired and usable.'),
40
40
  url: z.string().optional().describe('Entry url (web targets only).'),
41
41
  headless: z.boolean().optional().describe('Headless flag (web targets only).'),
42
+ personas: z
43
+ .array(z.string())
44
+ .optional()
45
+ .describe('Named auth personas — the valid start_debug({as}) values for this target. Names only; ' +
46
+ 'the credentials stay in .ui-debugger-mcp.json and never reach the driver.'),
47
+ notes: z
48
+ .string()
49
+ .optional()
50
+ .describe('Standing preconditions the project declares for this app (e.g. "needs seeded data — ' +
51
+ 'empty tables are expected"). Composed into the driver\'s prompt, so it treats these ' +
52
+ 'as expected rather than reporting them as defects.'),
53
+ });
54
+ /** The run this server holds for the project — how a caller that lost its session id gets back in. */
55
+ const RunInfoSchema = z.object({
56
+ id: z
57
+ .string()
58
+ .min(1)
59
+ .describe('Session id — pass to get_findings, send_message and end_session.'),
60
+ status: z
61
+ .enum(['running', 'passed', 'failed'])
62
+ .describe('running, or the verdict it settled on (still readable, still holding the project).'),
63
+ goal: z.string().describe('The goal this run was started with.'),
42
64
  });
43
65
  /** `describe` output — the target catalog plus the resolved models + workspace. */
44
66
  export const DescribeResultSchema = z.object({
@@ -51,5 +73,8 @@ export const DescribeResultSchema = z.object({
51
73
  })
52
74
  .describe('Resolved per-role model ids.'),
53
75
  workspace: z.string().describe('Per-project workspace path; evidence lands under it.'),
76
+ session: RunInfoSchema.optional().describe('The run this project currently holds (or the last one, kept readable until it is ended or ' +
77
+ 'superseded). Absent when there is none. Use it to adopt a run whose session_id you lost — ' +
78
+ 'or to end it — instead of being blocked by start_debug.'),
54
79
  });
55
80
  //# sourceMappingURL=output.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/mcp/tools/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,0DAA0D,CAAC;CACxE,CAAkC,CAAC;AAEpC,uEAAuE;AACvE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,CAAC;SACF,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,sEAAsE,CAAC;IACnF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;CACnE,CAA0B,CAAC;AAE5B,oFAAoF;AACpF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAChE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAChG,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;SAC3B,QAAQ,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tG,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,kEAAkE,CAAC;IAC/E,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;SACrC,QAAQ,CAAC,oFAAoF,CAAC;IACjG,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;CACjE,CAAC,CAAC;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACnF,MAAM,EAAE,CAAC;SACN,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACxE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC/D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACpE,CAAC;SACD,QAAQ,CAAC,8BAA8B,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IACtF,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,4FAA4F;QAC1F,4FAA4F;QAC5F,yDAAyD,CAC5D;CACF,CAAqC,CAAC"}
@@ -8,14 +8,28 @@
8
8
  * Two spec-alignment behaviors live here too, so no tool handler has to think
9
9
  * about them:
10
10
  * - **Truncation steering** (opt-in, see {@link ToolResultOptions.capLists}):
11
- * a list over {@link MAX_LIST_ITEMS} gets capped and a trailing text block
12
- * names the retrieval that returns it whole. Never capped without one — a
13
- * dropped entry the caller cannot ask for again is silent data loss.
11
+ * a list over {@link MAX_LIST_ITEMS} gets capped, a `truncated` map records
12
+ * `{returned, total}` per capped field, and a trailing text block names the
13
+ * retrieval that returns it whole. Never capped without both — a dropped entry
14
+ * the caller cannot ask for again is silent data loss, and prose alone lets a
15
+ * caller that skips the note conclude there were exactly 20 findings.
14
16
  * - **`resource_link`s**: evidence paths (screenshots, `replay.mp4`, logs) ride
15
17
  * as `resource_link` content items (file:// URIs) alongside the text block —
16
18
  * the spec-blessed form, not inline path strings the caller has to notice.
17
19
  */
18
20
  import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
21
+ /** How much of one capped list actually came back. */
22
+ export interface Truncation {
23
+ /** Items in this response. */
24
+ returned: number;
25
+ /** Items the run really has. */
26
+ total: number;
27
+ }
28
+ /**
29
+ * The key {@link toToolResult} attaches the per-list {@link Truncation} counts
30
+ * under. Findings has no field by this name, so it can never shadow real data.
31
+ */
32
+ export declare const TRUNCATED_KEY = "truncated";
19
33
  /** Per-call switches for {@link toToolResult}. */
20
34
  export interface ToolResultOptions {
21
35
  /**
@@ -8,9 +8,11 @@
8
8
  * Two spec-alignment behaviors live here too, so no tool handler has to think
9
9
  * about them:
10
10
  * - **Truncation steering** (opt-in, see {@link ToolResultOptions.capLists}):
11
- * a list over {@link MAX_LIST_ITEMS} gets capped and a trailing text block
12
- * names the retrieval that returns it whole. Never capped without one — a
13
- * dropped entry the caller cannot ask for again is silent data loss.
11
+ * a list over {@link MAX_LIST_ITEMS} gets capped, a `truncated` map records
12
+ * `{returned, total}` per capped field, and a trailing text block names the
13
+ * retrieval that returns it whole. Never capped without both — a dropped entry
14
+ * the caller cannot ask for again is silent data loss, and prose alone lets a
15
+ * caller that skips the note conclude there were exactly 20 findings.
14
16
  * - **`resource_link`s**: evidence paths (screenshots, `replay.mp4`, logs) ride
15
17
  * as `resource_link` content items (file:// URIs) alongside the text block —
16
18
  * the spec-blessed form, not inline path strings the caller has to notice.
@@ -78,14 +80,19 @@ function collectResourceLinks(value) {
78
80
  walk(value);
79
81
  return links;
80
82
  }
81
- /** Cap any top-level array field over {@link MAX_LIST_ITEMS}; report which ones. */
83
+ /**
84
+ * The key {@link toToolResult} attaches the per-list {@link Truncation} counts
85
+ * under. Findings has no field by this name, so it can never shadow real data.
86
+ */
87
+ export const TRUNCATED_KEY = 'truncated';
88
+ /** Cap any top-level array field over {@link MAX_LIST_ITEMS}; report what was dropped. */
82
89
  function capLists(data) {
83
- const truncated = [];
90
+ const truncated = {};
84
91
  const capped = {};
85
92
  for (const [key, value] of Object.entries(data)) {
86
93
  if (Array.isArray(value) && value.length > MAX_LIST_ITEMS) {
87
94
  capped[key] = value.slice(0, MAX_LIST_ITEMS);
88
- truncated.push(key);
95
+ truncated[key] = { returned: MAX_LIST_ITEMS, total: value.length };
89
96
  }
90
97
  else {
91
98
  capped[key] = value;
@@ -96,7 +103,8 @@ function capLists(data) {
96
103
  /** Steering text appended when one or more lists got capped. */
97
104
  function steeringNote(truncated) {
98
105
  const fields = truncated.map((f) => `"${f}"`).join(', ');
99
- return (`Truncated ${truncated.join(', ')} to the first ${MAX_LIST_ITEMS} items. ` +
106
+ return (`Truncated ${truncated.join(', ')} to the first ${MAX_LIST_ITEMS} items (see "${TRUNCATED_KEY}" ` +
107
+ 'for the real totals). ' +
100
108
  `Call get_findings with fields=[${fields}] to read those arrays in full — ` +
101
109
  'a projected read is never truncated. The complete run also sits on disk: ' +
102
110
  'findings.json / replay.mp4 / the logs under the session workspace.');
@@ -108,12 +116,18 @@ export function toToolResult(data, options = {}) {
108
116
  }
109
117
  const { capped, truncated } = options.capLists
110
118
  ? capLists(data)
111
- : { capped: data, truncated: [] };
119
+ : { capped: data, truncated: {} };
120
+ const fields = Object.keys(truncated);
121
+ // Structural, not just prose: a caller that skips the steering note below still
122
+ // cannot read `steps: [20 items]` as "the run took 20 steps" — the counts say
123
+ // otherwise, in the typed half of the result, where a client can assert on them.
124
+ if (fields.length > 0)
125
+ capped[TRUNCATED_KEY] = truncated;
112
126
  const content = [
113
127
  { type: 'text', text: JSON.stringify(capped, null, 2) },
114
128
  ];
115
- if (truncated.length > 0) {
116
- content.push({ type: 'text', text: steeringNote(truncated) });
129
+ if (fields.length > 0) {
130
+ content.push({ type: 'text', text: steeringNote(fields) });
117
131
  }
118
132
  content.push(...collectResourceLinks(capped));
119
133
  return { content, structuredContent: capped };
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/mcp/tools/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,2EAA2E;AAC3E,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,gFAAgF;AAChF,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,mFAAmF;AACnF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;AAI1D,8EAA8E;AAC9E,SAAS,WAAW,CAAC,IAAY;IAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,WAAW,CAAC;IAC9C,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,YAAY,CAAC;IACzE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,WAAW,CAAC;IAC9C,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,YAAY,CAAC;IAC/C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4EAA4E;AAC5E,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC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AAE,CAAC,CAAC,EAAE;KACxD,CAAC;IACF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
@@ -19,8 +19,12 @@ export function startDebugTool(service) {
19
19
  description: 'Open a debug session: hand the small driver agent a goal for a configured target ' +
20
20
  '(e.g. "web"). It drives the UI autonomously and gathers findings (functional bugs + ' +
21
21
  'visual feedback). One run per project at a time. Returns { session_id }; then poll ' +
22
- 'get_findings, steer with send_message, and close with end_session.',
22
+ 'get_findings, steer with send_message, and close with end_session. A run is already ' +
23
+ 'active? The error names its session_id and how to read, close or replace it — and ' +
24
+ 'describe reports that id too.',
23
25
  annotations: {
26
+ // Stays `false`: the one destructive path (`replace: true`, which ends
27
+ // the active run) is never taken unless the caller asks for it by name.
24
28
  destructiveHint: false,
25
29
  openWorldHint: true,
26
30
  },
@@ -37,6 +41,22 @@ export function startDebugTool(service) {
37
41
  .url()
38
42
  .optional()
39
43
  .describe('Where to point the driver for this run (web targets) — e.g. a local dev server, a preview, or production. Overrides the target\'s configured url; required when the target has none. You ("the boss") decide where the driver goes.'),
44
+ as: z
45
+ .string()
46
+ .min(1)
47
+ .optional()
48
+ .describe('Sign in as this configured auth persona before the run starts (a key in the ' +
49
+ "target's auth map — see describe.targets[].personas). The login runs " +
50
+ 'out-of-band, so it costs the driver no steps and the credentials never enter ' +
51
+ 'its context. Omit to run signed out; an unknown name fails loud.'),
52
+ replace: z
53
+ .boolean()
54
+ .optional()
55
+ .describe('Take the project over when a run is already active: end that run (closing its ' +
56
+ 'browser and freeing the profile) and start yours. Default false — the start is ' +
57
+ 'refused instead, naming the active session_id. Use this when the active run is ' +
58
+ 'yours and you lost its id, or it is stuck; it kills a run that may still be ' +
59
+ 'working. A run held by another ui-debugger-mcp server is never replaced.'),
40
60
  criteria: z
41
61
  .string()
42
62
  .optional()