@developerz.ai/ui-debugger-mcp 1.9.0 → 1.10.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 (201) hide show
  1. package/README.md +56 -44
  2. package/dist/adapters/android/adb.d.ts +19 -7
  3. package/dist/adapters/android/adb.js +50 -13
  4. package/dist/adapters/android/adb.js.map +1 -1
  5. package/dist/adapters/android/android-adapter.d.ts +42 -2
  6. package/dist/adapters/android/android-adapter.js +366 -36
  7. package/dist/adapters/android/android-adapter.js.map +1 -1
  8. package/dist/adapters/android/commands.js.map +1 -1
  9. package/dist/adapters/android/ports.js.map +1 -1
  10. package/dist/adapters/android/sdk.d.ts +65 -0
  11. package/dist/adapters/android/sdk.js +107 -0
  12. package/dist/adapters/android/sdk.js.map +1 -0
  13. package/dist/adapters/android/uiautomator.d.ts +23 -7
  14. package/dist/adapters/android/uiautomator.js +31 -7
  15. package/dist/adapters/android/uiautomator.js.map +1 -1
  16. package/dist/adapters/availability.d.ts +39 -0
  17. package/dist/adapters/availability.js +62 -0
  18. package/dist/adapters/availability.js.map +1 -0
  19. package/dist/adapters/browser/browser-adapter.d.ts +11 -22
  20. package/dist/adapters/browser/browser-adapter.js +98 -67
  21. package/dist/adapters/browser/browser-adapter.js.map +1 -1
  22. package/dist/adapters/browser/cdp.d.ts +15 -7
  23. package/dist/adapters/browser/cdp.js +25 -3
  24. package/dist/adapters/browser/cdp.js.map +1 -1
  25. package/dist/adapters/browser/filters.d.ts +1 -1
  26. package/dist/adapters/browser/filters.js.map +1 -1
  27. package/dist/adapters/browser/geometry.js.map +1 -1
  28. package/dist/adapters/browser/launch.d.ts +14 -5
  29. package/dist/adapters/browser/launch.js +14 -5
  30. package/dist/adapters/browser/launch.js.map +1 -1
  31. package/dist/adapters/browser/lifecycle.d.ts +58 -0
  32. package/dist/adapters/browser/lifecycle.js +98 -0
  33. package/dist/adapters/browser/lifecycle.js.map +1 -0
  34. package/dist/adapters/browser/log-filters.d.ts +2 -2
  35. package/dist/adapters/browser/log-filters.js.map +1 -1
  36. package/dist/adapters/browser/log-format.d.ts +14 -23
  37. package/dist/adapters/browser/log-format.js +16 -55
  38. package/dist/adapters/browser/log-format.js.map +1 -1
  39. package/dist/adapters/browser/tab-context.d.ts +30 -0
  40. package/dist/adapters/browser/tab-context.js +41 -0
  41. package/dist/adapters/browser/tab-context.js.map +1 -0
  42. package/dist/adapters/contract.d.ts +91 -5
  43. package/dist/adapters/contract.js +7 -2
  44. package/dist/adapters/contract.js.map +1 -1
  45. package/dist/adapters/desktop/atspi-busctl.d.ts +26 -0
  46. package/dist/adapters/desktop/atspi-busctl.js +330 -0
  47. package/dist/adapters/desktop/atspi-busctl.js.map +1 -0
  48. package/dist/adapters/desktop/atspi-parse.d.ts +39 -0
  49. package/dist/adapters/desktop/atspi-parse.js +155 -0
  50. package/dist/adapters/desktop/atspi-parse.js.map +1 -0
  51. package/dist/adapters/desktop/atspi.d.ts +75 -50
  52. package/dist/adapters/desktop/atspi.js +64 -285
  53. package/dist/adapters/desktop/atspi.js.map +1 -1
  54. package/dist/adapters/desktop/capture.d.ts +11 -20
  55. package/dist/adapters/desktop/capture.js +68 -37
  56. package/dist/adapters/desktop/capture.js.map +1 -1
  57. package/dist/adapters/desktop/desktop-adapter.d.ts +20 -2
  58. package/dist/adapters/desktop/desktop-adapter.js +91 -9
  59. package/dist/adapters/desktop/desktop-adapter.js.map +1 -1
  60. package/dist/adapters/desktop/input.d.ts +18 -4
  61. package/dist/adapters/desktop/input.js +15 -10
  62. package/dist/adapters/desktop/input.js.map +1 -1
  63. package/dist/adapters/desktop/proc.d.ts +32 -4
  64. package/dist/adapters/desktop/proc.js +33 -6
  65. package/dist/adapters/desktop/proc.js.map +1 -1
  66. package/dist/adapters/factory.d.ts +12 -5
  67. package/dist/adapters/factory.js +29 -3
  68. package/dist/adapters/factory.js.map +1 -1
  69. package/dist/adapters/log-format.d.ts +32 -0
  70. package/dist/adapters/log-format.js +39 -0
  71. package/dist/adapters/log-format.js.map +1 -0
  72. package/dist/agent/belt/act.d.ts +421 -21
  73. package/dist/agent/belt/act.js +4 -4
  74. package/dist/agent/belt/act.js.map +1 -1
  75. package/dist/agent/belt/look.d.ts +471 -14
  76. package/dist/agent/belt/look.js +74 -12
  77. package/dist/agent/belt/look.js.map +1 -1
  78. package/dist/agent/belt/observe.d.ts +663 -42
  79. package/dist/agent/belt/observe.js +76 -12
  80. package/dist/agent/belt/observe.js.map +1 -1
  81. package/dist/agent/belt/report.d.ts +754 -48
  82. package/dist/agent/belt/report.js +121 -38
  83. package/dist/agent/belt/report.js.map +1 -1
  84. package/dist/agent/belt/trail.d.ts +44 -16
  85. package/dist/agent/belt/trail.js +46 -11
  86. package/dist/agent/belt/trail.js.map +1 -1
  87. package/dist/agent/capabilities.js.map +1 -1
  88. package/dist/agent/fallback.d.ts +33 -0
  89. package/dist/agent/fallback.js +84 -0
  90. package/dist/agent/fallback.js.map +1 -0
  91. package/dist/agent/loop.d.ts +54 -52
  92. package/dist/agent/loop.js +173 -176
  93. package/dist/agent/loop.js.map +1 -1
  94. package/dist/agent/models.d.ts +10 -6
  95. package/dist/agent/models.js +15 -9
  96. package/dist/agent/models.js.map +1 -1
  97. package/dist/agent/prompts/compose.d.ts +1 -1
  98. package/dist/agent/prompts/debug-agent.js +45 -8
  99. package/dist/agent/prompts/debug-agent.js.map +1 -1
  100. package/dist/agent/prompts/web-addendum.d.ts +1 -1
  101. package/dist/agent/prompts/web-addendum.js +15 -3
  102. package/dist/agent/prompts/web-addendum.js.map +1 -1
  103. package/dist/agent/provider.d.ts +38 -0
  104. package/dist/agent/provider.js +55 -3
  105. package/dist/agent/provider.js.map +1 -1
  106. package/dist/boot.d.ts +64 -0
  107. package/dist/boot.js +145 -0
  108. package/dist/boot.js.map +1 -0
  109. package/dist/cli/chromium-libs.d.ts +262 -0
  110. package/dist/cli/chromium-libs.js +522 -0
  111. package/dist/cli/chromium-libs.js.map +1 -0
  112. package/dist/cli/control.js +51 -9
  113. package/dist/cli/control.js.map +1 -1
  114. package/dist/cli/init.d.ts +52 -3
  115. package/dist/cli/init.js +62 -10
  116. package/dist/cli/init.js.map +1 -1
  117. package/dist/config/load.d.ts +25 -8
  118. package/dist/config/load.js +40 -13
  119. package/dist/config/load.js.map +1 -1
  120. package/dist/config/schema.d.ts +18 -6
  121. package/dist/config/schema.js +22 -7
  122. package/dist/config/schema.js.map +1 -1
  123. package/dist/errors.d.ts +14 -0
  124. package/dist/errors.js +18 -0
  125. package/dist/errors.js.map +1 -1
  126. package/dist/findings/schema.d.ts +44 -6
  127. package/dist/findings/schema.js +39 -3
  128. package/dist/findings/schema.js.map +1 -1
  129. package/dist/index.d.ts +1 -1
  130. package/dist/index.js +1 -1
  131. package/dist/index.js.map +1 -1
  132. package/dist/main.js +4 -82
  133. package/dist/main.js.map +1 -1
  134. package/dist/mcp/server.js.map +1 -1
  135. package/dist/mcp/tools/describe.d.ts +5 -4
  136. package/dist/mcp/tools/describe.js +14 -10
  137. package/dist/mcp/tools/describe.js.map +1 -1
  138. package/dist/mcp/tools/end-session.d.ts +3 -1
  139. package/dist/mcp/tools/end-session.js +7 -3
  140. package/dist/mcp/tools/end-session.js.map +1 -1
  141. package/dist/mcp/tools/output.d.ts +5 -4
  142. package/dist/mcp/tools/output.js +10 -2
  143. package/dist/mcp/tools/output.js.map +1 -1
  144. package/dist/mcp/tools/result.d.ts +10 -1
  145. package/dist/mcp/tools/result.js +8 -6
  146. package/dist/mcp/tools/result.js.map +1 -1
  147. package/dist/mcp/tools/start-debug.js +7 -5
  148. package/dist/mcp/tools/start-debug.js.map +1 -1
  149. package/dist/redact.d.ts +28 -0
  150. package/dist/redact.js +51 -0
  151. package/dist/redact.js.map +1 -0
  152. package/dist/services/catalog.d.ts +28 -0
  153. package/dist/services/catalog.js +65 -0
  154. package/dist/services/catalog.js.map +1 -0
  155. package/dist/services/debug-api.d.ts +172 -0
  156. package/dist/services/debug-api.js +9 -0
  157. package/dist/services/debug-api.js.map +1 -0
  158. package/dist/services/debug-service.d.ts +25 -173
  159. package/dist/services/debug-service.js +108 -175
  160. package/dist/services/debug-service.js.map +1 -1
  161. package/dist/services/login.d.ts +7 -2
  162. package/dist/services/login.js +203 -29
  163. package/dist/services/login.js.map +1 -1
  164. package/dist/services/retained-snapshot.d.ts +36 -0
  165. package/dist/services/retained-snapshot.js +63 -0
  166. package/dist/services/retained-snapshot.js.map +1 -0
  167. package/dist/services/session-builder.d.ts +26 -0
  168. package/dist/services/session-builder.js +46 -19
  169. package/dist/services/session-builder.js.map +1 -1
  170. package/dist/services/start-guards.d.ts +32 -0
  171. package/dist/services/start-guards.js +50 -0
  172. package/dist/services/start-guards.js.map +1 -0
  173. package/dist/services/summarize.d.ts +12 -3
  174. package/dist/services/summarize.js +13 -5
  175. package/dist/services/summarize.js.map +1 -1
  176. package/dist/session/cleanup.js.map +1 -1
  177. package/dist/session/findings-store.d.ts +2 -1
  178. package/dist/session/findings-store.js +30 -2
  179. package/dist/session/findings-store.js.map +1 -1
  180. package/dist/session/live-pointer.d.ts +19 -0
  181. package/dist/session/live-pointer.js +41 -0
  182. package/dist/session/live-pointer.js.map +1 -0
  183. package/dist/session/manager.d.ts +11 -1
  184. package/dist/session/manager.js +46 -2
  185. package/dist/session/manager.js.map +1 -1
  186. package/dist/session/owner-lock.d.ts +208 -0
  187. package/dist/session/owner-lock.js +499 -0
  188. package/dist/session/owner-lock.js.map +1 -0
  189. package/dist/session/process-identity.js.map +1 -1
  190. package/dist/session/session.js +61 -7
  191. package/dist/session/session.js.map +1 -1
  192. package/dist/session/state-file.d.ts +74 -14
  193. package/dist/session/state-file.js +203 -21
  194. package/dist/session/state-file.js.map +1 -1
  195. package/package.json +7 -7
  196. package/dist/adapters/android/android-adapter.test-helpers.d.ts +0 -52
  197. package/dist/adapters/android/android-adapter.test-helpers.js +0 -115
  198. package/dist/adapters/android/android-adapter.test-helpers.js.map +0 -1
  199. package/dist/mcp/server.test-helpers.d.ts +0 -23
  200. package/dist/mcp/server.test-helpers.js +0 -49
  201. package/dist/mcp/server.test-helpers.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/mcp/tools/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;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;IACnC,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI;QAClC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI;QACnC,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IAChF,8EAA8E;IAC9E,iFAAiF;IACjF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IAEzD,MAAM,OAAO,GAA8B;QACzC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,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"}
@@ -52,11 +52,13 @@ export function startDebugTool(service) {
52
52
  replace: z
53
53
  .boolean()
54
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.'),
55
+ .describe('Take the project over when a run is already active: end that run via the end_session ' +
56
+ 'teardown (managed Chrome stopped; an attached browser only disconnected, its adopted ' +
57
+ 'tab first returned to its pre-run URL best-effort; profile lock freed) and start ' +
58
+ 'yours. Default false — the start is refused instead, naming the active session_id. ' +
59
+ 'Use this when the active run is yours and you lost its id, or it is stuck; it kills ' +
60
+ 'a run that may still be working. A run held by another ui-debugger-mcp server is ' +
61
+ 'never replaced.'),
60
62
  criteria: z
61
63
  .string()
62
64
  .optional()
@@ -1 +1 @@
1
- {"version":3,"file":"start-debug.js","sourceRoot":"","sources":["../../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C,CACH,CACJ,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Secret redaction — the value-keyed redactor a run binds to its auth persona.
3
+ *
4
+ * Neutral home (a sibling of `errors.ts`): the redactor is not a browser
5
+ * concern — the belt, the summary service and the findings store all apply it —
6
+ * so it lives here, with no adapter dependency.
7
+ */
8
+ /** A redactor: a line in, the same line with the run's secret values masked. */
9
+ export type Redactor = (text: string) => string;
10
+ /**
11
+ * Values a CONFIGURED auth persona types into the app (`targets.<t>.auth.<p>.fields`).
12
+ *
13
+ * The name-keyed redactors in `adapters/browser/log-format.ts` key off a NAME
14
+ * they recognize (`authorization`, `?password=`). A persona's values have no such
15
+ * tell: they land in a form POST body, in a `type` tool input on the agent
16
+ * trail, in whatever an adapter error echoes back. So this one keys off the
17
+ * VALUE — the only thing all three share — and is bound per run to the persona
18
+ * the caller named.
19
+ *
20
+ * Same posture as the other two: presence stays diagnostic (`<redacted, N chars>`
21
+ * still tells you a password of the right length was typed), the secret itself
22
+ * never reaches the durable trail. Form-encoded and JSON-escaped spellings are
23
+ * redacted too — a password with an `@` rides a form POST as `%40`, and matching
24
+ * only the plain text would leave the real body in `logs/network.log`.
25
+ *
26
+ * Longest first, so a value that contains another still redacts whole.
27
+ */
28
+ export declare function createSecretRedactor(secrets: readonly string[]): Redactor;
package/dist/redact.js ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Secret redaction — the value-keyed redactor a run binds to its auth persona.
3
+ *
4
+ * Neutral home (a sibling of `errors.ts`): the redactor is not a browser
5
+ * concern — the belt, the summary service and the findings store all apply it —
6
+ * so it lives here, with no adapter dependency.
7
+ */
8
+ /**
9
+ * Values a CONFIGURED auth persona types into the app (`targets.<t>.auth.<p>.fields`).
10
+ *
11
+ * The name-keyed redactors in `adapters/browser/log-format.ts` key off a NAME
12
+ * they recognize (`authorization`, `?password=`). A persona's values have no such
13
+ * tell: they land in a form POST body, in a `type` tool input on the agent
14
+ * trail, in whatever an adapter error echoes back. So this one keys off the
15
+ * VALUE — the only thing all three share — and is bound per run to the persona
16
+ * the caller named.
17
+ *
18
+ * Same posture as the other two: presence stays diagnostic (`<redacted, N chars>`
19
+ * still tells you a password of the right length was typed), the secret itself
20
+ * never reaches the durable trail. Form-encoded and JSON-escaped spellings are
21
+ * redacted too — a password with an `@` rides a form POST as `%40`, and matching
22
+ * only the plain text would leave the real body in `logs/network.log`.
23
+ *
24
+ * Longest first, so a value that contains another still redacts whole.
25
+ */
26
+ export function createSecretRedactor(secrets) {
27
+ const spellings = new Set();
28
+ for (const secret of secrets) {
29
+ if (secret.length === 0)
30
+ continue;
31
+ spellings.add(secret);
32
+ const encoded = encodeURIComponent(secret);
33
+ spellings.add(encoded);
34
+ spellings.add(encoded.replaceAll('%20', '+')); // form encoding spells a space `+`
35
+ spellings.add(JSON.stringify(secret).slice(1, -1)); // JSON body escaping
36
+ }
37
+ const values = [...spellings].sort((a, b) => b.length - a.length);
38
+ if (values.length === 0)
39
+ return (line) => line;
40
+ return (line) => {
41
+ let out = line;
42
+ for (const value of values) {
43
+ // `split`/`join`, not a regex: a credential is arbitrary text and escaping it
44
+ // for a pattern is one missed metacharacter away from not redacting at all.
45
+ if (out.includes(value))
46
+ out = out.split(value).join(`<redacted, ${value.length} chars>`);
47
+ }
48
+ return out;
49
+ };
50
+ }
51
+ //# sourceMappingURL=redact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.js","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA0B;IAC7D,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAClC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC3C,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACvB,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,mCAAmC;QAClF,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB;IAC3E,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAClE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;IAC/C,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,IAAI,GAAG,GAAG,IAAI,CAAC;QACf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,8EAA8E;YAC9E,4EAA4E;YAC5E,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;QAC5F,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The target catalog behind `describe` — the projection of configured targets
3
+ * onto their public, secret-free shape.
4
+ *
5
+ * Split out of `debug-service.ts` to keep that file under the 500-LOC cap. This
6
+ * half is PURE: no session, no manager, no fs — a target's config in, its
7
+ * public entry out. `managed` vs `attach` is DERIVED from the target itself (a
8
+ * `cdpUrl` / `adbSerial` means "connect to a running one", never start/stop it),
9
+ * `operational` from the host platform, and the persona NAMES are the only half
10
+ * of the auth block that ever leaves the config.
11
+ */
12
+ import type { Target } from '../config/schema.js';
13
+ import type { TargetInfo } from './debug-api.js';
14
+ /** Whether a target is in attach mode (connects to a running instance, never start/stop). */
15
+ export declare function isAttach(target: Target): boolean;
16
+ /**
17
+ * Project one configured target onto its public {@link TargetInfo} (no secrets).
18
+ *
19
+ * `operational` is DERIVED, never hardcoded: the adapter kind must be wired in
20
+ * this build AND supported on the host platform (see `adapters/availability.ts`).
21
+ */
22
+ export declare function describeTarget(name: string, target: Target, platform: NodeJS.Platform): TargetInfo;
23
+ /**
24
+ * The catalog `describe` reports — every configured target, or just the one
25
+ * named. An unknown name fails loud: a silently empty list would read as "this
26
+ * project has no targets" and send the caller looking for the wrong bug.
27
+ */
28
+ export declare function selectTargets(targets: Record<string, Target>, named: string | undefined, platform: NodeJS.Platform): TargetInfo[];
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The target catalog behind `describe` — the projection of configured targets
3
+ * onto their public, secret-free shape.
4
+ *
5
+ * Split out of `debug-service.ts` to keep that file under the 500-LOC cap. This
6
+ * half is PURE: no session, no manager, no fs — a target's config in, its
7
+ * public entry out. `managed` vs `attach` is DERIVED from the target itself (a
8
+ * `cdpUrl` / `adbSerial` means "connect to a running one", never start/stop it),
9
+ * `operational` from the host platform, and the persona NAMES are the only half
10
+ * of the auth block that ever leaves the config.
11
+ */
12
+ import { isAdapterOperational } from '../adapters/availability.js';
13
+ import { TargetNotFoundError } from '../errors.js';
14
+ /** Whether a target is in attach mode (connects to a running instance, never start/stop). */
15
+ export function isAttach(target) {
16
+ if (target.adapter === 'browser')
17
+ return target.cdpUrl != null;
18
+ if (target.adapter === 'android')
19
+ return target.adbSerial != null;
20
+ return false;
21
+ }
22
+ /**
23
+ * Project one configured target onto its public {@link TargetInfo} (no secrets).
24
+ *
25
+ * `operational` is DERIVED, never hardcoded: the adapter kind must be wired in
26
+ * this build AND supported on the host platform (see `adapters/availability.ts`).
27
+ */
28
+ export function describeTarget(name, target, platform) {
29
+ const base = {
30
+ name,
31
+ adapter: target.adapter,
32
+ mode: isAttach(target) ? 'attach' : 'managed',
33
+ operational: isAdapterOperational(target.adapter, platform),
34
+ // What the project declares is EXPECTED of this app — the driver already gets
35
+ // it in its prompt; the caller sees it here so "the table is empty" coming back
36
+ // as a non-finding is explainable without opening the config file.
37
+ ...(target.notes !== undefined && { notes: target.notes }),
38
+ };
39
+ if (target.adapter === 'browser') {
40
+ // Persona NAMES are the discoverable half — a caller can pick a valid `as`
41
+ // without opening the config file, and never sees the values.
42
+ const personas = Object.keys(target.auth ?? {});
43
+ return {
44
+ ...base,
45
+ url: target.url,
46
+ headless: target.headless,
47
+ ...(personas.length > 0 && { personas }),
48
+ };
49
+ }
50
+ return base;
51
+ }
52
+ /**
53
+ * The catalog `describe` reports — every configured target, or just the one
54
+ * named. An unknown name fails loud: a silently empty list would read as "this
55
+ * project has no targets" and send the caller looking for the wrong bug.
56
+ */
57
+ export function selectTargets(targets, named, platform) {
58
+ const entries = Object.entries(targets);
59
+ const selected = named === undefined ? entries : entries.filter(([name]) => name === named);
60
+ if (named !== undefined && selected.length === 0) {
61
+ throw new TargetNotFoundError(`target '${named}' not found in config.targets`);
62
+ }
63
+ return selected.map(([name, config]) => describeTarget(name, config, platform));
64
+ }
65
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/services/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,6FAA6F;AAC7F,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,IA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,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IAC5F,IAAI,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,mBAAmB,CAAC,WAAW,KAAK,+BAA+B,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClF,CAAC"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * The debug service's public contract — the types the outer MCP tools speak.
3
+ *
4
+ * Split out of `debug-service.ts` to keep that file under the 500-LOC cap: this
5
+ * is a dozen TYPE declarations with no runtime behaviour of their own. The
6
+ * service re-exports every name it exports today, so no importer changes.
7
+ */
8
+ import type { ResolvedConfig } from '../config/load.js';
9
+ import type { Target } from '../config/schema.js';
10
+ import type { Findings } from '../findings/schema.js';
11
+ import type { SessionManager } from '../session/manager.js';
12
+ import type { Session, SessionStatus, SnapshotField } from '../session/session.js';
13
+ import type { StatePort } from '../session/state-file.js';
14
+ import type { SessionBuilder } from './session-builder.js';
15
+ /** `start_debug` input — open a run for a configured target. */
16
+ export interface StartInput {
17
+ target: string;
18
+ goal: string;
19
+ criteria?: string;
20
+ /** Per-run URL the caller points the driver at (web); overrides the target's configured url. */
21
+ url?: string;
22
+ /**
23
+ * Named auth persona to open the run as — a key in the target's `auth` map. The
24
+ * run signs in out-of-band before the driver's first step; an unknown key fails
25
+ * loud rather than running the goal signed out.
26
+ */
27
+ as?: string;
28
+ /**
29
+ * Take the project over instead of being refused when a run is already active
30
+ * here: end that run first (through the `end_session` path), then start.
31
+ *
32
+ * OFF by default, and it must stay off by default — a silent takeover kills a
33
+ * healthy run its own caller is still watching. Opt in when the active run is
34
+ * yours and you lost its id (a compacted context, a crashed client) or it is
35
+ * stuck. Only ever replaces a run THIS server owns; one held by another live
36
+ * server is still refused ({@link SessionBusyError}), since its browser is not
37
+ * ours to close.
38
+ */
39
+ replace?: boolean;
40
+ /**
41
+ * Wall-clock cap (ms) before the run auto-ends, counted from THIS call — assembly,
42
+ * launch and the first navigation spend it too. Defaults to
43
+ * {@link DEFAULT_SESSION_TIMEOUT_MS}.
44
+ */
45
+ timeoutMs?: number;
46
+ }
47
+ /** `start_debug` output — the id to poll/redirect/end the run by. */
48
+ export interface StartResult {
49
+ session_id: string;
50
+ }
51
+ /** `send_message` input — inject a mid-run instruction. */
52
+ export interface SendInput {
53
+ session_id: string;
54
+ message: string;
55
+ }
56
+ /** `send_message` / `end_session` acknowledgement. */
57
+ export interface Ack {
58
+ ok: true;
59
+ session_id: string;
60
+ }
61
+ /** `get_findings` input — snapshot (optionally long-poll / project a subset). */
62
+ export interface GetFindingsInput {
63
+ session_id: string;
64
+ wait?: number;
65
+ fields?: SnapshotField[];
66
+ }
67
+ /** `describe` input — the whole catalog, or one target when named. */
68
+ export interface DescribeInput {
69
+ target?: string;
70
+ }
71
+ /** One target's public shape in the catalog (secrets stay out). */
72
+ export interface TargetInfo {
73
+ name: string;
74
+ adapter: Target['adapter'];
75
+ /** `managed` = the server launches/owns it; `attach` = it connects to a running one. */
76
+ mode: 'managed' | 'attach';
77
+ /**
78
+ * Whether this adapter kind is available HERE: wired in this build AND
79
+ * supported on the host platform. It is NOT a launch promise — the target may
80
+ * be down, or its browser/emulator/device missing or disconnected; that fails
81
+ * loud at launch.
82
+ */
83
+ operational: boolean;
84
+ /** Web target entry url, when applicable. */
85
+ url?: string;
86
+ /** Web headless flag, when applicable. */
87
+ headless?: boolean;
88
+ /**
89
+ * Named auth personas configured for this target — the valid `start_debug({as})`
90
+ * values. NAMES ONLY; the credentials never leave `.ui-debugger-mcp.json`.
91
+ * Absent when the target has no `auth` block.
92
+ */
93
+ personas?: string[];
94
+ /**
95
+ * The target's standing `notes` — what is EXPECTED of this app (seeded data,
96
+ * onboarding modals, dark mode), verbatim from config. Also composed into the
97
+ * driver's prompt; surfaced here so a caller can see what the run was told.
98
+ */
99
+ notes?: string;
100
+ }
101
+ /**
102
+ * The run this server holds for the project, as `describe` reports it — the way
103
+ * back in-band for a caller that lost its `session_id` (a compacted context, a
104
+ * client restart). Without it the only recovery was the out-of-band CLI.
105
+ */
106
+ export interface RunInfo {
107
+ /** Pass to `get_findings` / `send_message` / `end_session`. */
108
+ id: string;
109
+ /** `running`, or the verdict it settled on (still readable, still holding the slot). */
110
+ status: SessionStatus;
111
+ /** The goal this run was started with — enough to tell whose run it is. */
112
+ goal: string;
113
+ }
114
+ /** `describe` output — configured targets plus the resolved models + workspace. */
115
+ export interface DescribeResult {
116
+ targets: TargetInfo[];
117
+ models: {
118
+ driver: string;
119
+ vision: string;
120
+ summary: string;
121
+ };
122
+ /** Resolved per-project workspace root (`<base>/<project>`) — where evidence lands. */
123
+ workspace: string;
124
+ /**
125
+ * The active run for this project (or the retained snapshot of the last one that
126
+ * auto-ended). Absent when this server holds no run. A run another live server
127
+ * owns is NOT reported here — `start_debug` names that one in its refusal.
128
+ */
129
+ session?: RunInfo;
130
+ }
131
+ /** The surface the outer MCP tools call. Implemented by {@link DebugService}. */
132
+ export interface DebugApi {
133
+ start(input: StartInput): Promise<StartResult>;
134
+ send(input: SendInput): Ack;
135
+ getFindings(input: GetFindingsInput): Promise<Findings | Partial<Findings>>;
136
+ describe(input: DescribeInput): DescribeResult;
137
+ end(input: EndInput): Promise<Ack>;
138
+ }
139
+ /** `end_session` input. */
140
+ export interface EndInput {
141
+ session_id: string;
142
+ }
143
+ /** Everything the service needs, wired at boot. */
144
+ export interface DebugServiceDeps {
145
+ /** The cwd-keyed registry (one run per project). */
146
+ manager: SessionManager<Session>;
147
+ /** Resolved project config — backs `describe` + target validation. */
148
+ config: ResolvedConfig;
149
+ /** This project's session key (one project = one cwd = one session). */
150
+ cwd: string;
151
+ /** Seam to the heavy session assembly; injected so `start` stays testable. */
152
+ build: SessionBuilder;
153
+ /** Cross-process run breadcrumb (`state.json`) for the CLI; defaults to a no-op. */
154
+ state?: StatePort;
155
+ /** Default wall-clock cap (ms) for a run; defaults to {@link DEFAULT_SESSION_TIMEOUT_MS}. */
156
+ defaultTimeoutMs?: number;
157
+ /** Injected clock (epoch ms) for session ids + the run deadline; defaults to `Date.now`. */
158
+ now?: () => number;
159
+ /**
160
+ * The host platform the adapter-availability rule is evaluated against;
161
+ * defaults to `process.platform`. Injected so `describe` reports the same
162
+ * fact on every host (the tests pin it).
163
+ */
164
+ platform?: NodeJS.Platform;
165
+ /**
166
+ * Has `.ui-debugger-mcp.json` changed since boot? Config is resolved once and
167
+ * wired into long-lived objects, so a changed file means every later run would
168
+ * silently use the OLD settings — see `config/fingerprint.ts`. Defaults to
169
+ * "never changed" (unit tests hold no file).
170
+ */
171
+ configChanged?: () => boolean;
172
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The debug service's public contract — the types the outer MCP tools speak.
3
+ *
4
+ * Split out of `debug-service.ts` to keep that file under the 500-LOC cap: this
5
+ * is a dozen TYPE declarations with no runtime behaviour of their own. The
6
+ * service re-exports every name it exports today, so no importer changes.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=debug-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-api.js","sourceRoot":"","sources":["../../src/services/debug-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}