monomind 1.16.7 → 1.16.8

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.16.7",
3
+ "version": "1.16.8",
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",
@@ -1,5 +1,6 @@
1
1
  import { writeFile, mkdir } from 'fs/promises';
2
2
  import { join } from 'path';
3
+ import { createClaudeLLMCaller } from '../../routing/llm-caller.js';
3
4
  const SYSTEM_PROMPT = `You are a browser automation expert. Given a DOM snippet and a task description, generate a JSON action definition that automates the task.
4
5
 
5
6
  Rules:
@@ -47,19 +48,11 @@ export async function analyzeAndBuild(options) {
47
48
  .replace(/<style[\s\S]*?<\/style>/gi, '')
48
49
  .replace(/\s{2,}/g, ' ')
49
50
  .slice(0, 12000);
50
- // Call Claude API
51
- const { Anthropic } = await import('@anthropic-ai/sdk');
52
- const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
53
- const message = await anthropic.messages.create({
54
- model: 'claude-sonnet-4-6',
55
- max_tokens: 2048,
56
- system: SYSTEM_PROMPT,
57
- messages: [{ role: 'user', content: buildPrompt(task, cleanDom) }],
58
- });
59
- const responseText = message.content
60
- .filter(c => c.type === 'text')
61
- .map(c => c.text)
62
- .join('');
51
+ // Call Claude via the CLI (reuses Claude Code's auth — no API key needed)
52
+ const caller = createClaudeLLMCaller({ model: 'sonnet' });
53
+ if (!caller)
54
+ throw new Error('Claude Code CLI not found. Install with: npm install -g @anthropic-ai/claude-code');
55
+ const responseText = await caller(`${SYSTEM_PROMPT}\n\n${buildPrompt(task, cleanDom)}`);
63
56
  const action = parseActionResponse(responseText);
64
57
  // Write to output directory
65
58
  await mkdir(outputDir, { recursive: true });
@@ -19,8 +19,9 @@ const buildSubcommand = {
19
19
  output.printError('--url and --task are required');
20
20
  return { success: false, exitCode: 1 };
21
21
  }
22
- if (!process.env.ANTHROPIC_API_KEY) {
23
- output.printError('ANTHROPIC_API_KEY is not set. Required for action build.');
22
+ const { isClaudeCodeAvailable } = await import('../routing/llm-caller.js');
23
+ if (!isClaudeCodeAvailable()) {
24
+ output.printError('Claude Code CLI not found. Install with: npm install -g @anthropic-ai/claude-code');
24
25
  return { success: false, exitCode: 1 };
25
26
  }
26
27
  const spinner = output.createSpinner({ text: `Opening ${url}...`, spinner: 'dots' });
@@ -148,17 +148,32 @@ async function checkApiKeys() {
148
148
  }
149
149
  // Detect Claude Code environment — API keys are managed internally
150
150
  const inClaudeCode = !!(process.env.CLAUDE_CODE || process.env.CLAUDE_PROJECT_DIR || process.env.MCP_SESSION_ID);
151
+ // Detect claude CLI on PATH — monomind uses claude --print, no direct API key needed
152
+ let claudeCliAvailable = false;
153
+ try {
154
+ execSync('claude --version', { encoding: 'utf-8', stdio: 'pipe', timeout: 5000, windowsHide: true });
155
+ claudeCliAvailable = true;
156
+ }
157
+ catch { /* not on PATH */ }
151
158
  if (found.includes('ANTHROPIC_API_KEY') || found.includes('CLAUDE_API_KEY')) {
152
159
  return { name: 'API Keys', status: 'pass', message: `Found: ${found.join(', ')}` };
153
160
  }
154
161
  else if (inClaudeCode) {
155
- return { name: 'API Keys', status: 'pass', message: 'Claude Code (managed internally)' };
162
+ return { name: 'API Keys', status: 'pass', message: 'Claude Code manages auth (no direct API key needed)' };
163
+ }
164
+ else if (claudeCliAvailable) {
165
+ return { name: 'API Keys', status: 'pass', message: 'Using Claude Code CLI auth (no direct API key needed)' };
156
166
  }
157
167
  else if (found.length > 0) {
158
168
  return { name: 'API Keys', status: 'warn', message: `Found: ${found.join(', ')} (no Claude key)`, fix: 'export ANTHROPIC_API_KEY=your_key' };
159
169
  }
160
170
  else {
161
- return { name: 'API Keys', status: 'warn', message: 'No API keys found', fix: 'export ANTHROPIC_API_KEY=your_key' };
171
+ return {
172
+ name: 'API Keys',
173
+ status: 'warn',
174
+ message: 'Claude Code CLI not found — monomind works best on top of Claude Code',
175
+ fix: 'npm install -g @anthropic-ai/claude-code # then: claude login',
176
+ };
162
177
  }
163
178
  }
164
179
  // Check git (async with proper env inheritance)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.16.7",
3
+ "version": "1.16.8",
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",