@developerz.ai/ui-debugger-mcp 1.8.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.
- package/README.md +70 -52
- package/dist/adapters/android/adb.d.ts +19 -7
- package/dist/adapters/android/adb.js +50 -13
- package/dist/adapters/android/adb.js.map +1 -1
- package/dist/adapters/android/android-adapter.d.ts +42 -2
- package/dist/adapters/android/android-adapter.js +366 -36
- package/dist/adapters/android/android-adapter.js.map +1 -1
- package/dist/adapters/android/commands.js.map +1 -1
- package/dist/adapters/android/ports.js.map +1 -1
- package/dist/adapters/android/sdk.d.ts +65 -0
- package/dist/adapters/android/sdk.js +107 -0
- package/dist/adapters/android/sdk.js.map +1 -0
- package/dist/adapters/android/uiautomator.d.ts +23 -7
- package/dist/adapters/android/uiautomator.js +31 -7
- package/dist/adapters/android/uiautomator.js.map +1 -1
- package/dist/adapters/availability.d.ts +39 -0
- package/dist/adapters/availability.js +62 -0
- package/dist/adapters/availability.js.map +1 -0
- package/dist/adapters/browser/browser-adapter.d.ts +12 -22
- package/dist/adapters/browser/browser-adapter.js +133 -67
- package/dist/adapters/browser/browser-adapter.js.map +1 -1
- package/dist/adapters/browser/cdp.d.ts +15 -7
- package/dist/adapters/browser/cdp.js +25 -3
- package/dist/adapters/browser/cdp.js.map +1 -1
- package/dist/adapters/browser/filters.d.ts +1 -1
- package/dist/adapters/browser/filters.js.map +1 -1
- package/dist/adapters/browser/geometry.js.map +1 -1
- package/dist/adapters/browser/launch.d.ts +14 -5
- package/dist/adapters/browser/launch.js +14 -5
- package/dist/adapters/browser/launch.js.map +1 -1
- package/dist/adapters/browser/lifecycle.d.ts +58 -0
- package/dist/adapters/browser/lifecycle.js +98 -0
- package/dist/adapters/browser/lifecycle.js.map +1 -0
- package/dist/adapters/browser/log-filters.d.ts +2 -2
- package/dist/adapters/browser/log-filters.js.map +1 -1
- package/dist/adapters/browser/log-format.d.ts +14 -23
- package/dist/adapters/browser/log-format.js +16 -55
- package/dist/adapters/browser/log-format.js.map +1 -1
- package/dist/adapters/browser/tab-context.d.ts +30 -0
- package/dist/adapters/browser/tab-context.js +41 -0
- package/dist/adapters/browser/tab-context.js.map +1 -0
- package/dist/adapters/contract.d.ts +111 -5
- package/dist/adapters/contract.js +7 -2
- package/dist/adapters/contract.js.map +1 -1
- package/dist/adapters/desktop/atspi-busctl.d.ts +26 -0
- package/dist/adapters/desktop/atspi-busctl.js +330 -0
- package/dist/adapters/desktop/atspi-busctl.js.map +1 -0
- package/dist/adapters/desktop/atspi-parse.d.ts +39 -0
- package/dist/adapters/desktop/atspi-parse.js +155 -0
- package/dist/adapters/desktop/atspi-parse.js.map +1 -0
- package/dist/adapters/desktop/atspi.d.ts +75 -50
- package/dist/adapters/desktop/atspi.js +64 -285
- package/dist/adapters/desktop/atspi.js.map +1 -1
- package/dist/adapters/desktop/capture.d.ts +11 -20
- package/dist/adapters/desktop/capture.js +68 -37
- package/dist/adapters/desktop/capture.js.map +1 -1
- package/dist/adapters/desktop/desktop-adapter.d.ts +20 -2
- package/dist/adapters/desktop/desktop-adapter.js +91 -9
- package/dist/adapters/desktop/desktop-adapter.js.map +1 -1
- package/dist/adapters/desktop/input.d.ts +18 -4
- package/dist/adapters/desktop/input.js +15 -10
- package/dist/adapters/desktop/input.js.map +1 -1
- package/dist/adapters/desktop/proc.d.ts +32 -4
- package/dist/adapters/desktop/proc.js +33 -6
- package/dist/adapters/desktop/proc.js.map +1 -1
- package/dist/adapters/factory.d.ts +12 -5
- package/dist/adapters/factory.js +29 -3
- package/dist/adapters/factory.js.map +1 -1
- package/dist/adapters/log-format.d.ts +32 -0
- package/dist/adapters/log-format.js +39 -0
- package/dist/adapters/log-format.js.map +1 -0
- package/dist/agent/belt/act.d.ts +440 -21
- package/dist/agent/belt/act.js +43 -6
- package/dist/agent/belt/act.js.map +1 -1
- package/dist/agent/belt/look.d.ts +471 -14
- package/dist/agent/belt/look.js +74 -12
- package/dist/agent/belt/look.js.map +1 -1
- package/dist/agent/belt/observe.d.ts +663 -42
- package/dist/agent/belt/observe.js +76 -12
- package/dist/agent/belt/observe.js.map +1 -1
- package/dist/agent/belt/report.d.ts +754 -48
- package/dist/agent/belt/report.js +121 -38
- package/dist/agent/belt/report.js.map +1 -1
- package/dist/agent/belt/trail.d.ts +44 -16
- package/dist/agent/belt/trail.js +46 -11
- package/dist/agent/belt/trail.js.map +1 -1
- package/dist/agent/capabilities.js.map +1 -1
- package/dist/agent/fallback.d.ts +33 -0
- package/dist/agent/fallback.js +84 -0
- package/dist/agent/fallback.js.map +1 -0
- package/dist/agent/loop.d.ts +54 -52
- package/dist/agent/loop.js +173 -176
- package/dist/agent/loop.js.map +1 -1
- package/dist/agent/models.d.ts +10 -6
- package/dist/agent/models.js +15 -9
- package/dist/agent/models.js.map +1 -1
- package/dist/agent/prompts/compose.d.ts +1 -1
- package/dist/agent/prompts/debug-agent.js +45 -8
- package/dist/agent/prompts/debug-agent.js.map +1 -1
- package/dist/agent/prompts/web-addendum.d.ts +1 -1
- package/dist/agent/prompts/web-addendum.js +15 -3
- package/dist/agent/prompts/web-addendum.js.map +1 -1
- package/dist/agent/provider.d.ts +38 -0
- package/dist/agent/provider.js +55 -3
- package/dist/agent/provider.js.map +1 -1
- package/dist/boot.d.ts +64 -0
- package/dist/boot.js +145 -0
- package/dist/boot.js.map +1 -0
- package/dist/cli/chromium-libs.d.ts +262 -0
- package/dist/cli/chromium-libs.js +522 -0
- package/dist/cli/chromium-libs.js.map +1 -0
- package/dist/cli/control.js +51 -9
- package/dist/cli/control.js.map +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/init.d.ts +54 -3
- package/dist/cli/init.js +89 -24
- package/dist/cli/init.js.map +1 -1
- package/dist/config/fingerprint.d.ts +6 -1
- package/dist/config/fingerprint.js +8 -4
- package/dist/config/fingerprint.js.map +1 -1
- package/dist/config/load.d.ts +50 -10
- package/dist/config/load.js +93 -27
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +18 -6
- package/dist/config/schema.js +22 -7
- package/dist/config/schema.js.map +1 -1
- package/dist/errors.d.ts +14 -0
- package/dist/errors.js +18 -0
- package/dist/errors.js.map +1 -1
- package/dist/findings/schema.d.ts +44 -6
- package/dist/findings/schema.js +39 -3
- package/dist/findings/schema.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.js +4 -76
- package/dist/main.js.map +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/describe.d.ts +5 -4
- package/dist/mcp/tools/describe.js +14 -10
- package/dist/mcp/tools/describe.js.map +1 -1
- package/dist/mcp/tools/end-session.d.ts +3 -1
- package/dist/mcp/tools/end-session.js +7 -3
- package/dist/mcp/tools/end-session.js.map +1 -1
- package/dist/mcp/tools/output.d.ts +5 -4
- package/dist/mcp/tools/output.js +10 -2
- package/dist/mcp/tools/output.js.map +1 -1
- package/dist/mcp/tools/result.d.ts +10 -1
- package/dist/mcp/tools/result.js +8 -6
- package/dist/mcp/tools/result.js.map +1 -1
- package/dist/mcp/tools/start-debug.js +7 -5
- package/dist/mcp/tools/start-debug.js.map +1 -1
- package/dist/redact.d.ts +28 -0
- package/dist/redact.js +51 -0
- package/dist/redact.js.map +1 -0
- package/dist/services/catalog.d.ts +28 -0
- package/dist/services/catalog.js +65 -0
- package/dist/services/catalog.js.map +1 -0
- package/dist/services/debug-api.d.ts +172 -0
- package/dist/services/debug-api.js +9 -0
- package/dist/services/debug-api.js.map +1 -0
- package/dist/services/debug-service.d.ts +25 -173
- package/dist/services/debug-service.js +108 -175
- package/dist/services/debug-service.js.map +1 -1
- package/dist/services/login.d.ts +7 -2
- package/dist/services/login.js +210 -10
- package/dist/services/login.js.map +1 -1
- package/dist/services/retained-snapshot.d.ts +36 -0
- package/dist/services/retained-snapshot.js +63 -0
- package/dist/services/retained-snapshot.js.map +1 -0
- package/dist/services/session-builder.d.ts +26 -0
- package/dist/services/session-builder.js +46 -19
- package/dist/services/session-builder.js.map +1 -1
- package/dist/services/start-guards.d.ts +32 -0
- package/dist/services/start-guards.js +50 -0
- package/dist/services/start-guards.js.map +1 -0
- package/dist/services/summarize.d.ts +12 -3
- package/dist/services/summarize.js +13 -5
- package/dist/services/summarize.js.map +1 -1
- package/dist/session/cleanup.js.map +1 -1
- package/dist/session/findings-store.d.ts +2 -1
- package/dist/session/findings-store.js +30 -2
- package/dist/session/findings-store.js.map +1 -1
- package/dist/session/live-pointer.d.ts +19 -0
- package/dist/session/live-pointer.js +41 -0
- package/dist/session/live-pointer.js.map +1 -0
- package/dist/session/manager.d.ts +11 -1
- package/dist/session/manager.js +46 -2
- package/dist/session/manager.js.map +1 -1
- package/dist/session/owner-lock.d.ts +208 -0
- package/dist/session/owner-lock.js +499 -0
- package/dist/session/owner-lock.js.map +1 -0
- package/dist/session/process-identity.js.map +1 -1
- package/dist/session/session.js +61 -7
- package/dist/session/session.js.map +1 -1
- package/dist/session/state-file.d.ts +74 -14
- package/dist/session/state-file.js +203 -21
- package/dist/session/state-file.js.map +1 -1
- package/package.json +7 -7
- package/dist/adapters/android/android-adapter.test-helpers.d.ts +0 -52
- package/dist/adapters/android/android-adapter.test-helpers.js +0 -115
- package/dist/adapters/android/android-adapter.test-helpers.js.map +0 -1
- package/dist/mcp/server.test-helpers.d.ts +0 -23
- package/dist/mcp/server.test-helpers.js +0 -49
- package/dist/mcp/server.test-helpers.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { resolveModels } from './agent/models.js';
|
|
4
|
-
import { createOpenRouterProvider, resolveProviderConfig } from './agent/provider.js';
|
|
2
|
+
import { bootServer } from './boot.js';
|
|
5
3
|
import { runStatus, runStop } from './cli/control.js';
|
|
6
4
|
import { printUsage, runHelp, runVersion } from './cli/help.js';
|
|
7
5
|
import { runInit } from './cli/init.js';
|
|
8
|
-
import { makeConfigWatch } from './config/fingerprint.js';
|
|
9
|
-
import { loadConfig } from './config/load.js';
|
|
10
6
|
import { NAME, VERSION } from './index.js';
|
|
11
|
-
import { startStdioServer } from './mcp/server.js';
|
|
12
|
-
import { outerTools } from './mcp/tools/index.js';
|
|
13
|
-
import { DebugService } from './services/debug-service.js';
|
|
14
|
-
import { makeSessionBuilder } from './services/session-builder.js';
|
|
15
|
-
import { createShutdown } from './services/shutdown.js';
|
|
16
|
-
import { SessionManager } from './session/manager.js';
|
|
17
|
-
import { FileStatePort } from './session/state-file.js';
|
|
18
|
-
import { ensureWorkspace, workspacePaths } from './session/workspace.js';
|
|
19
7
|
async function main() {
|
|
20
8
|
// Dispatch help/version and CLI subcommands before loading project config (none need API key).
|
|
21
9
|
const [, , subcmd] = process.argv;
|
|
@@ -51,69 +39,9 @@ async function main() {
|
|
|
51
39
|
process.exit(1);
|
|
52
40
|
}
|
|
53
41
|
try {
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Bootstrap workspace directories (chrome-user-data/, sessions/).
|
|
58
|
-
// A relative workspace anchors at the project root; an absolute (shared) one
|
|
59
|
-
// gets a cwd-derived project dir — see `workspacePaths`.
|
|
60
|
-
const workspace = workspacePaths(cwd, config.workspace);
|
|
61
|
-
await ensureWorkspace(workspace);
|
|
62
|
-
// Resolve provider + per-role models (driver, vision, summary)
|
|
63
|
-
const providerOptions = {
|
|
64
|
-
apiKey: config.provider.apiKey,
|
|
65
|
-
baseURL: config.provider.baseUrl,
|
|
66
|
-
};
|
|
67
|
-
const provider = createOpenRouterProvider(providerOptions);
|
|
68
|
-
const roleModels = resolveModels(provider, config.models);
|
|
69
|
-
// Self-look: control + vision on the SAME model AND the provider catalog
|
|
70
|
-
// confirms it takes image input → `look` hands the frame to the driver
|
|
71
|
-
// itself (full context, no second call). Unknown capability (null) keeps
|
|
72
|
-
// the safe separate-call path — its vision latch fails soft, while an
|
|
73
|
-
// image pushed at a text-only driver would poison every later step.
|
|
74
|
-
let selfLook = false;
|
|
75
|
-
if (config.models.driver === config.models.vision) {
|
|
76
|
-
const { apiKey, baseURL } = resolveProviderConfig(providerOptions);
|
|
77
|
-
selfLook = (await supportsImageInput(baseURL, apiKey, config.models.driver)) === true;
|
|
78
|
-
}
|
|
79
|
-
// Wire the debug session service
|
|
80
|
-
const manager = new SessionManager();
|
|
81
|
-
const builder = makeSessionBuilder({
|
|
82
|
-
config,
|
|
83
|
-
models: {
|
|
84
|
-
driver: roleModels.driver,
|
|
85
|
-
vision: roleModels.vision,
|
|
86
|
-
summary: roleModels.summary,
|
|
87
|
-
selfLook,
|
|
88
|
-
},
|
|
89
|
-
workspace,
|
|
90
|
-
});
|
|
91
|
-
const service = new DebugService({
|
|
92
|
-
manager,
|
|
93
|
-
config,
|
|
94
|
-
cwd,
|
|
95
|
-
build: builder,
|
|
96
|
-
state: new FileStatePort(workspace),
|
|
97
|
-
// Everything above was resolved from the config file as it read a moment
|
|
98
|
-
// ago; if it changes underneath us, say so instead of running on stale wiring.
|
|
99
|
-
configChanged: makeConfigWatch(cwd),
|
|
100
|
-
});
|
|
101
|
-
// Graceful stop: a CLI `stop` (or any SIGTERM/SIGINT) tears the run down —
|
|
102
|
-
// abort the loop, close the browser, free the profile — then exits cleanly.
|
|
103
|
-
// Bounded: a teardown that wedges (a tool call that never observes its abort)
|
|
104
|
-
// must not leave the process alive forever, because `stop` only signals once.
|
|
105
|
-
const shutdown = createShutdown({
|
|
106
|
-
endActive: () => service.endActive(),
|
|
107
|
-
exit: (exitCode) => process.exit(exitCode),
|
|
108
|
-
});
|
|
109
|
-
process.once('SIGTERM', () => shutdown(0));
|
|
110
|
-
process.once('SIGINT', () => shutdown(130));
|
|
111
|
-
// Boot stdio MCP server with outer tools. A dead client is a shutdown too:
|
|
112
|
-
// nothing can read findings or `end_session` any more, so the run must not
|
|
113
|
-
// keep a browser (and the profile lock) alive until its cap. Same idempotent
|
|
114
|
-
// teardown path as the signals above.
|
|
115
|
-
const tools = outerTools(service);
|
|
116
|
-
await startStdioServer(tools, { onClose: () => shutdown(0) });
|
|
42
|
+
// The boot owns the server: the owner-lock backend gate, then the config,
|
|
43
|
+
// the workspace, the provider/models and the stdio MCP server.
|
|
44
|
+
await bootServer(process.cwd());
|
|
117
45
|
}
|
|
118
46
|
catch (err) {
|
|
119
47
|
console.error(`${NAME} v${VERSION}: ${err instanceof Error ? err.message : String(err)}`);
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,+FAA+F;IAC/F,MAAM,CAAC,EAAE,AAAD,EAAG,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAElC,qCAAqC;IACrC,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAC3C,OAAO,EAAE,CAAC;QACV,OAAO;IACT,CAAC;IACD,IAAI,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAC9C,UAAU,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IAED,mCAAmC;IACnC,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAClE,IAAI,CAAC;YACH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AE;aACP,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;aACtB,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEhC,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `describe` — list this project's debug targets + resolved models/workspace.
|
|
3
3
|
*
|
|
4
|
-
* The smart agent's lazy catalog: what targets are configured (and
|
|
5
|
-
* wired
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The smart agent's lazy catalog: what targets are configured (and whether each
|
|
5
|
+
* adapter kind is wired in this build and supported on the host platform — a
|
|
6
|
+
* wiring/capability fact, not a promise the target is up), so it knows valid
|
|
7
|
+
* `target` values for `start_debug` without reading the config file. Pass `target`
|
|
8
|
+
* to narrow to one. Thin handler: Zod-validate, call {@link DebugApi.describe}.
|
|
8
9
|
*/
|
|
9
10
|
import type { DebugApi } from '../../services/debug-service.js';
|
|
10
11
|
import type { McpTool } from '../server.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `describe` — list this project's debug targets + resolved models/workspace.
|
|
3
3
|
*
|
|
4
|
-
* The smart agent's lazy catalog: what targets are configured (and
|
|
5
|
-
* wired
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The smart agent's lazy catalog: what targets are configured (and whether each
|
|
5
|
+
* adapter kind is wired in this build and supported on the host platform — a
|
|
6
|
+
* wiring/capability fact, not a promise the target is up), so it knows valid
|
|
7
|
+
* `target` values for `start_debug` without reading the config file. Pass `target`
|
|
8
|
+
* to narrow to one. Thin handler: Zod-validate, call {@link DebugApi.describe}.
|
|
8
9
|
*/
|
|
9
10
|
import { z } from 'zod';
|
|
10
11
|
import { DescribeResultSchema } from './output.js';
|
|
@@ -16,12 +17,15 @@ export function describeTool(service) {
|
|
|
16
17
|
register(server) {
|
|
17
18
|
server.registerTool('describe', {
|
|
18
19
|
title: 'Describe debug targets',
|
|
19
|
-
description: 'List the configured targets for this project (name, adapter, managed|attach,
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
20
|
+
description: 'List the configured targets for this project (name, adapter, managed|attach, ' +
|
|
21
|
+
'operational — whether the adapter kind is wired in this build and supported on the ' +
|
|
22
|
+
'host platform; a wiring/capability fact, NOT a promise the target is up or that ' +
|
|
23
|
+
'start_debug will succeed), web url/headless, any named auth personas, and the ' +
|
|
24
|
+
"target's standing notes — what is expected of the app) plus the resolved per-role " +
|
|
25
|
+
'models and workspace. Call this first to pick a valid target — and a valid `as` ' +
|
|
26
|
+
'persona — for start_debug. Pass target to narrow to one. Also reports `session`: ' +
|
|
27
|
+
'the run this project currently holds, so a lost session_id can be adopted or ' +
|
|
28
|
+
'ended instead of blocking the next start_debug.',
|
|
25
29
|
annotations: {
|
|
26
30
|
readOnlyHint: true,
|
|
27
31
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/mcp/tools/describe.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/mcp/tools/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,OAAiB;IAC5C,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,QAAQ,CAAC,MAAM;YACb,MAAM,CAAC,YAAY,CACjB,UAAU,EACV;gBACE,KAAK,EAAE,wBAAwB;gBAC/B,WAAW,EACT,+EAA+E;oBAC/E,qFAAqF;oBACrF,kFAAkF;oBAClF,gFAAgF;oBAChF,oFAAoF;oBACpF,kFAAkF;oBAClF,mFAAmF;oBACnF,+EAA+E;oBAC/E,iDAAiD;gBACnD,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"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* `end_session` — stop and tear down the active run.
|
|
3
3
|
*
|
|
4
4
|
* Aborts the loop, closes the target adapter (managed: stops Chrome; attach:
|
|
5
|
-
* disconnects only
|
|
5
|
+
* disconnects only — web attach first returns its adopted tab to its pre-run
|
|
6
|
+
* URL, best-effort: skipped when the run never moved the tab and a failed
|
|
7
|
+
* navigation is swallowed), and frees the project's profile lock. Thin handler:
|
|
6
8
|
* Zod-validate, call {@link DebugApi.end}, ack.
|
|
7
9
|
*/
|
|
8
10
|
import type { DebugApi } from '../../services/debug-service.js';
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* `end_session` — stop and tear down the active run.
|
|
3
3
|
*
|
|
4
4
|
* Aborts the loop, closes the target adapter (managed: stops Chrome; attach:
|
|
5
|
-
* disconnects only
|
|
5
|
+
* disconnects only — web attach first returns its adopted tab to its pre-run
|
|
6
|
+
* URL, best-effort: skipped when the run never moved the tab and a failed
|
|
7
|
+
* navigation is swallowed), and frees the project's profile lock. Thin handler:
|
|
6
8
|
* Zod-validate, call {@link DebugApi.end}, ack.
|
|
7
9
|
*/
|
|
8
10
|
import { z } from 'zod';
|
|
@@ -16,8 +18,10 @@ export function endSessionTool(service) {
|
|
|
16
18
|
server.registerTool('end_session', {
|
|
17
19
|
title: 'End the debug run',
|
|
18
20
|
description: 'Close the active run: abort the loop, release the target (managed Chrome is stopped; an ' +
|
|
19
|
-
'attached browser is only disconnected
|
|
20
|
-
'run
|
|
21
|
+
'attached browser is only disconnected — web attach first returns its adopted tab to its ' +
|
|
22
|
+
'pre-run URL, best-effort: skipped when the run never moved the tab and a failed navigation ' +
|
|
23
|
+
'is swallowed), and free the project lock so a new start_debug can run. The last ' +
|
|
24
|
+
'get_findings snapshot remains on disk.',
|
|
21
25
|
annotations: {
|
|
22
26
|
idempotentHint: true,
|
|
23
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"end-session.js","sourceRoot":"","sources":["../../../src/mcp/tools/end-session.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"end-session.js","sourceRoot":"","sources":["../../../src/mcp/tools/end-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,qEAAqE;AACrE,MAAM,UAAU,cAAc,CAAC,OAAiB;IAC9C,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,QAAQ,CAAC,MAAM;YACb,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;gBACE,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EACT,0FAA0F;oBAC1F,0FAA0F;oBAC1F,6FAA6F;oBAC7F,kFAAkF;oBAClF,wCAAwC;gBAC1C,WAAW,EAAE;oBACX,cAAc,EAAE,IAAI;iBACrB;gBACD,WAAW,EAAE;oBACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;iBAC1E;gBACD,YAAY,EAAE,SAAS;aACxB,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CACtD,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -29,13 +29,13 @@ export declare const DescribeResultSchema: z.ZodObject<{
|
|
|
29
29
|
targets: z.ZodArray<z.ZodObject<{
|
|
30
30
|
name: z.ZodString;
|
|
31
31
|
adapter: z.ZodEnum<{
|
|
32
|
+
android: "android";
|
|
32
33
|
browser: "browser";
|
|
33
34
|
desktop: "desktop";
|
|
34
|
-
android: "android";
|
|
35
35
|
}>;
|
|
36
36
|
mode: z.ZodEnum<{
|
|
37
|
-
managed: "managed";
|
|
38
37
|
attach: "attach";
|
|
38
|
+
managed: "managed";
|
|
39
39
|
}>;
|
|
40
40
|
operational: z.ZodBoolean;
|
|
41
41
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -47,14 +47,15 @@ export declare const DescribeResultSchema: z.ZodObject<{
|
|
|
47
47
|
driver: z.ZodString;
|
|
48
48
|
vision: z.ZodString;
|
|
49
49
|
summary: z.ZodString;
|
|
50
|
+
fallback: z.ZodString;
|
|
50
51
|
}, z.core.$strip>;
|
|
51
52
|
workspace: z.ZodString;
|
|
52
53
|
session: z.ZodOptional<z.ZodObject<{
|
|
53
54
|
id: z.ZodString;
|
|
54
55
|
status: z.ZodEnum<{
|
|
55
|
-
running: "running";
|
|
56
|
-
passed: "passed";
|
|
57
56
|
failed: "failed";
|
|
57
|
+
passed: "passed";
|
|
58
|
+
running: "running";
|
|
58
59
|
}>;
|
|
59
60
|
goal: z.ZodString;
|
|
60
61
|
}, z.core.$strip>>;
|
package/dist/mcp/tools/output.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* `get-findings.ts`.
|
|
16
16
|
*/
|
|
17
17
|
import { z } from 'zod';
|
|
18
|
+
import { FINDINGS_STATUSES } from '../../findings/schema.js';
|
|
18
19
|
/** `start_debug` output — the id every later call is keyed by. */
|
|
19
20
|
export const StartResultSchema = z.object({
|
|
20
21
|
session_id: z
|
|
@@ -36,7 +37,11 @@ const TargetInfoSchema = z.object({
|
|
|
36
37
|
mode: z
|
|
37
38
|
.enum(['managed', 'attach'])
|
|
38
39
|
.describe('managed = the server launches and owns it; attach = it connects to a running one.'),
|
|
39
|
-
operational: z
|
|
40
|
+
operational: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.describe('Whether the adapter kind of this target is wired in this build and supported on the ' +
|
|
43
|
+
'host platform (false otherwise). A wiring/capability fact — it does NOT mean the target ' +
|
|
44
|
+
'is up, nor that a later start_debug will succeed.'),
|
|
40
45
|
url: z.string().optional().describe('Entry url (web targets only).'),
|
|
41
46
|
headless: z.boolean().optional().describe('Headless flag (web targets only).'),
|
|
42
47
|
personas: z
|
|
@@ -58,7 +63,7 @@ const RunInfoSchema = z.object({
|
|
|
58
63
|
.min(1)
|
|
59
64
|
.describe('Session id — pass to get_findings, send_message and end_session.'),
|
|
60
65
|
status: z
|
|
61
|
-
.enum(
|
|
66
|
+
.enum(FINDINGS_STATUSES)
|
|
62
67
|
.describe('running, or the verdict it settled on (still readable, still holding the project).'),
|
|
63
68
|
goal: z.string().describe('The goal this run was started with.'),
|
|
64
69
|
});
|
|
@@ -70,6 +75,9 @@ export const DescribeResultSchema = z.object({
|
|
|
70
75
|
driver: z.string().describe('Fast guy — drives the target (text-only).'),
|
|
71
76
|
vision: z.string().describe('Vision guy — judges screenshots.'),
|
|
72
77
|
summary: z.string().describe('Compresses findings for the caller.'),
|
|
78
|
+
fallback: z
|
|
79
|
+
.string()
|
|
80
|
+
.describe('Paid model that takes any call a role primary cannot serve (rate limit, outage, empty).'),
|
|
73
81
|
})
|
|
74
82
|
.describe('Resolved per-role model ids.'),
|
|
75
83
|
workspace: z.string().describe('Per-project workspace path; evidence lands under it.'),
|
|
@@ -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;
|
|
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;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAS7D,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,I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,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;QACnE,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,CACP,yFAAyF,CAC1F;KACJ,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"}
|
|
@@ -13,11 +13,18 @@
|
|
|
13
13
|
* retrieval that returns it whole. Never capped without both — a dropped entry
|
|
14
14
|
* the caller cannot ask for again is silent data loss, and prose alone lets a
|
|
15
15
|
* caller that skips the note conclude there were exactly 20 findings.
|
|
16
|
-
* - **`resource_link`s**: evidence paths (screenshots, `replay.mp4
|
|
16
|
+
* - **`resource_link`s**: evidence paths (screenshots, `replay.mp4`) ride
|
|
17
17
|
* as `resource_link` content items (file:// URIs) alongside the text block —
|
|
18
18
|
* the spec-blessed form, not inline path strings the caller has to notice.
|
|
19
19
|
*/
|
|
20
20
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
21
|
+
/** Cap on a top-level array field before it gets truncated for the response. */
|
|
22
|
+
export declare const MAX_LIST_ITEMS = 20;
|
|
23
|
+
/** Keys whose string value — when an absolute path — is evidence worth linking.
|
|
24
|
+
* Sourced from the findings schema — the canonical owner of findings field names. */
|
|
25
|
+
export declare const EVIDENCE_KEYS: ReadonlySet<string>;
|
|
26
|
+
/** Guess a MIME type from an evidence path's extension; omit when unknown. */
|
|
27
|
+
export declare function mimeTypeFor(path: string): string | undefined;
|
|
21
28
|
/** How much of one capped list actually came back. */
|
|
22
29
|
export interface Truncation {
|
|
23
30
|
/** Items in this response. */
|
|
@@ -30,6 +37,8 @@ export interface Truncation {
|
|
|
30
37
|
* under. Findings has no field by this name, so it can never shadow real data.
|
|
31
38
|
*/
|
|
32
39
|
export declare const TRUNCATED_KEY = "truncated";
|
|
40
|
+
/** Steering text appended when one or more lists got capped. */
|
|
41
|
+
export declare function steeringNote(truncated: string[]): string;
|
|
33
42
|
/** Per-call switches for {@link toToolResult}. */
|
|
34
43
|
export interface ToolResultOptions {
|
|
35
44
|
/**
|
package/dist/mcp/tools/result.js
CHANGED
|
@@ -13,20 +13,22 @@
|
|
|
13
13
|
* retrieval that returns it whole. Never capped without both — a dropped entry
|
|
14
14
|
* the caller cannot ask for again is silent data loss, and prose alone lets a
|
|
15
15
|
* caller that skips the note conclude there were exactly 20 findings.
|
|
16
|
-
* - **`resource_link`s**: evidence paths (screenshots, `replay.mp4
|
|
16
|
+
* - **`resource_link`s**: evidence paths (screenshots, `replay.mp4`) ride
|
|
17
17
|
* as `resource_link` content items (file:// URIs) alongside the text block —
|
|
18
18
|
* the spec-blessed form, not inline path strings the caller has to notice.
|
|
19
19
|
*/
|
|
20
|
+
import { EVIDENCE_FIELD_NAMES } from '../../findings/schema.js';
|
|
20
21
|
/** A plain object value (not an array) — what every outer tool returns. */
|
|
21
22
|
function isRecord(value) {
|
|
22
23
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
23
24
|
}
|
|
24
25
|
/** Cap on a top-level array field before it gets truncated for the response. */
|
|
25
|
-
const MAX_LIST_ITEMS = 20;
|
|
26
|
-
/** Keys whose string value — when an absolute path — is evidence worth linking.
|
|
27
|
-
|
|
26
|
+
export const MAX_LIST_ITEMS = 20;
|
|
27
|
+
/** Keys whose string value — when an absolute path — is evidence worth linking.
|
|
28
|
+
* Sourced from the findings schema — the canonical owner of findings field names. */
|
|
29
|
+
export const EVIDENCE_KEYS = new Set(EVIDENCE_FIELD_NAMES);
|
|
28
30
|
/** Guess a MIME type from an evidence path's extension; omit when unknown. */
|
|
29
|
-
function mimeTypeFor(path) {
|
|
31
|
+
export function mimeTypeFor(path) {
|
|
30
32
|
if (path.endsWith('.png'))
|
|
31
33
|
return 'image/png';
|
|
32
34
|
if (path.endsWith('.jpg') || path.endsWith('.jpeg'))
|
|
@@ -101,7 +103,7 @@ function capLists(data) {
|
|
|
101
103
|
return { capped, truncated };
|
|
102
104
|
}
|
|
103
105
|
/** Steering text appended when one or more lists got capped. */
|
|
104
|
-
function steeringNote(truncated) {
|
|
106
|
+
export function steeringNote(truncated) {
|
|
105
107
|
const fields = truncated.map((f) => `"${f}"`).join(', ');
|
|
106
108
|
return (`Truncated ${truncated.join(', ')} to the first ${MAX_LIST_ITEMS} items (see "${TRUNCATED_KEY}" ` +
|
|
107
109
|
'for the real totals). ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/mcp/tools/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/mcp/tools/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,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,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC;qFACqF;AACrF,MAAM,CAAC,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAS,oBAAoB,CAAC,CAAC;AAIxF,8EAA8E;AAC9E,M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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
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'yours
|
|
59
|
-
'
|
|
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":["../../../src/mcp/tools/start-debug.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,qEAAqE;AACrE,MAAM,UAAU,cAAc,CAAC,OAAiB;IAC9C,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,QAAQ,CAAC,MAAM;YACb,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;gBACE,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EACT,mFAAmF;oBACnF,sFAAsF;oBACtF,qFAAqF;oBACrF,sFAAsF;oBACtF,oFAAoF;oBACpF,+BAA+B;gBACjC,WAAW,EAAE;oBACX,uEAAuE;oBACvE,wEAAwE;oBACxE,eAAe,EAAE,KAAK;oBACtB,aAAa,EAAE,IAAI;iBACpB;gBACD,WAAW,EAAE;oBACX,MAAM,EAAE,CAAC;yBACN,MAAM,EAAE;yBACR,GAAG,CAAC,CAAC,CAAC;yBACN,QAAQ,CACP,4FAA4F,CAC7F;oBACH,IAAI,EAAE,CAAC;yBACJ,MAAM,EAAE;yBACR,GAAG,CAAC,CAAC,CAAC;yBACN,QAAQ,CACP,8FAA8F,CAC/F;oBACH,GAAG,EAAE,CAAC;yBACH,GAAG,EAAE;yBACL,QAAQ,EAAE;yBACV,QAAQ,CACP,qOAAqO,CACtO;oBACH,EAAE,EAAE,CAAC;yBACF,MAAM,EAAE;yBACR,GAAG,CAAC,CAAC,CAAC;yBACN,QAAQ,EAAE;yBACV,QAAQ,CACP,8EAA8E;wBAC5E,uEAAuE;wBACvE,+EAA+E;wBAC/E,kEAAkE,CACrE;oBACH,OAAO,EAAE,CAAC;yBACP,OAAO,EAAE;yBACT,QAAQ,EAAE;yBACV,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"start-debug.js","sourceRoot":"","sources":["../../../src/mcp/tools/start-debug.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,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G,EAAE;yBACL,QAAQ,EAAE;yBACV,GAAG,CAAC,SAAS,CAAC;yBACd,QAAQ,EAAE;yBACV,QAAQ,CACP,oPAAoP,CACrP;iBACJ;gBACD,YAAY,EAAE,iBAAiB;aAChC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAC7B,YAAY,CACV,MAAM,OAAO,CAAC,KAAK,CAAC;gBAClB,GAAG,IAAI;gBACP,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,EAAE,CAAC;aAC5D,CAAC,CACH,CACJ,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/redact.d.ts
ADDED
|
@@ -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[];
|