devharness 0.9.3 → 0.9.4
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/build/block-events.d.ts +42 -0
- package/build/block-events.d.ts.map +1 -0
- package/build/block-events.js +67 -0
- package/build/block-events.js.map +1 -0
- package/build/block-events.test.d.ts +2 -0
- package/build/block-events.test.d.ts.map +1 -0
- package/build/block-events.test.js +131 -0
- package/build/block-events.test.js.map +1 -0
- package/build/index.js +33 -2
- package/build/index.js.map +1 -1
- package/build/server-block-cleanup.test.d.ts +2 -0
- package/build/server-block-cleanup.test.d.ts.map +1 -0
- package/build/server-block-cleanup.test.js +143 -0
- package/build/server-block-cleanup.test.js.map +1 -0
- package/build/server-manager.d.ts +8 -0
- package/build/server-manager.d.ts.map +1 -1
- package/build/server-manager.js +49 -0
- package/build/server-manager.js.map +1 -1
- package/build/startup-gate.d.ts +29 -0
- package/build/startup-gate.d.ts.map +1 -0
- package/build/startup-gate.js +49 -0
- package/build/startup-gate.js.map +1 -0
- package/build/startup-gate.test.d.ts +2 -0
- package/build/startup-gate.test.d.ts.map +1 -0
- package/build/startup-gate.test.js +73 -0
- package/build/startup-gate.test.js.map +1 -0
- package/build/tool-response.d.ts +3 -0
- package/build/tool-response.d.ts.map +1 -1
- package/build/tool-response.js +46 -1
- package/build/tool-response.js.map +1 -1
- package/build/tools/assert-tools.d.ts +3 -3
- package/build/tools/breakpoint-tools.d.ts +3 -3
- package/build/tools/config-tools.d.ts +3 -3
- package/build/tools/console-tools.d.ts +9 -9
- package/build/tools/content-tools.d.ts +3 -3
- package/build/tools/input-tools.d.ts +9 -9
- package/build/tools/issues-tools.d.ts +6 -6
- package/build/tools/page-tools.d.ts +3 -3
- package/build/tools/replay-tools.d.ts +9 -9
- package/build/tools/request-tools.d.ts +3 -3
- package/build/tools/server-tools.d.ts +9 -9
- package/build/tools/storage-tools.d.ts +3 -3
- package/build/tools/wait-tools.d.ts +6 -6
- package/docs/instructions.md +23 -0
- package/package.json +1 -1
- package/plugin/skills/devharness/SKILL.md +18 -1
|
@@ -49,19 +49,19 @@ export declare function createWaitTools(resolveConnectionFromReason: (connection
|
|
|
49
49
|
pollIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
50
50
|
connectionReason: z.ZodOptional<z.ZodString>;
|
|
51
51
|
}, "strict", z.ZodTypeAny, {
|
|
52
|
-
timeoutMs?: number | undefined;
|
|
53
|
-
expression?: string | undefined;
|
|
54
52
|
selector?: string | undefined;
|
|
55
53
|
selectorGone?: string | undefined;
|
|
54
|
+
expression?: string | undefined;
|
|
56
55
|
ms?: number | undefined;
|
|
56
|
+
timeoutMs?: number | undefined;
|
|
57
57
|
connectionReason?: string | undefined;
|
|
58
58
|
pollIntervalMs?: number | undefined;
|
|
59
59
|
}, {
|
|
60
|
-
timeoutMs?: number | undefined;
|
|
61
|
-
expression?: string | undefined;
|
|
62
60
|
selector?: string | undefined;
|
|
63
61
|
selectorGone?: string | undefined;
|
|
62
|
+
expression?: string | undefined;
|
|
64
63
|
ms?: number | undefined;
|
|
64
|
+
timeoutMs?: number | undefined;
|
|
65
65
|
connectionReason?: string | undefined;
|
|
66
66
|
pollIntervalMs?: number | undefined;
|
|
67
67
|
}>;
|
|
@@ -72,11 +72,11 @@ export declare function createWaitTools(resolveConnectionFromReason: (connection
|
|
|
72
72
|
} | undefined;
|
|
73
73
|
};
|
|
74
74
|
handler: (args: {
|
|
75
|
-
timeoutMs?: number | undefined;
|
|
76
|
-
expression?: string | undefined;
|
|
77
75
|
selector?: string | undefined;
|
|
78
76
|
selectorGone?: string | undefined;
|
|
77
|
+
expression?: string | undefined;
|
|
79
78
|
ms?: number | undefined;
|
|
79
|
+
timeoutMs?: number | undefined;
|
|
80
80
|
connectionReason?: string | undefined;
|
|
81
81
|
pollIntervalMs?: number | undefined;
|
|
82
82
|
}, abortSignal?: AbortSignal) => Promise<any>;
|
package/docs/instructions.md
CHANGED
|
@@ -120,6 +120,29 @@ Chrome DevTools Protocol debugging for JavaScript/TypeScript in Chrome, Node.js,
|
|
|
120
120
|
- **Missing/invalid parameters**: the error includes a `continuationToken` and `missingParameters` (name/type/description/enum). Retry with just `{ continuationToken, <missing/bad field(s)> }` - don't resend everything. Expires after 5 min.
|
|
121
121
|
- **A validated call gets blocked by a guard** (port failure, dead server, breakpoint pause): the response footer shows `**Repeat:** replay({ action: 'repeat', indices: [N] })`. Acknowledge the guard (e.g. `server({ action: 'acknowledgePort' })`), then use that hint to resume the exact call. Don't reuse a `continuationToken` here - that's for fixing bad input, not for retrying an already-valid call.
|
|
122
122
|
|
|
123
|
+
## Getting notified when a guard blocks
|
|
124
|
+
|
|
125
|
+
Guards only surface on the *next* tool call, so a server that dies while you're editing files stays invisible until you call back into devharness. Every new block also appends one JSON line to `.devharness/logs/blocks.jsonl`:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{"ts":"2026-08-08T03:21:45.588Z","guard":"pendingStartup","tool":"navigate","detail":"died before port detected: \"web\"","resolve":"server({ action: 'acknowledgeStartup', serverId: 'web' })"}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`guard` is one of `port`, `breakpoint`, `pendingStartup`, `bug`, `duplicateSession`. Lines are deduplicated: one per *new* block, not one per blocked call. The same block re-firing on later calls stays quiet until a call clears every guard and the block recurs.
|
|
132
|
+
|
|
133
|
+
In Claude Code, tail it with a persistent Monitor so blocks arrive as notifications while you work on something else:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Monitor({
|
|
137
|
+
command: "mkdir -p .devharness/logs && touch .devharness/logs/blocks.jsonl && tail -f -n0 .devharness/logs/blocks.jsonl",
|
|
138
|
+
description: "devharness guard blocks",
|
|
139
|
+
persistent: true,
|
|
140
|
+
timeout_ms: 3600000
|
|
141
|
+
})
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Any other client can watch the same file. `-n0` skips existing history so you only see blocks from that point on.
|
|
145
|
+
|
|
123
146
|
## Restarting devharness
|
|
124
147
|
|
|
125
148
|
If devharness itself seems stuck or broken (not the target app), restart it yourself rather than asking the user to reconnect: `config({ action: 'restart' })`. Falls back to `kill -USR2 $(cat .devharness/mcp-supervisor.pid)` via Bash if that action reports `CONFIG_RESTART_NOT_SUPERVISED` (e.g. a bare `node build/index.js`, not through the supervisor). Editing devharness's own source and running `npm run build` triggers the same restart automatically via its postbuild hook - `config({ action: 'status' })` reports which build is actually answering (entry file, its timestamp, server and supervisor pids), so a rebuild that signalled the wrong supervisor is visible rather than silent. Either way, this kills any Chrome instances it launched (relaunch with `launchChrome`) but managed dev servers (`server` tool) survive and reattach automatically.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devharness",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "MCP server that connects AI assistants to Chrome DevTools Protocol for runtime debugging - set breakpoints, inspect variables, monitor network traffic, and automate browser interactions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: devharness
|
|
3
3
|
description: Drive and debug a running app via the devharness MCP server - launch or attach to Chrome and Node.js, set breakpoints and logpoints, inspect call stacks and variables, watch console and network, manage dev servers, replay any earlier tool call by its history index, and record reproduction sequences that verify a fix. Use whenever a task involves running or debugging a live app, reproducing or verifying a bug, re-driving setup you already did (relaunching, re-logging in, refilling a form), or the user mentions breakpoints, Chrome DevTools, CDP, replay sequences, or devharness tools (launchChrome, navigate, breakpoint, inspect, replay, server, issues, etc.).
|
|
4
4
|
compatibility: Requires the devharness MCP server to be connected (tools such as launchChrome, breakpoint, inspect, replay, server, issues). Previously published as cdp-tools-mcp.
|
|
5
|
-
version: 0.9.
|
|
5
|
+
version: 0.9.4
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# devharness
|
|
@@ -63,6 +63,23 @@ Server merges and re-validates. Same token, repeat until it passes. Expires in 5
|
|
|
63
63
|
|
|
64
64
|
**Guard blocked a valid call** (dead port, breakpoint pause) → it was already recorded. Acknowledge (`server({ action: 'acknowledgePort' })`, `acknowledgeStartup`), then use the footer's `replay` hint. Don't rebuild the arguments; don't use a `continuationToken` here.
|
|
65
65
|
|
|
66
|
+
## Get told the moment a guard blocks
|
|
67
|
+
|
|
68
|
+
Guards only surface on your *next* devharness call, so a server that dies while you're editing files stays invisible until you happen to call back. Every new block also appends one JSON line to `.devharness/logs/blocks.jsonl` — `{ts, guard, tool, detail, resolve}`, one of `port`, `breakpoint`, `pendingStartup`, `bug`, `duplicateSession`.
|
|
69
|
+
|
|
70
|
+
Arm a Claude Code Monitor once, right after `launchChrome`/`server start`:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Monitor({
|
|
74
|
+
command: "mkdir -p .devharness/logs && touch .devharness/logs/blocks.jsonl && tail -f -n0 .devharness/logs/blocks.jsonl",
|
|
75
|
+
description: "devharness guard blocks",
|
|
76
|
+
persistent: true,
|
|
77
|
+
timeout_ms: 3600000
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`-n0` skips history — you only want blocks from now on. One line per *new* block, not per blocked call; the same block re-firing stays quiet until a call gets through all guards and it recurs. Act on the event's `resolve` field.
|
|
82
|
+
|
|
66
83
|
## Restarting devharness
|
|
67
84
|
|
|
68
85
|
If devharness itself is stuck (not the target app), restart it — don't wait to be asked.
|