@link-assistant/hive-mind 1.69.10 → 1.69.12

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.
@@ -8,6 +8,7 @@
8
8
  // This reduces version gathering time from ~30-150s to ~5s (limited by slowest command).
9
9
 
10
10
  import { getVersion } from './version.lib.mjs';
11
+ import { t } from './i18n.lib.mjs';
11
12
  import { exec } from 'child_process';
12
13
  import { promisify } from 'util';
13
14
 
@@ -969,6 +970,40 @@ export async function getVersionInfo(verbose = false, processVersion = null) {
969
970
  * @param {string|null} version - Version string or null
970
971
  * @param {string} [key] - Tool key for version parser lookup
971
972
  */
973
+ const ENGLISH_VERSION_LABELS = {
974
+ ai_agents: 'AI Agents',
975
+ browsers: 'Browsers',
976
+ browser_automation: 'Browser Automation',
977
+ connected: 'connected',
978
+ development_tools: 'Development Tools',
979
+ environment: 'Environment',
980
+ architecture: 'Architecture',
981
+ kernel: 'Kernel',
982
+ not_connected: 'not connected',
983
+ os: 'OS',
984
+ platform: 'Platform',
985
+ process_running_restart_needed: 'Process running: `{{processVersion}}` (restart needed)',
986
+ system: 'System',
987
+ version: 'Version',
988
+ };
989
+
990
+ function resolveVersionLocale(options = {}) {
991
+ if (typeof options === 'string') return options;
992
+ return options?.locale || null;
993
+ }
994
+
995
+ function vt(key, params = {}, options = {}) {
996
+ const fullKey = `version.${key}`;
997
+ const locale = resolveVersionLocale(options);
998
+ const value = t(fullKey, params, locale ? { locale } : {});
999
+ if (value !== fullKey) return value;
1000
+ let fallback = ENGLISH_VERSION_LABELS[key] || key;
1001
+ for (const [paramKey, paramValue] of Object.entries(params)) {
1002
+ fallback = fallback.replace(new RegExp(`{{${paramKey}}}`, 'g'), String(paramValue));
1003
+ }
1004
+ return fallback;
1005
+ }
1006
+
972
1007
  function addVersionLine(lines, label, version, key) {
973
1008
  if (version) {
974
1009
  const display = key ? parseVersion(key, version) : version;
@@ -982,15 +1017,17 @@ function addVersionLine(lines, label, version, key) {
982
1017
  * @param {Object} versions - Version information object
983
1018
  * @returns {string} Formatted message
984
1019
  */
985
- export function formatVersionMessage(versions) {
1020
+ export function formatVersionMessage(versions, options = {}) {
1021
+ const locale = resolveVersionLocale(options);
1022
+ const vOptions = { locale };
986
1023
  const lines = [];
987
1024
 
988
1025
  // === Hive-Mind Package (single entry with restart warning) ===
989
1026
  lines.push('*🤖 Hive-Mind*');
990
1027
  if (versions.hiveMind) {
991
- lines.push(`• Version: \`${versions.hiveMind}\``);
1028
+ lines.push(`• ${vt('version', {}, vOptions)}: \`${versions.hiveMind}\``);
992
1029
  if (versions.needsRestart) {
993
- lines.push(`⚠️ _Process running: \`${versions.processVersion}\` (restart needed)_`);
1030
+ lines.push(`⚠️ _${vt('process_running_restart_needed', { processVersion: versions.processVersion }, vOptions)}_`);
994
1031
  }
995
1032
  }
996
1033
 
@@ -1006,7 +1043,7 @@ export function formatVersionMessage(versions) {
1006
1043
 
1007
1044
  if (agentLines.length > 0) {
1008
1045
  lines.push('');
1009
- lines.push('*🎭 AI Agents*');
1046
+ lines.push(`*🎭 ${vt('ai_agents', {}, vOptions)}*`);
1010
1047
  lines.push(...agentLines);
1011
1048
  }
1012
1049
 
@@ -1173,7 +1210,7 @@ export function formatVersionMessage(versions) {
1173
1210
 
1174
1211
  if (browserLines.length > 0) {
1175
1212
  lines.push('');
1176
- lines.push('*🌐 Browsers*');
1213
+ lines.push(`*🌐 ${vt('browsers', {}, vOptions)}*`);
1177
1214
  lines.push(...browserLines);
1178
1215
  }
1179
1216
 
@@ -1184,15 +1221,15 @@ export function formatVersionMessage(versions) {
1184
1221
  // Playwright MCP: show version with Claude Code and Codex connection status inline
1185
1222
  if (versions.playwrightMcp) {
1186
1223
  const mcpVersion = parseVersion('playwrightMcp', versions.playwrightMcp);
1187
- const claudeStatus = versions.playwrightMcpClaudeStatus ? 'connected' : 'not connected';
1188
- const codexStatus = versions.playwrightMcpCodexStatus ? 'connected' : 'not connected';
1224
+ const claudeStatus = versions.playwrightMcpClaudeStatus ? vt('connected', {}, vOptions) : vt('not_connected', {}, vOptions);
1225
+ const codexStatus = versions.playwrightMcpCodexStatus ? vt('connected', {}, vOptions) : vt('not_connected', {}, vOptions);
1189
1226
  browserAutoLines.push(`• Playwright MCP: \`${mcpVersion} | Claude Code: ${claudeStatus} | Codex: ${codexStatus}\``);
1190
1227
  }
1191
1228
  addVersionLine(browserAutoLines, 'Puppeteer Browsers', versions.puppeteerBrowsers, 'puppeteerBrowsers');
1192
1229
 
1193
1230
  if (browserAutoLines.length > 0) {
1194
1231
  lines.push('');
1195
- lines.push('*🎭 Browser Automation*');
1232
+ lines.push(`*🎭 ${vt('browser_automation', {}, vOptions)}*`);
1196
1233
  lines.push(...browserAutoLines);
1197
1234
  }
1198
1235
 
@@ -1212,24 +1249,24 @@ export function formatVersionMessage(versions) {
1212
1249
 
1213
1250
  if (toolLines.length > 0) {
1214
1251
  lines.push('');
1215
- lines.push('*🛠 Development Tools*');
1252
+ lines.push(`*🛠 ${vt('development_tools', {}, vOptions)}*`);
1216
1253
  lines.push(...toolLines);
1217
1254
  }
1218
1255
 
1219
1256
  // === Platform (detailed) ===
1220
1257
  {
1221
1258
  const platformLines = [];
1222
- if (versions.platformEnvironment) platformLines.push(`• Environment: \`${versions.platformEnvironment}\``);
1223
- if (versions.platformArch) platformLines.push(`• Architecture: \`${versions.platformArch}\``);
1224
- if (versions.platformOs) platformLines.push(`• OS: \`${versions.platformOs}\``);
1225
- if (versions.platformKernel) platformLines.push(`• Kernel: \`${versions.platformKernel}\``);
1259
+ if (versions.platformEnvironment) platformLines.push(`• ${vt('environment', {}, vOptions)}: \`${versions.platformEnvironment}\``);
1260
+ if (versions.platformArch) platformLines.push(`• ${vt('architecture', {}, vOptions)}: \`${versions.platformArch}\``);
1261
+ if (versions.platformOs) platformLines.push(`• ${vt('os', {}, vOptions)}: \`${versions.platformOs}\``);
1262
+ if (versions.platformKernel) platformLines.push(`• ${vt('kernel', {}, vOptions)}: \`${versions.platformKernel}\``);
1226
1263
  // Fallback to legacy single-line format
1227
1264
  if (platformLines.length === 0 && versions.platform) {
1228
- platformLines.push(`• System: \`${versions.platform}\``);
1265
+ platformLines.push(`• ${vt('system', {}, vOptions)}: \`${versions.platform}\``);
1229
1266
  }
1230
1267
  if (platformLines.length > 0) {
1231
1268
  lines.push('');
1232
- lines.push('*💻 Platform*');
1269
+ lines.push(`*💻 ${vt('platform', {}, vOptions)}*`);
1233
1270
  lines.push(...platformLines);
1234
1271
  }
1235
1272
  }