monomind 1.15.1 → 1.15.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monomind",
3
- "version": "1.15.1",
3
+ "version": "1.15.3",
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",
@@ -794,8 +794,10 @@ const defendCommand = {
794
794
  output.writeln(output.bold('🛡️ MonoFence - AI Manipulation Defense System'));
795
795
  output.writeln(output.dim('─'.repeat(55)));
796
796
  // Dynamic import of aidefence (allows package to be optional)
797
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
797
798
  let createMonoDefence;
798
799
  try {
800
+ // @ts-expect-error — optional peer dep resolved at runtime
799
801
  const aidefence = await import('monofence-ai');
800
802
  createMonoDefence = aidefence.createMonoDefence;
801
803
  }
@@ -657,6 +657,7 @@ export class MCPServerManager extends EventEmitter {
657
657
  }
658
658
  // Dynamically import the MCP server package
659
659
  // FIX for issue #942: Use proper package import instead of broken relative path
660
+ // @ts-expect-error — @monomind/mcp is an optional peer resolved at runtime
660
661
  const { createMCPServer } = await import('@monomind/mcp');
661
662
  const logger = {
662
663
  debug: (msg, data) => this.emit('log', { level: 'debug', msg, data }),
@@ -393,6 +393,7 @@ const monofenceIsSafeTool = {
393
393
  }
394
394
  try {
395
395
  await getMonoFence(); // triggers auto-install if package is missing
396
+ // @ts-expect-error — optional peer dep resolved at runtime
396
397
  const { isSafe } = await import('monofence-ai');
397
398
  const safe = isSafe(input);
398
399
  return {
@@ -680,27 +680,37 @@ export const workflowTools = [
680
680
  const rawParams = input.params ?? {};
681
681
  // Sanitize params — string values only
682
682
  const params = Object.fromEntries(Object.entries(rawParams).map(([k, v]) => [k, String(v)]));
683
- if (input.port !== undefined) {
684
- process.env['GEMINI_CDP_PORT'] = String(input.port);
685
- }
686
- const { readPlaybook, runPlaybook, createDefaultHandlers } = await import('@monoes/monobrowse');
687
- const def = await readPlaybook(absPath);
688
- const record = await runPlaybook(def, {
689
- handlers: createDefaultHandlers(),
690
- signal: AbortSignal.timeout(timeoutMs),
691
- params,
683
+ const { spawn } = await import('node:child_process');
684
+ const _args = ['run', '--file', absPath, '--json'];
685
+ for (const [k, v] of Object.entries(params))
686
+ _args.push('--param', `${k}=${v}`);
687
+ const env = { ...process.env };
688
+ if (input.port !== undefined)
689
+ env['CDP_PORT'] = String(input.port);
690
+ const record = await new Promise((resolve) => {
691
+ const child = spawn('monoes', _args, { env });
692
+ let stdout = '';
693
+ let stderr = '';
694
+ child.stdout?.on('data', (d) => { stdout += d; });
695
+ child.stderr?.on('data', (d) => { stderr += d; });
696
+ const _kill = setTimeout(() => { child.kill(); resolve({ status: 'timeout', error: `Timed out after ${timeoutMs}ms` }); }, timeoutMs);
697
+ child.on('close', (code) => {
698
+ clearTimeout(_kill);
699
+ if (code === 0) {
700
+ try {
701
+ resolve({ status: 'complete', output: JSON.parse(stdout) });
702
+ }
703
+ catch {
704
+ resolve({ status: 'complete', output: stdout.trim() });
705
+ }
706
+ }
707
+ else {
708
+ resolve({ status: 'failed', error: (stderr.trim() || stdout.trim()) });
709
+ }
710
+ });
711
+ child.on('error', (e) => { clearTimeout(_kill); resolve({ status: 'failed', error: e.message }); });
692
712
  });
693
- return {
694
- playbookId: record.playbookId,
695
- playbookName: record.playbookName,
696
- status: record.status,
697
- itemsProcessed: record.itemsProcessed,
698
- itemsTotal: record.itemsTotal,
699
- durationMs: record.completedAt && record.startedAt
700
- ? record.completedAt - record.startedAt
701
- : undefined,
702
- error: record.error,
703
- };
713
+ return record;
704
714
  },
705
715
  },
706
716
  ];
@@ -583,7 +583,7 @@ export async function startServer({ port = 4242, projectDir, openBrowser = true
583
583
  // Only accept paths that resolve to an existing directory AND are not
584
584
  // the filesystem root (/), AND are not obviously system paths.
585
585
  // Cap to 4096 chars to prevent OOM from huge path strings.
586
- const _rawProject = event.project;
586
+ const _rawProject = event.project ?? event.projectDir;
587
587
  let eventProject = null;
588
588
  if (typeof _rawProject === 'string' && _rawProject.length > 0 && _rawProject.length <= 4096
589
589
  && path.isAbsolute(_rawProject)) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.15.1",
3
+ "version": "1.15.3",
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",