monomind 1.10.33 → 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.
@@ -10,11 +10,12 @@ const fs = require('fs');
10
10
  const path = require('path');
11
11
  const os = require('os');
12
12
 
13
- const DATA_DIR = path.join(process.cwd(), '.monomind', 'data');
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(process.cwd(), '.monomind', 'sessions');
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 localDir = path.join(process.cwd(), '.monomind', 'sessions');
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monomind",
3
- "version": "1.10.33",
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(resolve, idleMs);
155
+ timer = setTimeout(settle, idleMs);
145
156
  }
146
157
  else {
147
- if (timer)
158
+ if (timer) {
148
159
  clearTimeout(timer);
149
- timer = null;
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
- if (ctx.flags.name && ctx.flags.value) {
1070
- await browser.setCookies(client, sessionId, [{
1071
- name: ctx.flags.name,
1072
- value: ctx.flags.value,
1073
- domain: ctx.flags.domain,
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.33",
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",