@dmsdc-ai/aigentry-deliberation 0.0.27 → 0.0.28

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/doctor.js CHANGED
@@ -216,25 +216,25 @@ function suggestFix(serverName, server, issue) {
216
216
  }
217
217
  if (isNpxCommand(server)) {
218
218
  const pkg = (server.args || []).find((a) => a.startsWith("@") || !a.startsWith("-"));
219
- return pkg ? `npx -y ${pkg} # npx 서버는 자동 설치됩니다` : null;
219
+ return pkg ? `npx -y ${pkg} # npx server will be installed automatically` : null;
220
220
  }
221
- return `# ${serverName}: 서버 파일을 올바른 경로에 설치하세요`;
221
+ return `# ${serverName}: install the server file to the correct path`;
222
222
 
223
223
  case "temp_path": {
224
224
  const tempArg = (server.args || []).find((a) => isTempPath(a));
225
225
  if (serverName === "deliberation" || serverName === "mcp-deliberation") {
226
- return `npx @dmsdc-ai/aigentry-deliberation install # 영구 경로로 재설치`;
226
+ return `npx @dmsdc-ai/aigentry-deliberation install # reinstall to permanent path`;
227
227
  }
228
228
  if (serverName.includes("brain") || serverName.includes("aigentry-brain")) {
229
- return `npx @dmsdc-ai/aigentry-brain install # 영구 경로로 재설치`;
229
+ return `npx @dmsdc-ai/aigentry-brain install # reinstall to permanent path`;
230
230
  }
231
- return `# ${serverName}: 임시 경로(${tempArg}) → 영구 경로로 변경 필요`;
231
+ return `# ${serverName}: temporary path (${tempArg}) → change to permanent path`;
232
232
  }
233
233
 
234
234
  case "module_not_found":
235
235
  if (isNpxCommand(server)) {
236
236
  const pkg = (server.args || []).find((a) => a.startsWith("@") || !a.startsWith("-"));
237
- return pkg ? `npm install -g ${pkg}` : `# ${serverName}: 패키지를 전역 설치하세요`;
237
+ return pkg ? `npm install -g ${pkg}` : `# ${serverName}: install the package globally`;
238
238
  }
239
239
  return `cd $(dirname "${(server.args || [])[0] || ""}") && npm install`;
240
240
 
@@ -259,7 +259,7 @@ function runDiagnostics() {
259
259
  console.log(`\n📋 ${cfg.name}: ${cfg.path}`);
260
260
 
261
261
  if (!fs.existsSync(cfg.path)) {
262
- console.log(" ⚠️ 설정 파일 없음 (스킵)");
262
+ console.log(" ⚠️ Config file not found (skipping)");
263
263
  continue;
264
264
  }
265
265
 
@@ -271,13 +271,13 @@ function runDiagnostics() {
271
271
  } else {
272
272
  servers = parseMcpServersFromJson(content);
273
273
  if (servers === null) {
274
- console.log(" ❌ JSON 파싱 실패");
274
+ console.log(" ❌ JSON parsing failed");
275
275
  totalIssues++;
276
276
  allIssues.push({
277
277
  config: cfg.name,
278
- server: "(전체)",
279
- issue: "JSON 파싱 실패",
280
- fix: `# ${cfg.path} 파일의 JSON 문법을 확인하세요`,
278
+ server: "(all)",
279
+ issue: "JSON parsing failed",
280
+ fix: `# Check the JSON syntax in ${cfg.path}`,
281
281
  });
282
282
  continue;
283
283
  }
@@ -285,7 +285,7 @@ function runDiagnostics() {
285
285
 
286
286
  const serverEntries = Object.entries(servers);
287
287
  if (serverEntries.length === 0) {
288
- console.log(" (등록된 MCP 서버 없음)");
288
+ console.log(" (no registered MCP servers)");
289
289
  continue;
290
290
  }
291
291
 
@@ -296,7 +296,7 @@ function runDiagnostics() {
296
296
 
297
297
  // Check 1: npx command (volatile but expected)
298
298
  if (isNpxCommand(server)) {
299
- console.log(` ✅ ${name}: npx (자동 설치)`);
299
+ console.log(` ✅ ${name}: npx (auto-install)`);
300
300
  continue;
301
301
  }
302
302
 
@@ -310,22 +310,22 @@ function runDiagnostics() {
310
310
  }
311
311
 
312
312
  if (issues.length === 0) {
313
- console.log(` ✅ ${name}: 정상`);
313
+ console.log(` ✅ ${name}: OK`);
314
314
  } else {
315
315
  for (const issue of issues) {
316
316
  totalIssues++;
317
317
  const fix = suggestFix(name, server, issue.type);
318
318
  const label =
319
319
  issue.type === "path_missing"
320
- ? "❌ 경로 없음"
321
- : "⚠️ 임시 경로";
320
+ ? "❌ Path not found"
321
+ : "⚠️ Temporary path";
322
322
  console.log(` ${label}: ${name}`);
323
- console.log(` 경로: ${issue.detail}`);
324
- if (fix) console.log(` 복구: ${fix}`);
323
+ console.log(` path: ${issue.detail}`);
324
+ if (fix) console.log(` fix: ${fix}`);
325
325
  allIssues.push({
326
326
  config: cfg.name,
327
327
  server: name,
328
- issue: label,
328
+ issue: issue.type === "path_missing" ? "Path not found" : "Temporary path",
329
329
  path: issue.detail,
330
330
  fix,
331
331
  });
@@ -336,11 +336,11 @@ function runDiagnostics() {
336
336
 
337
337
  // ── Phase 2: MODULE_NOT_FOUND log scan ──
338
338
 
339
- console.log(`\n📜 로그 스캔 (MODULE_NOT_FOUND)`);
339
+ console.log(`\n📜 Log scan (MODULE_NOT_FOUND)`);
340
340
  const moduleFindings = scanLogsForModuleNotFound(LOG_LOCATIONS);
341
341
 
342
342
  if (moduleFindings.length === 0) {
343
- console.log(" ✅ MODULE_NOT_FOUND 흔적 없음");
343
+ console.log(" ✅ No MODULE_NOT_FOUND traces found");
344
344
  } else {
345
345
  // Deduplicate by module path
346
346
  const seen = new Set();
@@ -355,24 +355,24 @@ function runDiagnostics() {
355
355
  const mod = f.module;
356
356
  if (isTempPath(mod)) {
357
357
  if (mod.includes("aigentry-brain") || mod.includes("brain")) {
358
- fix = `npx @dmsdc-ai/aigentry-brain install # 임시 경로영구 설치`;
358
+ fix = `npx @dmsdc-ai/aigentry-brain install # temporary pathreinstall to permanent path`;
359
359
  } else if (mod.includes("deliberation") || mod.includes("mcp-deliberation")) {
360
- fix = `npx @dmsdc-ai/aigentry-deliberation install # 임시 경로영구 설치`;
360
+ fix = `npx @dmsdc-ai/aigentry-deliberation install # temporary pathreinstall to permanent path`;
361
361
  } else {
362
- fix = `# 임시 경로(${mod}) — MCP 설정에서 영구 경로로 변경 필요`;
362
+ fix = `# temporary path (${mod}) — change to permanent path in MCP config`;
363
363
  }
364
364
  } else {
365
- fix = `# ${mod} 파일이 존재하지 않음해당 MCP 서버 재설치 필요`;
365
+ fix = `# ${mod} file does not exist reinstall the MCP server`;
366
366
  }
367
367
 
368
- console.log(` 복구: ${fix}`);
368
+ console.log(` fix: ${fix}`);
369
369
  allIssues.push({ config: "logs", server: mod, issue: "MODULE_NOT_FOUND", fix });
370
370
  }
371
371
  }
372
372
 
373
373
  // ── Phase 3: deliberation self-check ──
374
374
 
375
- console.log(`\n🔍 deliberation 자체 점검`);
375
+ console.log(`\n🔍 deliberation self-check`);
376
376
  const installDir = IS_WIN
377
377
  ? path.join(
378
378
  process.env.LOCALAPPDATA ||
@@ -383,43 +383,43 @@ function runDiagnostics() {
383
383
 
384
384
  const selfPath = path.join(installDir, "index.js");
385
385
  if (checkPathExists(selfPath)) {
386
- console.log(` ✅ 서버 파일: ${selfPath}`);
386
+ console.log(` ✅ Server file: ${selfPath}`);
387
387
  } else {
388
388
  totalIssues++;
389
- console.log(` ❌ 서버 파일 없음: ${selfPath}`);
390
- console.log(` 복구: npx @dmsdc-ai/aigentry-deliberation install`);
389
+ console.log(` ❌ Server file not found: ${selfPath}`);
390
+ console.log(` fix: npx @dmsdc-ai/aigentry-deliberation install`);
391
391
  }
392
392
 
393
393
  // Check node_modules
394
394
  const nodeModules = path.join(installDir, "node_modules");
395
395
  if (checkPathExists(nodeModules)) {
396
- console.log(` ✅ node_modules: 설치됨`);
396
+ console.log(` ✅ node_modules: installed`);
397
397
  } else {
398
398
  totalIssues++;
399
- console.log(` ❌ node_modules 없음`);
400
- console.log(` 복구: cd ${installDir} && npm install`);
399
+ console.log(` ❌ node_modules not found`);
400
+ console.log(` fix: cd ${installDir} && npm install`);
401
401
  }
402
402
 
403
403
  // Syntax check
404
404
  try {
405
405
  execSync(`node --check "${selfPath}"`, { stdio: "pipe", timeout: 5000 });
406
- console.log(` ✅ 문법 검증: 통과`);
406
+ console.log(` ✅ Syntax check: passed`);
407
407
  } catch {
408
408
  totalIssues++;
409
- console.log(` ❌ 문법 오류 감지`);
410
- console.log(` 복구: npx @dmsdc-ai/aigentry-deliberation install`);
409
+ console.log(` ❌ Syntax error detected`);
410
+ console.log(` fix: npx @dmsdc-ai/aigentry-deliberation install`);
411
411
  }
412
412
 
413
413
  // ── Summary ──
414
414
 
415
415
  console.log("\n" + "━".repeat(60));
416
416
  if (totalIssues === 0) {
417
- console.log(`\n✅ 전체 정상 — ${totalServers} MCP 서버 점검 완료\n`);
417
+ console.log(`\n✅ All OK — ${totalServers} MCP server(s) checked\n`);
418
418
  } else {
419
- console.log(`\n❌ ${totalIssues} 문제 발견 (${totalServers} 서버 점검)\n`);
419
+ console.log(`\n❌ ${totalIssues} issue(s) found (${totalServers} server(s) checked)\n`);
420
420
 
421
421
  if (allIssues.length > 0) {
422
- console.log("📌 즉시 복구 커맨드:\n");
422
+ console.log("📌 Recovery commands:\n");
423
423
  const fixSet = new Set();
424
424
  for (const issue of allIssues) {
425
425
  if (issue.fix && !fixSet.has(issue.fix)) {
package/i18n.js ADDED
@@ -0,0 +1,40 @@
1
+ /**
2
+ * i18n — Dynamic language detection and translation helper
3
+ *
4
+ * Default language is English. When a user writes in Korean,
5
+ * the system detects it and responds in Korean from that point.
6
+ */
7
+
8
+ const KOREAN_RANGE = /[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F]/;
9
+
10
+ /**
11
+ * Detect language from text. Returns "ko" if Korean characters are found, "en" otherwise.
12
+ * @param {string} text
13
+ * @returns {"en"|"ko"}
14
+ */
15
+ export function detectLang(text) {
16
+ if (!text || typeof text !== "string") return "en";
17
+ return KOREAN_RANGE.test(text) ? "ko" : "en";
18
+ }
19
+
20
+ /**
21
+ * Return the appropriate translation based on language.
22
+ * @param {string} en - English text (default)
23
+ * @param {string} ko - Korean text
24
+ * @param {string} [lang="en"] - Target language
25
+ * @returns {string}
26
+ */
27
+ export function t(en, ko, lang) {
28
+ return lang === "ko" ? ko : en;
29
+ }
30
+
31
+ /**
32
+ * Template translation with variable substitution.
33
+ * Variables in the template use ${varName} syntax (pre-substituted by JS template literals).
34
+ * This is a convenience alias when you need to pick between pre-built en/ko strings.
35
+ * @param {string} en - English template (already interpolated)
36
+ * @param {string} ko - Korean template (already interpolated)
37
+ * @param {string} [lang="en"]
38
+ * @returns {string}
39
+ */
40
+ export const tt = t;