monomind 1.10.36 → 1.10.37
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/package.json +1 -1
- package/packages/@monomind/cli/dist/src/browser/find.js +2 -2
- package/packages/@monomind/cli/dist/src/browser/har.js +11 -4
- package/packages/@monomind/cli/dist/src/browser/network.d.ts +1 -0
- package/packages/@monomind/cli/dist/src/browser/network.js +5 -4
- package/packages/@monomind/cli/dist/src/browser/profiler.js +3 -2
- package/packages/@monomind/cli/dist/src/browser/record.js +14 -7
- package/packages/@monomind/cli/dist/src/browser/snapshot.js +1 -2
- package/packages/@monomind/cli/dist/src/browser/trace.js +2 -8
- package/packages/@monomind/cli/dist/src/browser/types.d.ts +1 -0
- package/packages/@monomind/cli/dist/src/browser/vitals.js +4 -4
- package/packages/@monomind/cli/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monomind",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.37",
|
|
4
4
|
"description": "Monomind - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -46,8 +46,8 @@ export async function findByLabel(client, sessionId, refs, label, options = {})
|
|
|
46
46
|
export async function findByPlaceholder(client, sessionId, refs, placeholder, options = {}) {
|
|
47
47
|
const lower = placeholder.toLowerCase();
|
|
48
48
|
const candidates = [...refs.values()].filter((r) => {
|
|
49
|
-
const
|
|
50
|
-
return options.exact ?
|
|
49
|
+
const ph = (r.placeholder ?? '').toLowerCase();
|
|
50
|
+
return options.exact ? ph === lower : ph.includes(lower);
|
|
51
51
|
});
|
|
52
52
|
if (options.nth !== undefined)
|
|
53
53
|
return candidates[options.nth - 1] ?? null;
|
|
@@ -7,6 +7,13 @@ export async function startHarRecording(client, sessionId) {
|
|
|
7
7
|
throw new Error('HAR recording already in progress');
|
|
8
8
|
const requests = new Map();
|
|
9
9
|
const startTime = Date.now();
|
|
10
|
+
const startWallMs = startTime;
|
|
11
|
+
let refCdpTs = 0;
|
|
12
|
+
const cdpToWall = (cdpTs) => {
|
|
13
|
+
if (refCdpTs === 0)
|
|
14
|
+
refCdpTs = cdpTs;
|
|
15
|
+
return startWallMs + (cdpTs - refCdpTs) * 1000;
|
|
16
|
+
};
|
|
10
17
|
const offReq = client.on('Network.requestWillBeSent', (params, sid) => {
|
|
11
18
|
if (sid !== sessionId)
|
|
12
19
|
return;
|
|
@@ -16,7 +23,7 @@ export async function startHarRecording(client, sessionId) {
|
|
|
16
23
|
url: p.request.url,
|
|
17
24
|
method: p.request.method,
|
|
18
25
|
requestHeaders: p.request.headers,
|
|
19
|
-
startTime: p.timestamp
|
|
26
|
+
startTime: cdpToWall(p.timestamp),
|
|
20
27
|
fromCache: false,
|
|
21
28
|
});
|
|
22
29
|
});
|
|
@@ -31,7 +38,7 @@ export async function startHarRecording(client, sessionId) {
|
|
|
31
38
|
entry.mimeType = p.response.mimeType;
|
|
32
39
|
entry.responseHeaders = p.response.headers;
|
|
33
40
|
entry.fromCache = p.response.fromDiskCache || p.response.fromServiceWorker;
|
|
34
|
-
entry.endTime = p.timestamp
|
|
41
|
+
entry.endTime = cdpToWall(p.timestamp);
|
|
35
42
|
}
|
|
36
43
|
});
|
|
37
44
|
const offFinished = client.on('Network.loadingFinished', (params, sid) => {
|
|
@@ -41,10 +48,10 @@ export async function startHarRecording(client, sessionId) {
|
|
|
41
48
|
const entry = requests.get(p.requestId);
|
|
42
49
|
if (entry) {
|
|
43
50
|
entry.encodedSize = p.encodedDataLength;
|
|
44
|
-
entry.endTime = p.timestamp
|
|
51
|
+
entry.endTime = cdpToWall(p.timestamp);
|
|
45
52
|
}
|
|
46
53
|
});
|
|
47
|
-
_sessions.set(sessionId, { requests, offReq, offResp, offFinished, startTime });
|
|
54
|
+
_sessions.set(sessionId, { requests, offReq, offResp, offFinished, startTime, startWallMs, refCdpTs });
|
|
48
55
|
}
|
|
49
56
|
export async function stopHarRecording(client, sessionId, outputPath, captureResponseBodies = false) {
|
|
50
57
|
const state = _sessions.get(sessionId);
|
|
@@ -9,6 +9,7 @@ export declare function setupRoutes(client: CdpClient, sessionId: string, routes
|
|
|
9
9
|
export declare function startRequestCapture(client: CdpClient, sessionId: string): void;
|
|
10
10
|
export declare function stopRequestCapture(sessionId: string): void;
|
|
11
11
|
export declare function getCapturedRequests(sessionId: string): {
|
|
12
|
+
id: string;
|
|
12
13
|
url: string;
|
|
13
14
|
method: string;
|
|
14
15
|
status?: number;
|
|
@@ -53,7 +53,7 @@ export async function setupRoutes(client, sessionId, routes) {
|
|
|
53
53
|
const _capturedRequests = new Map();
|
|
54
54
|
const _captureListeners = new Map();
|
|
55
55
|
export function startRequestCapture(client, sessionId) {
|
|
56
|
-
if (
|
|
56
|
+
if (_captureListeners.has(sessionId))
|
|
57
57
|
return;
|
|
58
58
|
const list = [];
|
|
59
59
|
_capturedRequests.set(sessionId, list);
|
|
@@ -61,13 +61,13 @@ export function startRequestCapture(client, sessionId) {
|
|
|
61
61
|
if (sid !== sessionId)
|
|
62
62
|
return;
|
|
63
63
|
const p = params;
|
|
64
|
-
list.push({ url: p.request.url, method: p.request.method, requestHeaders: p.request.headers, startTime: p.timestamp * 1000 });
|
|
64
|
+
list.push({ id: p.requestId, url: p.request.url, method: p.request.method, requestHeaders: p.request.headers, startTime: p.timestamp * 1000 });
|
|
65
65
|
});
|
|
66
66
|
const offResp = client.on('Network.responseReceived', (params, sid) => {
|
|
67
67
|
if (sid !== sessionId)
|
|
68
68
|
return;
|
|
69
69
|
const p = params;
|
|
70
|
-
const entry = list.find((r) => r.
|
|
70
|
+
const entry = list.find((r) => r.id === p.requestId);
|
|
71
71
|
if (entry) {
|
|
72
72
|
entry.status = p.response.status;
|
|
73
73
|
entry.mimeType = p.response.mimeType;
|
|
@@ -79,7 +79,7 @@ export function startRequestCapture(client, sessionId) {
|
|
|
79
79
|
if (sid !== sessionId)
|
|
80
80
|
return;
|
|
81
81
|
const p = params;
|
|
82
|
-
const entry = list
|
|
82
|
+
const entry = list.find((r) => r.id === p.requestId);
|
|
83
83
|
if (entry) {
|
|
84
84
|
entry.encodedSize = p.encodedDataLength;
|
|
85
85
|
entry.endTime = p.timestamp * 1000;
|
|
@@ -94,6 +94,7 @@ export function stopRequestCapture(sessionId) {
|
|
|
94
94
|
off();
|
|
95
95
|
_captureListeners.delete(sessionId);
|
|
96
96
|
}
|
|
97
|
+
_capturedRequests.delete(sessionId);
|
|
97
98
|
}
|
|
98
99
|
export function getCapturedRequests(sessionId) {
|
|
99
100
|
return _capturedRequests.get(sessionId) ?? [];
|
|
@@ -35,7 +35,7 @@ export async function startHeapSnapshot(client, sessionId, outputPath) {
|
|
|
35
35
|
return;
|
|
36
36
|
chunks.push(params.chunk);
|
|
37
37
|
});
|
|
38
|
-
await new Promise((resolve) => {
|
|
38
|
+
await new Promise((resolve, reject) => {
|
|
39
39
|
const off2 = client.on('HeapProfiler.reportHeapSnapshotProgress', (params, sid) => {
|
|
40
40
|
if (sid !== sessionId)
|
|
41
41
|
return;
|
|
@@ -44,7 +44,8 @@ export async function startHeapSnapshot(client, sessionId, outputPath) {
|
|
|
44
44
|
resolve();
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
client.send('HeapProfiler.takeHeapSnapshot', { reportProgress: true }, sessionId)
|
|
47
|
+
client.send('HeapProfiler.takeHeapSnapshot', { reportProgress: true }, sessionId)
|
|
48
|
+
.catch((err) => { off2(); reject(err); });
|
|
48
49
|
});
|
|
49
50
|
off();
|
|
50
51
|
await client.send('HeapProfiler.disable', {}, sessionId);
|
|
@@ -15,13 +15,20 @@ export async function startRecording(client, sessionId, options = {}) {
|
|
|
15
15
|
state.frames.push(data);
|
|
16
16
|
await client.send('Page.screencastFrameAck', { sessionId: frameSessionId }, sessionId).catch(() => { });
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
try {
|
|
19
|
+
await client.send('Page.startScreencast', {
|
|
20
|
+
format: options.format ?? 'jpeg',
|
|
21
|
+
quality: options.quality ?? 80,
|
|
22
|
+
everyNthFrame: options.everyNthFrame ?? 1,
|
|
23
|
+
...(options.maxWidth ? { maxWidth: options.maxWidth } : {}),
|
|
24
|
+
...(options.maxHeight ? { maxHeight: options.maxHeight } : {}),
|
|
25
|
+
}, sessionId);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
state.offScreencast?.();
|
|
29
|
+
_sessions.delete(sessionId);
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
25
32
|
}
|
|
26
33
|
export async function stopRecording(client, sessionId, outputPath) {
|
|
27
34
|
const state = _sessions.get(sessionId);
|
|
@@ -5,8 +5,6 @@ export async function captureSnapshot(client, sessionId, options = {}) {
|
|
|
5
5
|
// If a selector scope is requested, resolve it to a backendDOMNodeId and use getPartialAXTree
|
|
6
6
|
let nodes;
|
|
7
7
|
if (selector) {
|
|
8
|
-
const nodeResult = await client.send('Runtime.evaluate', { expression: `document.querySelector(${JSON.stringify(selector)})?.getAttribute('data-ax-node-id') ?? null`, returnByValue: true }, sessionId);
|
|
9
|
-
// Use DOM.querySelector to find the backend node
|
|
10
8
|
const doc = await client.send('DOM.getDocument', {}, sessionId);
|
|
11
9
|
const found = await client.send('DOM.querySelector', { nodeId: doc.root.nodeId, selector }, sessionId).catch(() => ({ nodeId: 0 }));
|
|
12
10
|
if (found.nodeId) {
|
|
@@ -66,6 +64,7 @@ export async function captureSnapshot(client, sessionId, options = {}) {
|
|
|
66
64
|
role,
|
|
67
65
|
name,
|
|
68
66
|
description,
|
|
67
|
+
placeholder: props.placeholder,
|
|
69
68
|
value: props.value,
|
|
70
69
|
disabled: props.disabled,
|
|
71
70
|
checked: props.checked,
|
|
@@ -26,13 +26,8 @@ export async function startTrace(client, sessionId, options = {}) {
|
|
|
26
26
|
if (Array.isArray(value))
|
|
27
27
|
events.push(...value);
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return;
|
|
32
|
-
// Will be resolved by stopTrace
|
|
33
|
-
});
|
|
34
|
-
_sessions.set(sessionId, { events, offData, offComplete });
|
|
35
|
-
const cats = options.categories ?? DEFAULT_CATEGORIES;
|
|
29
|
+
_sessions.set(sessionId, { events, offData });
|
|
30
|
+
const cats = [...(options.categories ?? DEFAULT_CATEGORIES)];
|
|
36
31
|
if (options.screenshots)
|
|
37
32
|
cats.push('disabled-by-default-devtools.screenshot');
|
|
38
33
|
await client.send('Tracing.start', {
|
|
@@ -56,7 +51,6 @@ export async function stopTrace(client, sessionId, outputPath) {
|
|
|
56
51
|
client.send('Tracing.end', {}, sessionId).catch(() => { });
|
|
57
52
|
});
|
|
58
53
|
state.offData();
|
|
59
|
-
state.offComplete();
|
|
60
54
|
_sessions.delete(sessionId);
|
|
61
55
|
const trace = {
|
|
62
56
|
traceEvents: state.events,
|
|
@@ -40,8 +40,8 @@ export async function collectVitals(client, sessionId, waitMs = 2000) {
|
|
|
40
40
|
try {
|
|
41
41
|
clsObs = new PerformanceObserver((list) => {
|
|
42
42
|
for (const entry of list.getEntries()) {
|
|
43
|
-
if (!
|
|
44
|
-
clsValue +=
|
|
43
|
+
if (!entry.hadRecentInput) {
|
|
44
|
+
clsValue += entry.value;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
vitals.cls = clsValue;
|
|
@@ -55,8 +55,8 @@ export async function collectVitals(client, sessionId, waitMs = 2000) {
|
|
|
55
55
|
try {
|
|
56
56
|
inpObs = new PerformanceObserver((list) => {
|
|
57
57
|
for (const entry of list.getEntries()) {
|
|
58
|
-
if (
|
|
59
|
-
inpValue =
|
|
58
|
+
if (entry.duration > inpValue) {
|
|
59
|
+
inpValue = entry.duration;
|
|
60
60
|
vitals.inp = inpValue;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoes/monomindcli",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Monomind CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|