monomind 1.10.32 → 1.10.34
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/.claude/helpers/handlers/stats-handler.cjs +1 -1
- package/.claude/helpers/intelligence.cjs +3 -2
- package/.claude/helpers/session.cjs +2 -1
- package/.claude/helpers/statusline.cjs +16 -5
- package/package.json +1 -1
- package/packages/@monomind/cli/dist/src/browser/browser.js +16 -12
- package/packages/@monomind/cli/dist/src/browser/cdp.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/browser/cdp.js +4 -2
- package/packages/@monomind/cli/dist/src/browser/wait.js +1 -1
- package/packages/@monomind/cli/dist/src/commands/browse.js +11 -10
- package/packages/@monomind/cli/package.json +1 -1
|
@@ -6,7 +6,7 @@ module.exports = {
|
|
|
6
6
|
var intelligence = hCtx.intelligence;
|
|
7
7
|
var args = hCtx.args;
|
|
8
8
|
if (intelligence && intelligence.stats) {
|
|
9
|
-
await Promise.resolve(intelligence.stats(args.includes('--json')));
|
|
9
|
+
try { await Promise.resolve(intelligence.stats(args.includes('--json'))); } catch (e) { /* non-fatal */ }
|
|
10
10
|
} else {
|
|
11
11
|
console.log('[WARN] Intelligence module not available. Run session-restore first.');
|
|
12
12
|
}
|
|
@@ -10,11 +10,12 @@ const fs = require('fs');
|
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const os = require('os');
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const _CWD = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
14
|
+
const DATA_DIR = path.join(_CWD, '.monomind', 'data');
|
|
14
15
|
const STORE_PATH = path.join(DATA_DIR, 'auto-memory-store.json');
|
|
15
16
|
const RANKED_PATH = path.join(DATA_DIR, 'ranked-context.json');
|
|
16
17
|
const PENDING_PATH = path.join(DATA_DIR, 'pending-insights.jsonl');
|
|
17
|
-
const SESSION_DIR = path.join(
|
|
18
|
+
const SESSION_DIR = path.join(_CWD, '.monomind', 'sessions');
|
|
18
19
|
const SESSION_FILE = path.join(SESSION_DIR, 'current.json');
|
|
19
20
|
|
|
20
21
|
// ── Safety limits (fixes #1530, #1531) ─────────────────────────────────────
|
|
@@ -12,7 +12,8 @@ const platform = os.platform();
|
|
|
12
12
|
const homeDir = os.homedir();
|
|
13
13
|
|
|
14
14
|
function getDataDir() {
|
|
15
|
-
const
|
|
15
|
+
const baseDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
16
|
+
const localDir = path.join(baseDir, '.monomind', 'sessions');
|
|
16
17
|
if (fs.existsSync(path.dirname(localDir))) {
|
|
17
18
|
return localDir;
|
|
18
19
|
}
|
|
@@ -1164,14 +1164,25 @@ function readMode() {
|
|
|
1164
1164
|
return 'full'; // default
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
+
// ─── Testability export (when required as a module, not run as CLI) ──────────
|
|
1168
|
+
if (require.main !== module) {
|
|
1169
|
+
module.exports = {
|
|
1170
|
+
readJSON, safeStat, modelLabel,
|
|
1171
|
+
getSecurityStatus, getSwarmStatus, getADRStatus,
|
|
1172
|
+
getHooksStatus, getActiveAgent, getAgentDBStats,
|
|
1173
|
+
getLearningStats, getTestStats, getIntegrationStatus,
|
|
1174
|
+
generateJSON,
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1167
1178
|
// ─── Main ───────────────────────────────────────────────────────
|
|
1168
|
-
if (process.argv.includes('--json')) {
|
|
1179
|
+
if (require.main === module && process.argv.includes('--json')) {
|
|
1169
1180
|
console.log(JSON.stringify(generateJSON(), null, 2));
|
|
1170
|
-
} else if (process.argv.includes('--compact')) {
|
|
1181
|
+
} else if (require.main === module && process.argv.includes('--compact')) {
|
|
1171
1182
|
console.log(JSON.stringify(generateJSON()));
|
|
1172
|
-
} else if (process.argv.includes('--single-line')) {
|
|
1183
|
+
} else if (require.main === module && process.argv.includes('--single-line')) {
|
|
1173
1184
|
console.log(generateStatusline());
|
|
1174
|
-
} else if (process.argv.includes('--toggle')) {
|
|
1185
|
+
} else if (require.main === module && process.argv.includes('--toggle')) {
|
|
1175
1186
|
// Toggle mode and print the new view
|
|
1176
1187
|
const current = readMode();
|
|
1177
1188
|
const next = current === 'compact' ? 'full' : 'compact';
|
|
@@ -1184,7 +1195,7 @@ if (process.argv.includes('--json')) {
|
|
|
1184
1195
|
} else {
|
|
1185
1196
|
console.log(generateDashboard());
|
|
1186
1197
|
}
|
|
1187
|
-
} else {
|
|
1198
|
+
} else if (require.main === module) {
|
|
1188
1199
|
// Default: respect mode state file
|
|
1189
1200
|
const mode = readMode();
|
|
1190
1201
|
if (mode === 'compact') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monomind",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.34",
|
|
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",
|
|
@@ -4,6 +4,8 @@ import { tmpdir } from 'os';
|
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { CdpClient, fetchTargets, fetchNewTarget } from './cdp.js';
|
|
6
6
|
import { CHROME_EXECUTABLES } from './types.js';
|
|
7
|
+
import { enableConsoleCapture } from './console-log.js';
|
|
8
|
+
import { setupDialogAutoHandling } from './dialog.js';
|
|
7
9
|
const DEFAULT_PORT = 9222;
|
|
8
10
|
const LAUNCH_TIMEOUT = 10_000;
|
|
9
11
|
const POLL_INTERVAL = 200;
|
|
@@ -112,6 +114,9 @@ export async function connectToTarget(port, targetId) {
|
|
|
112
114
|
client.send('DOM.enable', {}, sessionId),
|
|
113
115
|
client.send('Accessibility.enable', {}, sessionId),
|
|
114
116
|
]);
|
|
117
|
+
// Wire up auto-capture listeners so console/errors/dialogs work immediately
|
|
118
|
+
enableConsoleCapture(client, sessionId);
|
|
119
|
+
setupDialogAutoHandling(client, sessionId);
|
|
115
120
|
return { client, target, sessionId };
|
|
116
121
|
}
|
|
117
122
|
export async function openUrl(client, sessionId, url) {
|
|
@@ -122,7 +127,7 @@ export async function waitForLoad(client, sessionId, condition = 'load', timeout
|
|
|
122
127
|
if (condition === 'load' || condition === 'domcontentloaded') {
|
|
123
128
|
const event = condition === 'load' ? 'Page.loadEventFired' : 'Page.domContentEventFired';
|
|
124
129
|
await Promise.race([
|
|
125
|
-
client.once(event),
|
|
130
|
+
client.once(event, sessionId),
|
|
126
131
|
sleep(timeout).then(() => { throw new Error(`Timeout waiting for ${condition}`); }),
|
|
127
132
|
]);
|
|
128
133
|
return;
|
|
@@ -137,16 +142,23 @@ async function waitForNetworkIdle(client, sessionId, idleMs) {
|
|
|
137
142
|
return new Promise((resolve) => {
|
|
138
143
|
let pending = 0;
|
|
139
144
|
let timer = null;
|
|
145
|
+
const settle = () => {
|
|
146
|
+
offReq();
|
|
147
|
+
offResp();
|
|
148
|
+
offFail();
|
|
149
|
+
resolve();
|
|
150
|
+
};
|
|
140
151
|
const check = () => {
|
|
141
152
|
if (pending === 0) {
|
|
142
153
|
if (timer)
|
|
143
154
|
clearTimeout(timer);
|
|
144
|
-
timer = setTimeout(
|
|
155
|
+
timer = setTimeout(settle, idleMs);
|
|
145
156
|
}
|
|
146
157
|
else {
|
|
147
|
-
if (timer)
|
|
158
|
+
if (timer) {
|
|
148
159
|
clearTimeout(timer);
|
|
149
|
-
|
|
160
|
+
timer = null;
|
|
161
|
+
}
|
|
150
162
|
}
|
|
151
163
|
};
|
|
152
164
|
const offReq = client.on('Network.requestWillBeSent', (_, sid) => {
|
|
@@ -168,14 +180,6 @@ async function waitForNetworkIdle(client, sessionId, idleMs) {
|
|
|
168
180
|
}
|
|
169
181
|
});
|
|
170
182
|
check();
|
|
171
|
-
// Cleanup after resolution
|
|
172
|
-
const originalResolve = resolve;
|
|
173
|
-
resolve = () => {
|
|
174
|
-
offReq();
|
|
175
|
-
offResp();
|
|
176
|
-
offFail();
|
|
177
|
-
originalResolve();
|
|
178
|
-
};
|
|
179
183
|
});
|
|
180
184
|
}
|
|
181
185
|
export async function getCurrentUrl(client, sessionId) {
|
|
@@ -8,7 +8,7 @@ export declare class CdpClient {
|
|
|
8
8
|
connect(wsUrl: string): Promise<void>;
|
|
9
9
|
send<T = Record<string, unknown>>(method: string, params?: Record<string, unknown>, sessionId?: string): Promise<T>;
|
|
10
10
|
on(event: string, fn: (params: Record<string, unknown>, sessionId?: string) => void): () => void;
|
|
11
|
-
once(event: string): Promise<Record<string, unknown>>;
|
|
11
|
+
once(event: string, sessionId?: string): Promise<Record<string, unknown>>;
|
|
12
12
|
close(): void;
|
|
13
13
|
isConnected(): boolean;
|
|
14
14
|
}
|
|
@@ -74,9 +74,11 @@ export class CdpClient {
|
|
|
74
74
|
this.eventListeners.get(event).add(fn);
|
|
75
75
|
return () => this.eventListeners.get(event)?.delete(fn);
|
|
76
76
|
}
|
|
77
|
-
once(event) {
|
|
77
|
+
once(event, sessionId) {
|
|
78
78
|
return new Promise((resolve) => {
|
|
79
|
-
const off = this.on(event, (params) => {
|
|
79
|
+
const off = this.on(event, (params, sid) => {
|
|
80
|
+
if (sessionId !== undefined && sid !== sessionId)
|
|
81
|
+
return;
|
|
80
82
|
off();
|
|
81
83
|
resolve(params);
|
|
82
84
|
});
|
|
@@ -31,7 +31,7 @@ async function waitForLoad(client, sessionId, condition, timeout) {
|
|
|
31
31
|
}
|
|
32
32
|
const event = condition === 'load' ? 'Page.loadEventFired' : 'Page.domContentEventFired';
|
|
33
33
|
await Promise.race([
|
|
34
|
-
client.once(event),
|
|
34
|
+
client.once(event, sessionId),
|
|
35
35
|
sleep(timeout).then(() => { throw new Error(`Timeout waiting for ${condition}`); }),
|
|
36
36
|
]);
|
|
37
37
|
}
|
|
@@ -1066,17 +1066,18 @@ const cookiesCommand = {
|
|
|
1066
1066
|
return { success: true, data: { cookies } };
|
|
1067
1067
|
}
|
|
1068
1068
|
case 'set': {
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
}]);
|
|
1075
|
-
output.printSuccess(`Cookie set: ${ctx.flags.name}`);
|
|
1076
|
-
}
|
|
1077
|
-
else {
|
|
1078
|
-
throw new Error('Usage: monomind browse cookies set --name <n> --value <v>');
|
|
1069
|
+
// Support both: cookies set --name n --value v AND cookies set <name> <value>
|
|
1070
|
+
const name = ctx.flags.name ?? ctx.args[1];
|
|
1071
|
+
const value = ctx.flags.value ?? ctx.args[2];
|
|
1072
|
+
if (!name || value === undefined) {
|
|
1073
|
+
throw new Error('Usage: monomind browse cookies set <name> <value> [--domain <d>]');
|
|
1079
1074
|
}
|
|
1075
|
+
await browser.setCookies(client, sessionId, [{
|
|
1076
|
+
name,
|
|
1077
|
+
value,
|
|
1078
|
+
domain: ctx.flags.domain,
|
|
1079
|
+
}]);
|
|
1080
|
+
output.printSuccess(`Cookie set: ${name}`);
|
|
1080
1081
|
break;
|
|
1081
1082
|
}
|
|
1082
1083
|
case 'clear':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoes/monomindcli",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.34",
|
|
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",
|