@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/cli/control.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/cli/control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/cli/control.ts"],"names":[],"mapp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CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;AACzD,CAAC"}
|
package/dist/cli/help.js
CHANGED
|
@@ -10,7 +10,7 @@ USAGE:
|
|
|
10
10
|
${NAME} [subcommand] [options]
|
|
11
11
|
|
|
12
12
|
SUBCOMMANDS:
|
|
13
|
-
init Scaffold a new project (.
|
|
13
|
+
init Scaffold a new project (config in .dz/, or root legacy; workspace)
|
|
14
14
|
status Print the active debug run's state + findings summary
|
|
15
15
|
stop Signal the server to tear down the active run gracefully
|
|
16
16
|
(no subcommand) Boot the stdio MCP server (default, for Claude use)
|
package/dist/cli/init.d.ts
CHANGED
|
@@ -6,12 +6,63 @@
|
|
|
6
6
|
* Steps:
|
|
7
7
|
* 1. mkdir the workspace dir (an existing config's `workspace` wins over the
|
|
8
8
|
* `./tmp/ui-debugger-mcp` default — see {@link existingWorkspace})
|
|
9
|
-
* 2. write
|
|
9
|
+
* 2. write the project config (only if absent) at the location
|
|
10
|
+
* {@link resolveConfigPath} picks: `.dz/ui-debugger/ui-debugger-mcp.json`
|
|
11
|
+
* when the repo has a `.dz/` dir, else the root `.ui-debugger-mcp.json`.
|
|
12
|
+
* The starter is validated against `ConfigSchema` FIRST — the file `init`
|
|
13
|
+
* writes must satisfy the same schema the server parses it with
|
|
10
14
|
* 3. add the workspace dir to .gitignore (only if the line is missing)
|
|
11
15
|
* 4. print .mcp.json snippet (never writes the API key)
|
|
12
16
|
*/
|
|
17
|
+
import { type Config } from '../config/schema.js';
|
|
18
|
+
/**
|
|
19
|
+
* Starter project config written on `init` (only if absent).
|
|
20
|
+
*
|
|
21
|
+
* Bound to the parser's contract, twice over:
|
|
22
|
+
* - `satisfies Config` — the schema's own type, so `bun run typecheck` fails
|
|
23
|
+
* the moment the starter drifts from `ConfigSchema`'s shape
|
|
24
|
+
* - {@link validateStarterConfig} — the same schema at runtime, on the write
|
|
25
|
+
* path, because a schema is a runtime contract too and `init` is the one
|
|
26
|
+
* place that HANDS OUT a config file
|
|
27
|
+
*/
|
|
28
|
+
export declare const STARTER_CONFIG: {
|
|
29
|
+
models: {
|
|
30
|
+
driver: string;
|
|
31
|
+
vision: string;
|
|
32
|
+
summary: string;
|
|
33
|
+
fallback: string;
|
|
34
|
+
};
|
|
35
|
+
workspace: string;
|
|
36
|
+
targets: {
|
|
37
|
+
web: {
|
|
38
|
+
adapter: "browser";
|
|
39
|
+
url: string;
|
|
40
|
+
headless: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Validate a starter config candidate against the parser's contract.
|
|
46
|
+
*
|
|
47
|
+
* `init` writes the starter to disk, so the file must satisfy the SAME schema
|
|
48
|
+
* the server parses it with — otherwise `init` scaffolds a config the server
|
|
49
|
+
* rejects at boot. Throws `InitError` naming every schema issue (never a raw
|
|
50
|
+
* `ZodError`); returns the parsed config on success.
|
|
51
|
+
*/
|
|
52
|
+
export declare function validateStarterConfig(candidate: unknown): Config;
|
|
53
|
+
/** Options for {@link runInit}. */
|
|
54
|
+
export interface InitOptions {
|
|
55
|
+
/**
|
|
56
|
+
* The starter config to write when the project has none yet. Defaults to
|
|
57
|
+
* {@link STARTER_CONFIG}. Whatever is passed is validated against
|
|
58
|
+
* `ConfigSchema` BEFORE anything is written — an invalid starter throws
|
|
59
|
+
* `InitError` and leaves the project untouched (no config file, no
|
|
60
|
+
* `.gitignore` line, no workspace dir).
|
|
61
|
+
*/
|
|
62
|
+
starter?: unknown;
|
|
63
|
+
}
|
|
13
64
|
/**
|
|
14
65
|
* Run the init scaffold in `cwd`.
|
|
15
|
-
* Throws `InitError` on filesystem failures.
|
|
66
|
+
* Throws `InitError` on filesystem failures or an invalid starter config.
|
|
16
67
|
*/
|
|
17
|
-
export declare function runInit(cwd?: string): void;
|
|
68
|
+
export declare function runInit(cwd?: string, opts?: InitOptions): void;
|
package/dist/cli/init.js
CHANGED
|
@@ -6,20 +6,35 @@
|
|
|
6
6
|
* Steps:
|
|
7
7
|
* 1. mkdir the workspace dir (an existing config's `workspace` wins over the
|
|
8
8
|
* `./tmp/ui-debugger-mcp` default — see {@link existingWorkspace})
|
|
9
|
-
* 2. write
|
|
9
|
+
* 2. write the project config (only if absent) at the location
|
|
10
|
+
* {@link resolveConfigPath} picks: `.dz/ui-debugger/ui-debugger-mcp.json`
|
|
11
|
+
* when the repo has a `.dz/` dir, else the root `.ui-debugger-mcp.json`.
|
|
12
|
+
* The starter is validated against `ConfigSchema` FIRST — the file `init`
|
|
13
|
+
* writes must satisfy the same schema the server parses it with
|
|
10
14
|
* 3. add the workspace dir to .gitignore (only if the line is missing)
|
|
11
15
|
* 4. print .mcp.json snippet (never writes the API key)
|
|
12
16
|
*/
|
|
13
17
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
14
|
-
import { join, relative, resolve, sep } from 'node:path';
|
|
15
|
-
import {
|
|
18
|
+
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
19
|
+
import { DEFAULT_MODELS, DEFAULT_WORKSPACE, ignoredRootConfig, resolveConfigPath, } from '../config/load.js';
|
|
20
|
+
import { ConfigSchema } from '../config/schema.js';
|
|
16
21
|
import { InitError } from '../errors.js';
|
|
17
|
-
/**
|
|
18
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Starter project config written on `init` (only if absent).
|
|
24
|
+
*
|
|
25
|
+
* Bound to the parser's contract, twice over:
|
|
26
|
+
* - `satisfies Config` — the schema's own type, so `bun run typecheck` fails
|
|
27
|
+
* the moment the starter drifts from `ConfigSchema`'s shape
|
|
28
|
+
* - {@link validateStarterConfig} — the same schema at runtime, on the write
|
|
29
|
+
* path, because a schema is a runtime contract too and `init` is the one
|
|
30
|
+
* place that HANDS OUT a config file
|
|
31
|
+
*/
|
|
32
|
+
export const STARTER_CONFIG = {
|
|
19
33
|
models: {
|
|
20
34
|
driver: DEFAULT_MODELS.driver,
|
|
21
35
|
vision: DEFAULT_MODELS.vision,
|
|
22
36
|
summary: DEFAULT_MODELS.summary,
|
|
37
|
+
fallback: DEFAULT_MODELS.fallback,
|
|
23
38
|
},
|
|
24
39
|
workspace: DEFAULT_WORKSPACE,
|
|
25
40
|
targets: {
|
|
@@ -29,7 +44,25 @@ const STARTER_CONFIG = JSON.stringify({
|
|
|
29
44
|
headless: true,
|
|
30
45
|
},
|
|
31
46
|
},
|
|
32
|
-
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Validate a starter config candidate against the parser's contract.
|
|
50
|
+
*
|
|
51
|
+
* `init` writes the starter to disk, so the file must satisfy the SAME schema
|
|
52
|
+
* the server parses it with — otherwise `init` scaffolds a config the server
|
|
53
|
+
* rejects at boot. Throws `InitError` naming every schema issue (never a raw
|
|
54
|
+
* `ZodError`); returns the parsed config on success.
|
|
55
|
+
*/
|
|
56
|
+
export function validateStarterConfig(candidate) {
|
|
57
|
+
const result = ConfigSchema.safeParse(candidate);
|
|
58
|
+
if (!result.success) {
|
|
59
|
+
const issues = result.error.issues
|
|
60
|
+
.map((i) => `${i.path.map(String).join('.') || '(root)'}: ${i.message}`)
|
|
61
|
+
.join('; ');
|
|
62
|
+
throw new InitError(`Starter config is invalid — ${issues}`);
|
|
63
|
+
}
|
|
64
|
+
return result.data;
|
|
65
|
+
}
|
|
33
66
|
/**
|
|
34
67
|
* `.mcp.json` snippet printed to stdout (API key placeholder — never written).
|
|
35
68
|
*
|
|
@@ -54,15 +87,16 @@ const MCP_JSON_SNIPPET = `{
|
|
|
54
87
|
/** Default ignore line — matches the `workspace` default (`./tmp/ui-debugger-mcp`). */
|
|
55
88
|
const DEFAULT_IGNORE_LINE = 'tmp/';
|
|
56
89
|
/**
|
|
57
|
-
* Read the `workspace` field of an already-present `.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
90
|
+
* Read the `workspace` field of an already-present project config (`.dz/` copy
|
|
91
|
+
* first, root fallback — the loader's candidate order), if any. Deliberately
|
|
92
|
+
* lenient — not a full `ConfigSchema` parse — because `init` only needs to know
|
|
93
|
+
* where to mkdir/gitignore, not validate the whole file; a config with an
|
|
60
94
|
* unrelated schema error must not block re-running `init`. Falls back to
|
|
61
|
-
* {@link DEFAULT_WORKSPACE} when the file is absent, unparseable, or has no
|
|
62
|
-
* `workspace` field.
|
|
95
|
+
* {@link DEFAULT_WORKSPACE} when the file is absent, unparseable, or has no
|
|
96
|
+
* string `workspace` field.
|
|
63
97
|
*/
|
|
64
98
|
function existingWorkspace(cwd) {
|
|
65
|
-
const configPath =
|
|
99
|
+
const configPath = resolveConfigPath(cwd);
|
|
66
100
|
if (!existsSync(configPath))
|
|
67
101
|
return DEFAULT_WORKSPACE;
|
|
68
102
|
let raw;
|
|
@@ -70,7 +104,7 @@ function existingWorkspace(cwd) {
|
|
|
70
104
|
raw = readFileSync(configPath, 'utf8');
|
|
71
105
|
}
|
|
72
106
|
catch (e) {
|
|
73
|
-
throw new InitError(`Failed to read ${
|
|
107
|
+
throw new InitError(`Failed to read ${relative(cwd, configPath)}: ${e instanceof Error ? e.message : String(e)}`);
|
|
74
108
|
}
|
|
75
109
|
try {
|
|
76
110
|
const data = JSON.parse(raw);
|
|
@@ -87,8 +121,14 @@ function existingWorkspace(cwd) {
|
|
|
87
121
|
/**
|
|
88
122
|
* The `.gitignore` line for `workspaceDir`. The default workspace keeps the
|
|
89
123
|
* historical broad `tmp/` line; a custom workspace gets its own relative,
|
|
90
|
-
* trailing-slash line so it's actually ignored instead of missed.
|
|
91
|
-
*
|
|
124
|
+
* trailing-slash line so it's actually ignored instead of missed. The path is
|
|
125
|
+
* written as an escaped LITERAL per gitignore(5): backslash, `!`, `#`, `*`,
|
|
126
|
+
* `?`, `[` and space are backslash-prefixed (`/` and `]` need no escape), so a
|
|
127
|
+
* workspace named `#ws` or `my ws` matches itself instead of parsing as a
|
|
128
|
+
* comment, negation or glob. gitignore(5) rules are line-based, so a workspace
|
|
129
|
+
* path carrying a newline or CR cannot be expressed at all — `InitError`, never
|
|
130
|
+
* a silently corrupt pair of rules. `null` when the workspace resolves outside
|
|
131
|
+
* `cwd` — nothing to add, the caller must handle it.
|
|
92
132
|
*/
|
|
93
133
|
function gitignoreLineFor(cwd, workspaceDir, workspaceValue) {
|
|
94
134
|
if (workspaceValue === DEFAULT_WORKSPACE)
|
|
@@ -96,13 +136,26 @@ function gitignoreLineFor(cwd, workspaceDir, workspaceValue) {
|
|
|
96
136
|
const rel = relative(cwd, workspaceDir);
|
|
97
137
|
if (rel.startsWith('..'))
|
|
98
138
|
return null;
|
|
99
|
-
|
|
139
|
+
const line = `${rel
|
|
140
|
+
.split(sep)
|
|
141
|
+
.join('/')
|
|
142
|
+
.replace(/[\\!#*?[ ]/g, '\\$&')}/`;
|
|
143
|
+
if (line.includes('\n') || line.includes('\r')) {
|
|
144
|
+
throw new InitError(`workspace ${JSON.stringify(workspaceValue)} contains a line break — .gitignore rules are line-based and cannot ignore it; use a single-line workspace path`);
|
|
145
|
+
}
|
|
146
|
+
return line;
|
|
100
147
|
}
|
|
101
148
|
/**
|
|
102
149
|
* Run the init scaffold in `cwd`.
|
|
103
|
-
* Throws `InitError` on filesystem failures.
|
|
150
|
+
* Throws `InitError` on filesystem failures or an invalid starter config.
|
|
104
151
|
*/
|
|
105
|
-
export function runInit(cwd = process.cwd()) {
|
|
152
|
+
export function runInit(cwd = process.cwd(), opts = {}) {
|
|
153
|
+
// 0. validate the starter — before ANY filesystem effect. A starter that
|
|
154
|
+
// violates the schema must not leave a half-scaffolded project behind.
|
|
155
|
+
// Only `undefined` means "no starter given" — every other candidate
|
|
156
|
+
// (`null` included) is validated, never silently replaced by the default.
|
|
157
|
+
const starter = opts.starter === undefined ? STARTER_CONFIG : opts.starter;
|
|
158
|
+
validateStarterConfig(starter);
|
|
106
159
|
// 1. mkdir workspace — respects an already-present config's `workspace` field.
|
|
107
160
|
const workspaceValue = existingWorkspace(cwd);
|
|
108
161
|
const workspaceDir = resolve(cwd, workspaceValue);
|
|
@@ -113,19 +166,31 @@ export function runInit(cwd = process.cwd()) {
|
|
|
113
166
|
throw new InitError(`Failed to create workspace dir: ${e instanceof Error ? e.message : String(e)}`);
|
|
114
167
|
}
|
|
115
168
|
console.log(`✓ workspace ${workspaceDir}`);
|
|
116
|
-
// 2. write
|
|
117
|
-
|
|
169
|
+
// 2. write the project config (only if absent) — resolveConfigPath owns the
|
|
170
|
+
// location: an existing `.dz/` or root copy is found, else `.dz/` when the repo
|
|
171
|
+
// already has a `.dz/` dir, else the root file.
|
|
172
|
+
const configPath = resolveConfigPath(cwd);
|
|
173
|
+
const configName = relative(cwd, configPath);
|
|
118
174
|
if (existsSync(configPath)) {
|
|
119
|
-
console.log(` (skip)
|
|
175
|
+
console.log(` (skip) ${configName} already exists`);
|
|
176
|
+
const ignoredRoot = ignoredRootConfig(cwd);
|
|
177
|
+
if (ignoredRoot) {
|
|
178
|
+
console.log(` (notice) ${ignoredRoot} also exists — ignored, ${configName} wins`);
|
|
179
|
+
}
|
|
120
180
|
}
|
|
121
181
|
else {
|
|
122
182
|
try {
|
|
123
|
-
|
|
183
|
+
// The `.dz/` candidate needs its parent dir; for the root candidate this
|
|
184
|
+
// is a no-op on the (existing) project root.
|
|
185
|
+
mkdirSync(dirname(configPath), { recursive: true });
|
|
186
|
+
// The validated starter, serialized as-is: the parse is a gate, not a
|
|
187
|
+
// transform — the bytes on disk stay exactly the documented ones.
|
|
188
|
+
writeFileSync(configPath, `${JSON.stringify(starter, null, 2)}\n`, 'utf8');
|
|
124
189
|
}
|
|
125
190
|
catch (e) {
|
|
126
|
-
throw new InitError(`Failed to write
|
|
191
|
+
throw new InitError(`Failed to write ${configName}: ${e instanceof Error ? e.message : String(e)}`);
|
|
127
192
|
}
|
|
128
|
-
console.log(`✓ created
|
|
193
|
+
console.log(`✓ created ${configName}`);
|
|
129
194
|
}
|
|
130
195
|
// 3. add the workspace dir to .gitignore (only if the line is missing)
|
|
131
196
|
const gitignorePath = join(cwd, '.gitignore');
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE;QACN,MAAM,EAAE,cAAc,CAAC,MAAM;QAC7B,MAAM,EAAE,cAAc,CAAC,MAAM;QAC7B,OAAO,EAAE,cAAc,CAAC,OAAO;QAC/B,QAAQ,EAAE,cAAc,CAAC,QAAQ;KAClC;IACD,SAAS,EAAE,iBAAiB;IAC5B,OAAO,EAAE;QACP,GAAG,EAAE;YACH,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,uBAAuB;YAC5B,QAAQ,EAAE,IAAI;SACf;KACF;CACe,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAkB;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM;aAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAA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AO,CAAC,GAAG,CAAC,8CAA8C,IAAI,IAAI,CAAC,CAAC;QACpE,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC;IACtF,IAAI,CAAC;QACH,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,SAAS,CACjB,gCAAgC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,IAAI,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Detect that
|
|
2
|
+
* Detect that the project config changed after the server read it.
|
|
3
3
|
*
|
|
4
4
|
* Config is resolved ONCE at boot (`main.ts`): it decides the workspace layout,
|
|
5
5
|
* the provider, the per-role models and the self-look probe, all of which are
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
* Content fingerprint of the project's config file — `null` when it is absent or
|
|
21
21
|
* unreadable (a project running on defaults has nothing to drift from).
|
|
22
22
|
*
|
|
23
|
+
* Follows the boot loader's candidate order (`resolveConfigPath`: `.dz/` first,
|
|
24
|
+
* root fallback) and keys on CONTENT, not path: identical bytes at either
|
|
25
|
+
* location are the same config, so relocating the file with no changes is not
|
|
26
|
+
* drift, while editing a shadowed root copy is invisible — by design.
|
|
27
|
+
*
|
|
23
28
|
* Contents, not mtime: editors and formatters rewrite files without changing
|
|
24
29
|
* anything that matters, and a spurious "restart me" is its own kind of noise.
|
|
25
30
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Detect that
|
|
2
|
+
* Detect that the project config changed after the server read it.
|
|
3
3
|
*
|
|
4
4
|
* Config is resolved ONCE at boot (`main.ts`): it decides the workspace layout,
|
|
5
5
|
* the provider, the per-role models and the self-look probe, all of which are
|
|
@@ -18,12 +18,16 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { createHash } from 'node:crypto';
|
|
20
20
|
import { readFileSync } from 'node:fs';
|
|
21
|
-
import {
|
|
22
|
-
import { CONFIG_FILENAME } from './load.js';
|
|
21
|
+
import { resolveConfigPath } from './load.js';
|
|
23
22
|
/**
|
|
24
23
|
* Content fingerprint of the project's config file — `null` when it is absent or
|
|
25
24
|
* unreadable (a project running on defaults has nothing to drift from).
|
|
26
25
|
*
|
|
26
|
+
* Follows the boot loader's candidate order (`resolveConfigPath`: `.dz/` first,
|
|
27
|
+
* root fallback) and keys on CONTENT, not path: identical bytes at either
|
|
28
|
+
* location are the same config, so relocating the file with no changes is not
|
|
29
|
+
* drift, while editing a shadowed root copy is invisible — by design.
|
|
30
|
+
*
|
|
27
31
|
* Contents, not mtime: editors and formatters rewrite files without changing
|
|
28
32
|
* anything that matters, and a spurious "restart me" is its own kind of noise.
|
|
29
33
|
*
|
|
@@ -36,7 +40,7 @@ import { CONFIG_FILENAME } from './load.js';
|
|
|
36
40
|
export function configFingerprint(cwd) {
|
|
37
41
|
let raw;
|
|
38
42
|
try {
|
|
39
|
-
raw = readFileSync(
|
|
43
|
+
raw = readFileSync(resolveConfigPath(cwd), 'utf8');
|
|
40
44
|
}
|
|
41
45
|
catch (err) {
|
|
42
46
|
// Absent config = nothing to drift from. Anything else (permissions, I/O) is a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/config/fingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/config/fingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,YAAY,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,+EAA+E;QAC/E,8EAA8E;QAC9E,IAAK,GAA6B,EAAE,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,GAAG,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC;AACjD,CAAC"}
|
package/dist/config/load.d.ts
CHANGED
|
@@ -1,32 +1,56 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config loader + resolution order.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Resolves the project config (`.dz/ui-debugger/ui-debugger-mcp.json` first,
|
|
5
|
+
* falling back to the root `.ui-debugger-mcp.json` — see {@link CONFIG_CANDIDATES}),
|
|
6
|
+
* Zod-validates it, and resolves a fully defaulted `ResolvedConfig`.
|
|
7
|
+
* Layering follows `idea/config.md`:
|
|
6
8
|
*
|
|
7
9
|
* built-in defaults < project file < env
|
|
8
10
|
*
|
|
9
11
|
* The layers govern disjoint fields, so the order is unambiguous:
|
|
10
12
|
* - models / workspace / targets → project file over defaults
|
|
11
13
|
* - provider creds (key, base url) → env over the OpenRouter default base url
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* The provider key is resolved through the shared provider credential contract
|
|
16
|
+
* (`src/agent/provider.ts`): `OPENAI_API_KEY` then `OPENROUTER_API_KEY`, the
|
|
17
|
+
* same order the runtime provider uses.
|
|
18
|
+
* Per-session overrides are a runtime concern, not the file loader's — the
|
|
19
|
+
* doc's `Resolution order` marks the layer proposed, not shipped.
|
|
14
20
|
*
|
|
15
21
|
* Bad config fails fast and loud via `ConfigError` — never a silent fallback.
|
|
22
|
+
* That includes a bad `.dz/` copy: it errors, never falls through to root.
|
|
16
23
|
*/
|
|
17
24
|
import type { Target } from './schema.js';
|
|
18
|
-
/** Committed, per-project debug config filename
|
|
25
|
+
/** Committed, per-project debug config filename (the legacy root location). */
|
|
19
26
|
export declare const CONFIG_FILENAME = ".ui-debugger-mcp.json";
|
|
27
|
+
/**
|
|
28
|
+
* Where the per-repo config may live, in resolution order: the `.dz/`
|
|
29
|
+
* consolidation location first, the repo-root file as the legacy fallback.
|
|
30
|
+
* Every config read/write resolves through {@link resolveConfigPath}, so this
|
|
31
|
+
* array is the ONE place the order lives.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CONFIG_CANDIDATES: readonly ['.dz/ui-debugger/ui-debugger-mcp.json', ".ui-debugger-mcp.json"];
|
|
20
34
|
/** Default base url — OpenRouter. Override with env `OPENAI_BASE_URL`. */
|
|
21
35
|
export declare const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
|
|
22
36
|
/** Default workspace dir (per-project sessions, profiles, logs). */
|
|
23
37
|
export declare const DEFAULT_WORKSPACE = "./tmp/ui-debugger-mcp";
|
|
24
38
|
/**
|
|
25
|
-
* Per-role model defaults —
|
|
39
|
+
* Per-role model defaults — free OpenRouter models, one paid fallback behind them.
|
|
26
40
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
41
|
+
* Measured 2026-11-14 on the `dummy/web` planted-bug fixture (real runs, real
|
|
42
|
+
* OpenRouter): particle-1 driving + nemotron-3.5-super-vl seeing found every
|
|
43
|
+
* planted bug (404s, the JSON error, the ReferenceError, both dead buttons, the
|
|
44
|
+
* invisible subtitle), where the previous paid deepseek-v4-flash + qwen3-vl pair
|
|
45
|
+
* missed the visual ones. `:free` models are rate-limited and throttled at will,
|
|
46
|
+
* so `fallback` (text + image + tools, the cheapest provider via `:floor`) takes
|
|
47
|
+
* any call a primary cannot serve — see `src/agent/fallback.ts`. Driver and
|
|
48
|
+
* summary sit on DIFFERENT free models so they never share one per-model limit.
|
|
49
|
+
*
|
|
50
|
+
* Plain catalog ids or router suffixes only: the router rejects `#uptime`
|
|
51
|
+
* outright (`… is not a valid model ID`, HTTP 400), so shipping it as the
|
|
52
|
+
* default driver made a fresh install fail on its very first run. See
|
|
53
|
+
* `idea/models.md`.
|
|
30
54
|
*/
|
|
31
55
|
export declare const DEFAULT_MODELS: ResolvedModels;
|
|
32
56
|
/** Fully resolved per-role models — every role present after defaulting. */
|
|
@@ -34,6 +58,8 @@ export interface ResolvedModels {
|
|
|
34
58
|
driver: string;
|
|
35
59
|
vision: string;
|
|
36
60
|
summary: string;
|
|
61
|
+
/** Paid model behind every role (`src/agent/fallback.ts`). */
|
|
62
|
+
fallback: string;
|
|
37
63
|
}
|
|
38
64
|
/** OpenAI-compatible router credentials, resolved from env + the OpenRouter default. */
|
|
39
65
|
export interface ProviderConfig {
|
|
@@ -53,9 +79,23 @@ export interface LoadOptions {
|
|
|
53
79
|
/** Environment source for provider creds. Defaults to `process.env`. */
|
|
54
80
|
env?: Record<string, string | undefined>;
|
|
55
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The config path this project actually uses, resolved against `cwd`:
|
|
84
|
+
*
|
|
85
|
+
* - the first candidate FILE that exists — `.dz/` wins when both do
|
|
86
|
+
* - when neither exists, the path a fresh `init` should WRITE: the `.dz/`
|
|
87
|
+
* location if the repo already has a `.dz/` dir, else the root file.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveConfigPath(cwd: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* The shadowed root filename when BOTH candidates exist — what callers print as
|
|
92
|
+
* the one-line "you have two configs" notice (`.dz/` wins). `null` otherwise.
|
|
93
|
+
*/
|
|
94
|
+
export declare function ignoredRootConfig(cwd: string): string | null;
|
|
56
95
|
/**
|
|
57
96
|
* Load, validate, and resolve the project config. Throws `ConfigError` if the
|
|
58
|
-
* file is missing, not JSON, fails the schema, or
|
|
97
|
+
* file is missing, not JSON, fails the schema, or no provider API key is set
|
|
98
|
+
* (`OPENAI_API_KEY` / `OPENROUTER_API_KEY`).
|
|
59
99
|
*/
|
|
60
100
|
export declare function loadConfig(opts?: LoadOptions): ResolvedConfig;
|
|
61
101
|
/**
|