@developerz.ai/ui-debugger-mcp 1.4.0 → 1.5.1
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 +3 -0
- package/dist/agent/belt/look.d.ts +1 -1
- package/dist/agent/belt/look.js +26 -32
- package/dist/agent/belt/look.js.map +1 -1
- package/dist/agent/prompts/android-addendum.d.ts +1 -1
- package/dist/agent/prompts/android-addendum.js +48 -57
- package/dist/agent/prompts/android-addendum.js.map +1 -1
- package/dist/agent/prompts/compose.js +6 -7
- package/dist/agent/prompts/compose.js.map +1 -1
- package/dist/agent/prompts/debug-agent.js +76 -98
- package/dist/agent/prompts/debug-agent.js.map +1 -1
- package/dist/agent/prompts/desktop-addendum.d.ts +1 -1
- package/dist/agent/prompts/desktop-addendum.js +41 -46
- package/dist/agent/prompts/desktop-addendum.js.map +1 -1
- package/dist/agent/prompts/web-addendum.d.ts +1 -1
- package/dist/agent/prompts/web-addendum.js +87 -108
- package/dist/agent/prompts/web-addendum.js.map +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +8 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/services/session-builder.js +6 -0
- package/dist/services/session-builder.js.map +1 -1
- package/dist/services/summarize.d.ts +1 -1
- package/dist/services/summarize.js +11 -11
- package/dist/services/summarize.js.map +1 -1
- package/dist/session/cleanup.d.ts +42 -0
- package/dist/session/cleanup.js +69 -0
- package/dist/session/cleanup.js.map +1 -0
- package/dist/session/findings-store.d.ts +9 -4
- package/dist/session/findings-store.js +10 -5
- package/dist/session/findings-store.js.map +1 -1
- package/dist/session/workspace.d.ts +13 -3
- package/dist/session/workspace.js +21 -4
- package/dist/session/workspace.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,18 +28,18 @@ import { AgentError } from '../errors.js';
|
|
|
28
28
|
*/
|
|
29
29
|
export const SUMMARY_SYSTEM_PROMPT = `\
|
|
30
30
|
You are the summary guy — you condense a UI debug run into one paragraph for the
|
|
31
|
-
smart agent that will fix the code.
|
|
32
|
-
|
|
33
|
-
Write ONE plain-text paragraph (no markdown, no lists, no headings, no preamble) that
|
|
34
|
-
states the verdict, then what broke, where, and what to fix — concrete and ordered by
|
|
35
|
-
severity. If nothing broke, say so plainly. Output only the paragraph.
|
|
31
|
+
smart agent that will fix the code. You get the verdict plus every functional bug
|
|
32
|
+
and visual issue found.
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
Write ONE plain-text paragraph — no markdown, no lists, no headings, no preamble.
|
|
35
|
+
State the verdict, then what broke, where, and what to fix: concrete, ordered by
|
|
36
|
+
severity. Nothing broke → say so plainly. Output only the paragraph.
|
|
37
|
+
|
|
38
|
+
Report ONLY what the findings contain. NEVER infer a cause that is not there — no
|
|
39
|
+
crashes, exceptions, missing dependencies or build problems unless a bug or console
|
|
40
|
+
error says so. A "failed" verdict with no bugs listed means the run reached no
|
|
41
|
+
conclusion: say exactly that, do not diagnose it. Speculation is worse than silence
|
|
42
|
+
— it sends the smart agent chasing a bug that does not exist.`;
|
|
43
43
|
/** One functional bug, rendered for the digest. */
|
|
44
44
|
function bugLine(bug) {
|
|
45
45
|
const evidence = bug.evidence ? ` (evidence: ${bug.evidence})` : '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarize.js","sourceRoot":"","sources":["../../src/services/summarize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkB1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"summarize.js","sourceRoot":"","sources":["../../src/services/summarize.ts"],"names":[],"mappings":"A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
|
+
*
|
|
4
|
+
* Every run drops a `sessions/<id>/` directory holding `story.md`,
|
|
5
|
+
* `findings.json`, the full `logs/` trail, every screenshot and (when ffmpeg is
|
|
6
|
+
* around) a `replay.mp4`. A single dogfood afternoon is hundreds of megabytes,
|
|
7
|
+
* and nothing ever removed them: the workspace only ever grew.
|
|
8
|
+
*
|
|
9
|
+
* So a new run prunes the old ones: the {@link SESSION_RETENTION} newest survive,
|
|
10
|
+
* the rest are removed. "Newest" is the id's own byte order — {@link
|
|
11
|
+
* generateSessionId} emits fixed-width `YYYY-MM-DD_HH-MM-SS-NNNN`, so sorting the
|
|
12
|
+
* directory names IS sorting by time, with no `stat` per entry and no race with a
|
|
13
|
+
* run that is still writing.
|
|
14
|
+
*
|
|
15
|
+
* Fails LOUD ({@link WorkspaceError}): a workspace we cannot manage is a real
|
|
16
|
+
* problem, and silently accumulating gigabytes is exactly the failure this exists
|
|
17
|
+
* to end. The message names the directories so the fix is one `rm` away.
|
|
18
|
+
*/
|
|
19
|
+
import type { WorkspacePaths } from './workspace.js';
|
|
20
|
+
/** How many session directories survive a prune — the newest N by id. */
|
|
21
|
+
export declare const SESSION_RETENTION = 5;
|
|
22
|
+
/** Knobs for {@link pruneSessions}; both have sensible defaults. */
|
|
23
|
+
export interface PruneOptions {
|
|
24
|
+
/** How many to keep (newest first). Defaults to {@link SESSION_RETENTION}. */
|
|
25
|
+
keep?: number;
|
|
26
|
+
/**
|
|
27
|
+
* A session id that must survive regardless of where it sorts — the run being
|
|
28
|
+
* started. Its id is normally the newest anyway; this holds even if the clock
|
|
29
|
+
* moved backwards (NTP correction, DST) between runs.
|
|
30
|
+
*/
|
|
31
|
+
protect?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Remove all but the newest `keep` session directories under `workspace.sessions`.
|
|
35
|
+
*
|
|
36
|
+
* A missing `sessions/` dir is not an error (nothing has run here yet) — it prunes
|
|
37
|
+
* nothing. Loose files in `sessions/` are left alone; only directories are runs.
|
|
38
|
+
*
|
|
39
|
+
* @returns the ids that were removed, oldest first.
|
|
40
|
+
* @throws {WorkspaceError} if the directory cannot be read, or any removal fails.
|
|
41
|
+
*/
|
|
42
|
+
export declare function pruneSessions(workspace: WorkspacePaths, { keep, protect }?: PruneOptions): Promise<string[]>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session retention — keep the workspace from growing without bound.
|
|
3
|
+
*
|
|
4
|
+
* Every run drops a `sessions/<id>/` directory holding `story.md`,
|
|
5
|
+
* `findings.json`, the full `logs/` trail, every screenshot and (when ffmpeg is
|
|
6
|
+
* around) a `replay.mp4`. A single dogfood afternoon is hundreds of megabytes,
|
|
7
|
+
* and nothing ever removed them: the workspace only ever grew.
|
|
8
|
+
*
|
|
9
|
+
* So a new run prunes the old ones: the {@link SESSION_RETENTION} newest survive,
|
|
10
|
+
* the rest are removed. "Newest" is the id's own byte order — {@link
|
|
11
|
+
* generateSessionId} emits fixed-width `YYYY-MM-DD_HH-MM-SS-NNNN`, so sorting the
|
|
12
|
+
* directory names IS sorting by time, with no `stat` per entry and no race with a
|
|
13
|
+
* run that is still writing.
|
|
14
|
+
*
|
|
15
|
+
* Fails LOUD ({@link WorkspaceError}): a workspace we cannot manage is a real
|
|
16
|
+
* problem, and silently accumulating gigabytes is exactly the failure this exists
|
|
17
|
+
* to end. The message names the directories so the fix is one `rm` away.
|
|
18
|
+
*/
|
|
19
|
+
import { readdir, rm } from 'node:fs/promises';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import { WorkspaceError } from '../errors.js';
|
|
22
|
+
/** How many session directories survive a prune — the newest N by id. */
|
|
23
|
+
export const SESSION_RETENTION = 5;
|
|
24
|
+
/**
|
|
25
|
+
* Remove all but the newest `keep` session directories under `workspace.sessions`.
|
|
26
|
+
*
|
|
27
|
+
* A missing `sessions/` dir is not an error (nothing has run here yet) — it prunes
|
|
28
|
+
* nothing. Loose files in `sessions/` are left alone; only directories are runs.
|
|
29
|
+
*
|
|
30
|
+
* @returns the ids that were removed, oldest first.
|
|
31
|
+
* @throws {WorkspaceError} if the directory cannot be read, or any removal fails.
|
|
32
|
+
*/
|
|
33
|
+
export async function pruneSessions(workspace, { keep = SESSION_RETENTION, protect } = {}) {
|
|
34
|
+
let ids;
|
|
35
|
+
try {
|
|
36
|
+
const entries = await readdir(workspace.sessions, { withFileTypes: true });
|
|
37
|
+
ids = entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
if (err.code === 'ENOENT')
|
|
41
|
+
return [];
|
|
42
|
+
throw new WorkspaceError(`Failed to list session directories in '${workspace.sessions}': ${message(err)}`);
|
|
43
|
+
}
|
|
44
|
+
// Descending byte order == newest first (ids are fixed-width and time-ordered).
|
|
45
|
+
const newestFirst = ids.sort().reverse();
|
|
46
|
+
const doomed = newestFirst.slice(Math.max(0, keep)).filter((id) => id !== protect);
|
|
47
|
+
if (doomed.length === 0)
|
|
48
|
+
return [];
|
|
49
|
+
const failures = [];
|
|
50
|
+
for (const id of doomed) {
|
|
51
|
+
try {
|
|
52
|
+
await rm(join(workspace.sessions, id), { recursive: true, force: true });
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
failures.push(`${id} (${message(err)})`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (failures.length > 0) {
|
|
59
|
+
throw new WorkspaceError(`Failed to prune old session directories under '${workspace.sessions}': ` +
|
|
60
|
+
`${failures.join('; ')}. Remove them by hand, or point 'workspace' somewhere writable.`);
|
|
61
|
+
}
|
|
62
|
+
// Oldest first reads naturally in a log line ("pruned A, B, C").
|
|
63
|
+
return doomed.reverse();
|
|
64
|
+
}
|
|
65
|
+
/** Best-effort message off an unknown thrown value. */
|
|
66
|
+
function message(err) {
|
|
67
|
+
return err instanceof Error ? err.message : String(err);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=cleanup.js.map
|
|
@@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AC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IACnF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,cAAc,CACtB,kDAAkD,SAAS,CAAC,QAAQ,KAAK;YACvE,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iEAAiE,CAC1F,CAAC;IACJ,CAAC;IACD,iEAAiE;IACjE,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC;AAC1B,CAAC;AAED,uDAAuD;AACvD,SAAS,OAAO,CAAC,GAAY;IAC3B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -47,10 +47,15 @@ export declare class FindingsStore {
|
|
|
47
47
|
*/
|
|
48
48
|
saveScreenshot(label: string, data: Uint8Array, extension?: string): Promise<string>;
|
|
49
49
|
/**
|
|
50
|
-
* List saved screenshots as ordered frames (`NNN-<label
|
|
51
|
-
* sequence — the capture order the replay video stitches. Returns `[]` when
|
|
52
|
-
* were saved yet (or the dir is missing); files that don't match the pattern
|
|
53
|
-
* skipped. Decodes the step label back from the filename slug.
|
|
50
|
+
* List saved screenshots as ordered frames (`NNN-<label>.<png|jpg>`), ascending
|
|
51
|
+
* by sequence — the capture order the replay video stitches. Returns `[]` when
|
|
52
|
+
* none were saved yet (or the dir is missing); files that don't match the pattern
|
|
53
|
+
* are skipped. Decodes the step label back from the filename slug.
|
|
54
|
+
*
|
|
55
|
+
* BOTH extensions, not just `.png`: `look` re-captures a photo-heavy frame as
|
|
56
|
+
* JPEG (`saveScreenshot(..., 'jpg')`), and a png-only match silently dropped
|
|
57
|
+
* exactly those frames from the replay — the run's most visual evidence, gone
|
|
58
|
+
* from the clip with nothing to say why.
|
|
54
59
|
*/
|
|
55
60
|
listScreenshots(): Promise<ScreenshotFrame[]>;
|
|
56
61
|
}
|
|
@@ -118,10 +118,15 @@ export class FindingsStore {
|
|
|
118
118
|
return file;
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
|
-
* List saved screenshots as ordered frames (`NNN-<label
|
|
122
|
-
* sequence — the capture order the replay video stitches. Returns `[]` when
|
|
123
|
-
* were saved yet (or the dir is missing); files that don't match the pattern
|
|
124
|
-
* skipped. Decodes the step label back from the filename slug.
|
|
121
|
+
* List saved screenshots as ordered frames (`NNN-<label>.<png|jpg>`), ascending
|
|
122
|
+
* by sequence — the capture order the replay video stitches. Returns `[]` when
|
|
123
|
+
* none were saved yet (or the dir is missing); files that don't match the pattern
|
|
124
|
+
* are skipped. Decodes the step label back from the filename slug.
|
|
125
|
+
*
|
|
126
|
+
* BOTH extensions, not just `.png`: `look` re-captures a photo-heavy frame as
|
|
127
|
+
* JPEG (`saveScreenshot(..., 'jpg')`), and a png-only match silently dropped
|
|
128
|
+
* exactly those frames from the replay — the run's most visual evidence, gone
|
|
129
|
+
* from the clip with nothing to say why.
|
|
125
130
|
*/
|
|
126
131
|
async listScreenshots() {
|
|
127
132
|
let entries;
|
|
@@ -133,7 +138,7 @@ export class FindingsStore {
|
|
|
133
138
|
}
|
|
134
139
|
const frames = [];
|
|
135
140
|
for (const entry of entries) {
|
|
136
|
-
const match = /^(\d+)-(.*)\.png$/.exec(entry);
|
|
141
|
+
const match = /^(\d+)-(.*)\.(?:png|jpe?g)$/.exec(entry);
|
|
137
142
|
const digits = match?.[1];
|
|
138
143
|
const slug = match?.[2];
|
|
139
144
|
if (digits === undefined || slug === undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings-store.js","sourceRoot":"","sources":["../../src/session/findings-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAgBpD,uFAAuF;AACvF,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;GAIG;AACH,SAAS,IAAI,CAAC,KAAa;IACzB,MAAM,CAAC,GAAG,KAAK;SACZ,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC;SAClB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,MAAM,CAAC;AACrB,CAAC;AAED,MAAM,OAAO,aAAa;IACf,MAAM,CAAe;IAC9B,wEAAwE;IACxE,UAAU,GAAyB,IAAI,CAAC;IACxC,8EAA8E;IAC9E,SAAS,GAAyB,IAAI,CAAC;IACvC,8EAA8E;IAC9E,cAAc,GAAG,CAAC,CAAC;IAE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tB,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,CAAC;QACX,CAAC;QACD,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,GAAG,KAAK,SAAS;gBAAE,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
|
@@ -5,9 +5,19 @@
|
|
|
5
5
|
/** Reset internal counter — testing only. */
|
|
6
6
|
export declare function _resetCounter(): void;
|
|
7
7
|
/**
|
|
8
|
-
* Generate a session ID.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Generate a session ID: `YYYY-MM-DD_HH-MM-SS-<0000-padded counter>`, e.g.
|
|
9
|
+
* `2026-07-27_14-30-05-0001`.
|
|
10
|
+
*
|
|
11
|
+
* The id IS the session directory name, so a human listing
|
|
12
|
+
* `sessions/` reads *when* each run happened instead of decoding an epoch. Local
|
|
13
|
+
* time, deliberately — the reader is sitting at the machine that ran it.
|
|
14
|
+
*
|
|
15
|
+
* Fixed-width and zero-padded on purpose: byte order == chronological order, which
|
|
16
|
+
* is what {@link pruneSessions} sorts by to decide which runs are the newest. (A
|
|
17
|
+
* DST fall-back hour can invert one pair; the only consequence is which of two
|
|
18
|
+
* same-hour runs is pruned first.)
|
|
19
|
+
*
|
|
20
|
+
* @param now - injected epoch ms (e.g. Date.now() from the caller)
|
|
11
21
|
*/
|
|
12
22
|
export declare function generateSessionId(now: number): string;
|
|
13
23
|
export interface WorkspacePaths {
|
|
@@ -12,14 +12,31 @@ let _counter = 0;
|
|
|
12
12
|
export function _resetCounter() {
|
|
13
13
|
_counter = 0;
|
|
14
14
|
}
|
|
15
|
+
/** Zero-pad a number to `width` digits. */
|
|
16
|
+
function pad(value, width = 2) {
|
|
17
|
+
return String(value).padStart(width, '0');
|
|
18
|
+
}
|
|
15
19
|
/**
|
|
16
|
-
* Generate a session ID.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
20
|
+
* Generate a session ID: `YYYY-MM-DD_HH-MM-SS-<0000-padded counter>`, e.g.
|
|
21
|
+
* `2026-07-27_14-30-05-0001`.
|
|
22
|
+
*
|
|
23
|
+
* The id IS the session directory name, so a human listing
|
|
24
|
+
* `sessions/` reads *when* each run happened instead of decoding an epoch. Local
|
|
25
|
+
* time, deliberately — the reader is sitting at the machine that ran it.
|
|
26
|
+
*
|
|
27
|
+
* Fixed-width and zero-padded on purpose: byte order == chronological order, which
|
|
28
|
+
* is what {@link pruneSessions} sorts by to decide which runs are the newest. (A
|
|
29
|
+
* DST fall-back hour can invert one pair; the only consequence is which of two
|
|
30
|
+
* same-hour runs is pruned first.)
|
|
31
|
+
*
|
|
32
|
+
* @param now - injected epoch ms (e.g. Date.now() from the caller)
|
|
19
33
|
*/
|
|
20
34
|
export function generateSessionId(now) {
|
|
21
35
|
_counter = (_counter + 1) % 10_000;
|
|
22
|
-
|
|
36
|
+
const d = new Date(now);
|
|
37
|
+
const date = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
38
|
+
const time = `${pad(d.getHours())}-${pad(d.getMinutes())}-${pad(d.getSeconds())}`;
|
|
39
|
+
return `${date}_${time}-${pad(_counter, 4)}`;
|
|
23
40
|
}
|
|
24
41
|
// --- Path builders ----------------------------------------------------------
|
|
25
42
|
/** Derive the project slug from an absolute cwd path. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/session/workspace.ts"],"names":[],"mappings":"AAA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,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAmB;IACrD,MAAM,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developerz.ai/ui-debugger-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Autonomous UI debugging MCP server. Give a goal; a fast agent drives the browser/desktop, finds bugs + visual issues, and reports back.",
|
|
5
5
|
"mcpName": "io.github.developerz-ai/ui-debugger-mcp",
|
|
6
6
|
"license": "MIT",
|