overmind-mcp 3.4.1 → 3.4.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/bin/install-overmind-unix.sh +2 -2
- package/bin/install-overmind-windows.bat +2 -2
- package/dist/bin/overmind-bridge.js +2 -1
- package/dist/bin/overmind-bridge.js.map +1 -1
- package/dist/bridge/MessageLog.js +1 -1
- package/dist/bridge/MessageLog.js.map +1 -1
- package/dist/tools/a2a_hub.d.ts +14 -22
- package/dist/tools/a2a_hub.d.ts.map +1 -1
- package/dist/tools/a2a_hub.js +440 -363
- package/dist/tools/a2a_hub.js.map +1 -1
- package/package.json +1 -1
- package/scripts/auto-install.mjs +4 -2
- package/scripts/install-dependencies.mjs +5 -3
- package/scripts/postinstall.mjs +118 -2
- package/scripts/setup-windows.js +1 -1
- package/scripts/setup.mjs +5 -2
- package/scripts/verify-install.mjs +27 -2
- package/scripts/migrate-hermes-home.mjs +0 -133
- package/scripts/migrate-to-profiles.mjs +0 -205
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* migrate-to-profiles.mjs — Migrate old Hermes agents to native profiles.
|
|
4
|
-
*
|
|
5
|
-
* Scans the old Overmind Hermes layout (<HERMES_HOME>/agents/<name>/settings.json)
|
|
6
|
-
* and creates a native Hermes profile for each, preserving:
|
|
7
|
-
* - SOUL.md (system prompt)
|
|
8
|
-
* - credentials (.env)
|
|
9
|
-
* - model + provider (config.yaml)
|
|
10
|
-
* - MCP servers
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
* node scripts/migrate-to-profiles.mjs [--dry-run]
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { exec } from 'child_process';
|
|
17
|
-
import { promisify } from 'util';
|
|
18
|
-
import fs from 'fs';
|
|
19
|
-
import path from 'path';
|
|
20
|
-
import os from 'os';
|
|
21
|
-
|
|
22
|
-
const execAsync = promisify(exec);
|
|
23
|
-
|
|
24
|
-
// ─── Resolve old HERMES_HOME ──────────────────────────────────────────────────
|
|
25
|
-
|
|
26
|
-
function resolveOldHermesHome() {
|
|
27
|
-
if (process.env.OVERMIND_HERMES_HOME) return process.env.OVERMIND_HERMES_HOME;
|
|
28
|
-
|
|
29
|
-
// Workspace fallback
|
|
30
|
-
const wsHome = path.join(process.cwd(), '.overmind', 'hermes');
|
|
31
|
-
if (fs.existsSync(wsHome)) return wsHome;
|
|
32
|
-
|
|
33
|
-
// HOME-based
|
|
34
|
-
const homeBase = process.env.LOCALAPPDATA || os.homedir();
|
|
35
|
-
return process.platform === 'win32'
|
|
36
|
-
? path.join(homeBase, 'overmind', 'hermes')
|
|
37
|
-
: path.join(homeBase, '.overmind', 'hermes');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function resolveOldAgentsDir() {
|
|
41
|
-
const home = resolveOldHermesHome();
|
|
42
|
-
const agentsDir = path.join(home, 'agents');
|
|
43
|
-
if (fs.existsSync(agentsDir)) return agentsDir;
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// ─── Detect provider from credentials ─────────────────────────────────────────
|
|
48
|
-
|
|
49
|
-
function detectProvider(token, baseUrl) {
|
|
50
|
-
if (!token) return 'openrouter';
|
|
51
|
-
const url = (baseUrl || '').toLowerCase();
|
|
52
|
-
const t = token.toLowerCase();
|
|
53
|
-
|
|
54
|
-
if (url.includes('minimaxi') || url.includes('minimax') || t.startsWith('sk-cp-') || t.startsWith('sk-mm-')) {
|
|
55
|
-
return url.includes('minimaxi') ? 'minimax-cn' : 'minimax';
|
|
56
|
-
}
|
|
57
|
-
if (url.includes('z.ai') || url.includes('bigmodel') || /^[0-9a-f]{32}/i.test(token)) {
|
|
58
|
-
return 'zai';
|
|
59
|
-
}
|
|
60
|
-
if (url.includes('anthropic') || t.startsWith('sk-ant-')) {
|
|
61
|
-
return 'anthropic';
|
|
62
|
-
}
|
|
63
|
-
if (url.includes('openai') || t.startsWith('sk-')) {
|
|
64
|
-
return 'openai';
|
|
65
|
-
}
|
|
66
|
-
return 'openrouter';
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function buildCredentialsMap(provider, authToken) {
|
|
70
|
-
const creds = {};
|
|
71
|
-
if (!authToken) return creds;
|
|
72
|
-
|
|
73
|
-
switch (provider) {
|
|
74
|
-
case 'minimax-cn':
|
|
75
|
-
creds['MINIMAX_CN_API_KEY'] = authToken;
|
|
76
|
-
break;
|
|
77
|
-
case 'minimax':
|
|
78
|
-
creds['MINIMAX_API_KEY'] = authToken;
|
|
79
|
-
break;
|
|
80
|
-
case 'zai':
|
|
81
|
-
creds['GLM_API_KEY'] = authToken;
|
|
82
|
-
creds['ZAI_ANTHROPIC_FALLBACK_KEY'] = authToken;
|
|
83
|
-
break;
|
|
84
|
-
case 'anthropic':
|
|
85
|
-
creds['ANTHROPIC_API_KEY'] = authToken;
|
|
86
|
-
break;
|
|
87
|
-
case 'openai':
|
|
88
|
-
creds['OPENAI_API_KEY'] = authToken;
|
|
89
|
-
break;
|
|
90
|
-
default:
|
|
91
|
-
creds['OPENROUTER_API_KEY'] = authToken;
|
|
92
|
-
}
|
|
93
|
-
return creds;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// ─── Migration ────────────────────────────────────────────────────────────────
|
|
97
|
-
|
|
98
|
-
async function migrate(dryRun = false) {
|
|
99
|
-
const agentsDir = resolveOldAgentsDir();
|
|
100
|
-
if (!agentsDir) {
|
|
101
|
-
console.log('ℹ️ No old Hermes agents directory found. Nothing to migrate.');
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const agentDirs = fs.readdirSync(agentsDir)
|
|
106
|
-
.filter(d => fs.statSync(path.join(agentsDir, d)).isDirectory());
|
|
107
|
-
|
|
108
|
-
if (agentDirs.length === 0) {
|
|
109
|
-
console.log('ℹ️ No old Hermes agents found. Nothing to migrate.');
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
console.log(`Found ${agentDirs.length} old Hermes agent(s) to migrate:\n`);
|
|
114
|
-
|
|
115
|
-
let migrated = 0;
|
|
116
|
-
let skipped = 0;
|
|
117
|
-
let failed = 0;
|
|
118
|
-
|
|
119
|
-
for (const agentName of agentDirs) {
|
|
120
|
-
const agentDir = path.join(agentsDir, agentName);
|
|
121
|
-
const settingsPath = path.join(agentDir, 'settings.json');
|
|
122
|
-
const soulPath = path.join(agentDir, 'SOUL.md');
|
|
123
|
-
|
|
124
|
-
console.log(` 📦 ${agentName}`);
|
|
125
|
-
|
|
126
|
-
// Read settings.json
|
|
127
|
-
if (!fs.existsSync(settingsPath)) {
|
|
128
|
-
console.log(` ⚠️ No settings.json found — skipping.`);
|
|
129
|
-
skipped++;
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
let settings;
|
|
134
|
-
try {
|
|
135
|
-
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
136
|
-
} catch (e) {
|
|
137
|
-
console.log(` ❌ Failed to parse settings.json: ${e.message}`);
|
|
138
|
-
failed++;
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const env = settings.env || {};
|
|
143
|
-
const authToken = env.ANTHROPIC_AUTH_TOKEN || env.ANTHROPIC_API_KEY || '';
|
|
144
|
-
const baseUrl = env.ANTHROPIC_BASE_URL || '';
|
|
145
|
-
const model = env.ANTHROPIC_MODEL || env.MODEL || 'MiniMax-M3';
|
|
146
|
-
const provider = env.ANTHROPIC_PROVIDER || detectProvider(authToken, baseUrl);
|
|
147
|
-
const mcpServers = settings.enabledMcpjsonServers || [];
|
|
148
|
-
|
|
149
|
-
// Read SOUL.md
|
|
150
|
-
let soulContent = '';
|
|
151
|
-
if (fs.existsSync(soulPath)) {
|
|
152
|
-
soulContent = fs.readFileSync(soulPath, 'utf-8');
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
console.log(` Model: ${model} (${provider})`);
|
|
156
|
-
console.log(` MCPs: ${mcpServers.length} server(s)`);
|
|
157
|
-
console.log(` Auth: ${authToken ? `***${authToken.slice(-4)}` : '(none)'}`);
|
|
158
|
-
|
|
159
|
-
if (dryRun) {
|
|
160
|
-
console.log(` 🔄 [DRY-RUN] Would create profile: hermes profile create ${agentName}`);
|
|
161
|
-
migrated++;
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
try {
|
|
166
|
-
// 1. Create profile
|
|
167
|
-
const { HermesProfileManager } = await import('../dist/services/HermesProfileManager.js');
|
|
168
|
-
const credentials = buildCredentialsMap(provider, authToken);
|
|
169
|
-
|
|
170
|
-
const { profilePath } = await HermesProfileManager.create({
|
|
171
|
-
name: agentName,
|
|
172
|
-
prompt: soulContent || `You are ${agentName}, an AI assistant.`,
|
|
173
|
-
model,
|
|
174
|
-
provider,
|
|
175
|
-
credentials,
|
|
176
|
-
mcpServers,
|
|
177
|
-
description: `Migrated agent: ${agentName}`,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
console.log(` ✅ Profile created: ${profilePath}`);
|
|
181
|
-
migrated++;
|
|
182
|
-
} catch (e) {
|
|
183
|
-
console.log(` ❌ Migration failed: ${e.message}`);
|
|
184
|
-
failed++;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
console.log(`\n📊 Migration complete: ${migrated} migrated, ${skipped} skipped, ${failed} failed.`);
|
|
189
|
-
|
|
190
|
-
if (!dryRun && migrated > 0) {
|
|
191
|
-
console.log(`\n💡 Next steps:`);
|
|
192
|
-
console.log(` • Verify profiles: hermes profile list`);
|
|
193
|
-
console.log(` • Test an agent: hermes -p <name> chat "test"`);
|
|
194
|
-
console.log(` • Old layout preserved at: ${agentsDir}`);
|
|
195
|
-
console.log(` • Delete old layout when ready: rm -rf ${agentsDir}`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// ─── CLI ──────────────────────────────────────────────────────────────────────
|
|
200
|
-
|
|
201
|
-
const dryRun = process.argv.includes('--dry-run');
|
|
202
|
-
migrate(dryRun).catch(e => {
|
|
203
|
-
console.error('Migration error:', e);
|
|
204
|
-
process.exit(1);
|
|
205
|
-
});
|