@robota-sdk/agent-cli 3.0.0-beta.21 → 3.0.0-beta.23

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/dist/node/bin.cjs CHANGED
@@ -60,6 +60,7 @@ function parseCliArgs() {
60
60
  c: { type: "boolean", short: "c", default: false },
61
61
  r: { type: "string", short: "r" },
62
62
  model: { type: "string" },
63
+ language: { type: "string" },
63
64
  "permission-mode": { type: "string" },
64
65
  "max-turns": { type: "string" },
65
66
  version: { type: "boolean", default: false },
@@ -72,6 +73,7 @@ function parseCliArgs() {
72
73
  continueMode: values["c"] ?? false,
73
74
  resumeId: values["r"],
74
75
  model: values["model"],
76
+ language: values["language"],
75
77
  permissionMode: parsePermissionMode(values["permission-mode"]),
76
78
  maxTurns: parseMaxTurns(values["max-turns"]),
77
79
  version: values["version"] ?? false,
@@ -290,6 +292,7 @@ var HELP_TEXT = [
290
292
  " /clear \u2014 Clear conversation",
291
293
  " /compact [instr] \u2014 Compact context (optional focus instructions)",
292
294
  " /mode [m] \u2014 Show/change permission mode",
295
+ " /language [lang] \u2014 Set response language (ko, en, ja, zh)",
293
296
  " /cost \u2014 Show session info",
294
297
  " /reset \u2014 Delete settings and exit",
295
298
  " /exit \u2014 Exit CLI"
@@ -362,6 +365,18 @@ function handleContext(session, addMessage) {
362
365
  });
363
366
  return { handled: true };
364
367
  }
368
+ function handleLanguage(lang, addMessage) {
369
+ if (!lang) {
370
+ addMessage({ role: "system", content: "Usage: /language <code> (e.g., ko, en, ja, zh)" });
371
+ return { handled: true };
372
+ }
373
+ const settingsPath = getUserSettingsPath();
374
+ const settings = readSettings(settingsPath);
375
+ settings.language = lang;
376
+ writeSettings(settingsPath, settings);
377
+ addMessage({ role: "system", content: `Language set to "${lang}". Restarting...` });
378
+ return { handled: true, exitRequested: true };
379
+ }
365
380
  function handleReset(addMessage) {
366
381
  const settingsPath = getUserSettingsPath();
367
382
  if (deleteSettings(settingsPath)) {
@@ -383,6 +398,8 @@ async function executeSlashCommand(cmd, args, session, addMessage, clearMessages
383
398
  return handleMode(args.split(/\s+/)[0] || void 0, session, addMessage);
384
399
  case "model":
385
400
  return handleModel(args.split(/\s+/)[0] || void 0, addMessage);
401
+ case "language":
402
+ return handleLanguage(args.split(/\s+/)[0] || void 0, addMessage);
386
403
  case "cost":
387
404
  return handleCost(session, addMessage);
388
405
  case "permissions":
@@ -600,6 +617,17 @@ function createBuiltinCommands() {
600
617
  source: "builtin",
601
618
  subcommands: buildModelSubcommands()
602
619
  },
620
+ {
621
+ name: "language",
622
+ description: "Set response language",
623
+ source: "builtin",
624
+ subcommands: [
625
+ { name: "ko", description: "Korean", source: "builtin" },
626
+ { name: "en", description: "English", source: "builtin" },
627
+ { name: "ja", description: "Japanese", source: "builtin" },
628
+ { name: "zh", description: "Chinese", source: "builtin" }
629
+ ]
630
+ },
603
631
  { name: "compact", description: "Compress context window", source: "builtin" },
604
632
  { name: "cost", description: "Show session info", source: "builtin" },
605
633
  { name: "context", description: "Context window info", source: "builtin" },
@@ -1415,19 +1443,9 @@ function readVersion() {
1415
1443
  return "0.0.0";
1416
1444
  }
1417
1445
  }
1418
- async function ensureConfig(cwd) {
1419
- const userPath = getUserSettingsPath();
1420
- const projectPath = (0, import_node_path3.join)(cwd, ".robota", "settings.json");
1421
- const localPath = (0, import_node_path3.join)(cwd, ".robota", "settings.local.json");
1422
- if (hasValidSettingsFile(userPath) || hasValidSettingsFile(projectPath) || hasValidSettingsFile(localPath)) {
1423
- return;
1424
- }
1425
- process.stdout.write("\n");
1426
- process.stdout.write(" Welcome to Robota CLI!\n");
1427
- process.stdout.write(" No configuration found. Let's set up your API key.\n");
1428
- process.stdout.write("\n");
1429
- const apiKey = await new Promise((resolve) => {
1430
- process.stdout.write(" Anthropic API key: ");
1446
+ function promptInput(label, masked = false) {
1447
+ return new Promise((resolve) => {
1448
+ process.stdout.write(label);
1431
1449
  let input = "";
1432
1450
  const stdin = process.stdin;
1433
1451
  const wasRaw = stdin.isRaw;
@@ -1453,16 +1471,30 @@ async function ensureConfig(cwd) {
1453
1471
  process.exit(0);
1454
1472
  } else if (ch.charCodeAt(0) >= 32) {
1455
1473
  input += ch;
1456
- process.stdout.write("*");
1474
+ process.stdout.write(masked ? "*" : ch);
1457
1475
  }
1458
1476
  }
1459
1477
  };
1460
1478
  stdin.on("data", onData);
1461
1479
  });
1480
+ }
1481
+ async function ensureConfig(cwd) {
1482
+ const userPath = getUserSettingsPath();
1483
+ const projectPath = (0, import_node_path3.join)(cwd, ".robota", "settings.json");
1484
+ const localPath = (0, import_node_path3.join)(cwd, ".robota", "settings.local.json");
1485
+ if (hasValidSettingsFile(userPath) || hasValidSettingsFile(projectPath) || hasValidSettingsFile(localPath)) {
1486
+ return;
1487
+ }
1488
+ process.stdout.write("\n");
1489
+ process.stdout.write(" Welcome to Robota CLI!\n");
1490
+ process.stdout.write(" No configuration found. Let's set up.\n");
1491
+ process.stdout.write("\n");
1492
+ const apiKey = await promptInput(" Anthropic API key: ", true);
1462
1493
  if (!apiKey) {
1463
1494
  process.stderr.write("\n No API key provided. Exiting.\n");
1464
1495
  process.exit(1);
1465
1496
  }
1497
+ const language = await promptInput(" Response language (ko/en/ja/zh, default: en): ");
1466
1498
  const settingsDir = (0, import_node_path3.dirname)(userPath);
1467
1499
  (0, import_node_fs3.mkdirSync)(settingsDir, { recursive: true });
1468
1500
  const settings = {
@@ -1472,6 +1504,9 @@ async function ensureConfig(cwd) {
1472
1504
  apiKey
1473
1505
  }
1474
1506
  };
1507
+ if (language) {
1508
+ settings.language = language;
1509
+ }
1475
1510
  (0, import_node_fs3.writeFileSync)(userPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
1476
1511
  process.stdout.write(`
1477
1512
  Config saved to ${userPath}
@@ -1508,6 +1543,9 @@ async function startCli() {
1508
1543
  if (args.model !== void 0) {
1509
1544
  config.provider.model = args.model;
1510
1545
  }
1546
+ if (args.language !== void 0) {
1547
+ config.language = args.language;
1548
+ }
1511
1549
  const sessionStore = new import_agent_sdk2.SessionStore();
1512
1550
  if (args.printMode) {
1513
1551
  const prompt = args.positional.join(" ").trim();
package/dist/node/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startCli
4
- } from "./chunk-RE4JCNEA.js";
4
+ } from "./chunk-EFSOR6D7.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.on("uncaughtException", (err) => {
@@ -43,6 +43,7 @@ function parseCliArgs() {
43
43
  c: { type: "boolean", short: "c", default: false },
44
44
  r: { type: "string", short: "r" },
45
45
  model: { type: "string" },
46
+ language: { type: "string" },
46
47
  "permission-mode": { type: "string" },
47
48
  "max-turns": { type: "string" },
48
49
  version: { type: "boolean", default: false },
@@ -55,6 +56,7 @@ function parseCliArgs() {
55
56
  continueMode: values["c"] ?? false,
56
57
  resumeId: values["r"],
57
58
  model: values["model"],
59
+ language: values["language"],
58
60
  permissionMode: parsePermissionMode(values["permission-mode"]),
59
61
  maxTurns: parseMaxTurns(values["max-turns"]),
60
62
  version: values["version"] ?? false,
@@ -273,6 +275,7 @@ var HELP_TEXT = [
273
275
  " /clear \u2014 Clear conversation",
274
276
  " /compact [instr] \u2014 Compact context (optional focus instructions)",
275
277
  " /mode [m] \u2014 Show/change permission mode",
278
+ " /language [lang] \u2014 Set response language (ko, en, ja, zh)",
276
279
  " /cost \u2014 Show session info",
277
280
  " /reset \u2014 Delete settings and exit",
278
281
  " /exit \u2014 Exit CLI"
@@ -345,6 +348,18 @@ function handleContext(session, addMessage) {
345
348
  });
346
349
  return { handled: true };
347
350
  }
351
+ function handleLanguage(lang, addMessage) {
352
+ if (!lang) {
353
+ addMessage({ role: "system", content: "Usage: /language <code> (e.g., ko, en, ja, zh)" });
354
+ return { handled: true };
355
+ }
356
+ const settingsPath = getUserSettingsPath();
357
+ const settings = readSettings(settingsPath);
358
+ settings.language = lang;
359
+ writeSettings(settingsPath, settings);
360
+ addMessage({ role: "system", content: `Language set to "${lang}". Restarting...` });
361
+ return { handled: true, exitRequested: true };
362
+ }
348
363
  function handleReset(addMessage) {
349
364
  const settingsPath = getUserSettingsPath();
350
365
  if (deleteSettings(settingsPath)) {
@@ -366,6 +381,8 @@ async function executeSlashCommand(cmd, args, session, addMessage, clearMessages
366
381
  return handleMode(args.split(/\s+/)[0] || void 0, session, addMessage);
367
382
  case "model":
368
383
  return handleModel(args.split(/\s+/)[0] || void 0, addMessage);
384
+ case "language":
385
+ return handleLanguage(args.split(/\s+/)[0] || void 0, addMessage);
369
386
  case "cost":
370
387
  return handleCost(session, addMessage);
371
388
  case "permissions":
@@ -583,6 +600,17 @@ function createBuiltinCommands() {
583
600
  source: "builtin",
584
601
  subcommands: buildModelSubcommands()
585
602
  },
603
+ {
604
+ name: "language",
605
+ description: "Set response language",
606
+ source: "builtin",
607
+ subcommands: [
608
+ { name: "ko", description: "Korean", source: "builtin" },
609
+ { name: "en", description: "English", source: "builtin" },
610
+ { name: "ja", description: "Japanese", source: "builtin" },
611
+ { name: "zh", description: "Chinese", source: "builtin" }
612
+ ]
613
+ },
586
614
  { name: "compact", description: "Compress context window", source: "builtin" },
587
615
  { name: "cost", description: "Show session info", source: "builtin" },
588
616
  { name: "context", description: "Context window info", source: "builtin" },
@@ -1397,19 +1425,9 @@ function readVersion() {
1397
1425
  return "0.0.0";
1398
1426
  }
1399
1427
  }
1400
- async function ensureConfig(cwd) {
1401
- const userPath = getUserSettingsPath();
1402
- const projectPath = join3(cwd, ".robota", "settings.json");
1403
- const localPath = join3(cwd, ".robota", "settings.local.json");
1404
- if (hasValidSettingsFile(userPath) || hasValidSettingsFile(projectPath) || hasValidSettingsFile(localPath)) {
1405
- return;
1406
- }
1407
- process.stdout.write("\n");
1408
- process.stdout.write(" Welcome to Robota CLI!\n");
1409
- process.stdout.write(" No configuration found. Let's set up your API key.\n");
1410
- process.stdout.write("\n");
1411
- const apiKey = await new Promise((resolve) => {
1412
- process.stdout.write(" Anthropic API key: ");
1428
+ function promptInput(label, masked = false) {
1429
+ return new Promise((resolve) => {
1430
+ process.stdout.write(label);
1413
1431
  let input = "";
1414
1432
  const stdin = process.stdin;
1415
1433
  const wasRaw = stdin.isRaw;
@@ -1435,16 +1453,30 @@ async function ensureConfig(cwd) {
1435
1453
  process.exit(0);
1436
1454
  } else if (ch.charCodeAt(0) >= 32) {
1437
1455
  input += ch;
1438
- process.stdout.write("*");
1456
+ process.stdout.write(masked ? "*" : ch);
1439
1457
  }
1440
1458
  }
1441
1459
  };
1442
1460
  stdin.on("data", onData);
1443
1461
  });
1462
+ }
1463
+ async function ensureConfig(cwd) {
1464
+ const userPath = getUserSettingsPath();
1465
+ const projectPath = join3(cwd, ".robota", "settings.json");
1466
+ const localPath = join3(cwd, ".robota", "settings.local.json");
1467
+ if (hasValidSettingsFile(userPath) || hasValidSettingsFile(projectPath) || hasValidSettingsFile(localPath)) {
1468
+ return;
1469
+ }
1470
+ process.stdout.write("\n");
1471
+ process.stdout.write(" Welcome to Robota CLI!\n");
1472
+ process.stdout.write(" No configuration found. Let's set up.\n");
1473
+ process.stdout.write("\n");
1474
+ const apiKey = await promptInput(" Anthropic API key: ", true);
1444
1475
  if (!apiKey) {
1445
1476
  process.stderr.write("\n No API key provided. Exiting.\n");
1446
1477
  process.exit(1);
1447
1478
  }
1479
+ const language = await promptInput(" Response language (ko/en/ja/zh, default: en): ");
1448
1480
  const settingsDir = dirname2(userPath);
1449
1481
  mkdirSync2(settingsDir, { recursive: true });
1450
1482
  const settings = {
@@ -1454,6 +1486,9 @@ async function ensureConfig(cwd) {
1454
1486
  apiKey
1455
1487
  }
1456
1488
  };
1489
+ if (language) {
1490
+ settings.language = language;
1491
+ }
1457
1492
  writeFileSync2(userPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
1458
1493
  process.stdout.write(`
1459
1494
  Config saved to ${userPath}
@@ -1490,6 +1525,9 @@ async function startCli() {
1490
1525
  if (args.model !== void 0) {
1491
1526
  config.provider.model = args.model;
1492
1527
  }
1528
+ if (args.language !== void 0) {
1529
+ config.language = args.language;
1530
+ }
1493
1531
  const sessionStore = new SessionStore();
1494
1532
  if (args.printMode) {
1495
1533
  const prompt = args.positional.join(" ").trim();
@@ -76,6 +76,7 @@ function parseCliArgs() {
76
76
  c: { type: "boolean", short: "c", default: false },
77
77
  r: { type: "string", short: "r" },
78
78
  model: { type: "string" },
79
+ language: { type: "string" },
79
80
  "permission-mode": { type: "string" },
80
81
  "max-turns": { type: "string" },
81
82
  version: { type: "boolean", default: false },
@@ -88,6 +89,7 @@ function parseCliArgs() {
88
89
  continueMode: values["c"] ?? false,
89
90
  resumeId: values["r"],
90
91
  model: values["model"],
92
+ language: values["language"],
91
93
  permissionMode: parsePermissionMode(values["permission-mode"]),
92
94
  maxTurns: parseMaxTurns(values["max-turns"]),
93
95
  version: values["version"] ?? false,
@@ -306,6 +308,7 @@ var HELP_TEXT = [
306
308
  " /clear \u2014 Clear conversation",
307
309
  " /compact [instr] \u2014 Compact context (optional focus instructions)",
308
310
  " /mode [m] \u2014 Show/change permission mode",
311
+ " /language [lang] \u2014 Set response language (ko, en, ja, zh)",
309
312
  " /cost \u2014 Show session info",
310
313
  " /reset \u2014 Delete settings and exit",
311
314
  " /exit \u2014 Exit CLI"
@@ -378,6 +381,18 @@ function handleContext(session, addMessage) {
378
381
  });
379
382
  return { handled: true };
380
383
  }
384
+ function handleLanguage(lang, addMessage) {
385
+ if (!lang) {
386
+ addMessage({ role: "system", content: "Usage: /language <code> (e.g., ko, en, ja, zh)" });
387
+ return { handled: true };
388
+ }
389
+ const settingsPath = getUserSettingsPath();
390
+ const settings = readSettings(settingsPath);
391
+ settings.language = lang;
392
+ writeSettings(settingsPath, settings);
393
+ addMessage({ role: "system", content: `Language set to "${lang}". Restarting...` });
394
+ return { handled: true, exitRequested: true };
395
+ }
381
396
  function handleReset(addMessage) {
382
397
  const settingsPath = getUserSettingsPath();
383
398
  if (deleteSettings(settingsPath)) {
@@ -399,6 +414,8 @@ async function executeSlashCommand(cmd, args, session, addMessage, clearMessages
399
414
  return handleMode(args.split(/\s+/)[0] || void 0, session, addMessage);
400
415
  case "model":
401
416
  return handleModel(args.split(/\s+/)[0] || void 0, addMessage);
417
+ case "language":
418
+ return handleLanguage(args.split(/\s+/)[0] || void 0, addMessage);
402
419
  case "cost":
403
420
  return handleCost(session, addMessage);
404
421
  case "permissions":
@@ -616,6 +633,17 @@ function createBuiltinCommands() {
616
633
  source: "builtin",
617
634
  subcommands: buildModelSubcommands()
618
635
  },
636
+ {
637
+ name: "language",
638
+ description: "Set response language",
639
+ source: "builtin",
640
+ subcommands: [
641
+ { name: "ko", description: "Korean", source: "builtin" },
642
+ { name: "en", description: "English", source: "builtin" },
643
+ { name: "ja", description: "Japanese", source: "builtin" },
644
+ { name: "zh", description: "Chinese", source: "builtin" }
645
+ ]
646
+ },
619
647
  { name: "compact", description: "Compress context window", source: "builtin" },
620
648
  { name: "cost", description: "Show session info", source: "builtin" },
621
649
  { name: "context", description: "Context window info", source: "builtin" },
@@ -1431,19 +1459,9 @@ function readVersion() {
1431
1459
  return "0.0.0";
1432
1460
  }
1433
1461
  }
1434
- async function ensureConfig(cwd) {
1435
- const userPath = getUserSettingsPath();
1436
- const projectPath = (0, import_node_path3.join)(cwd, ".robota", "settings.json");
1437
- const localPath = (0, import_node_path3.join)(cwd, ".robota", "settings.local.json");
1438
- if (hasValidSettingsFile(userPath) || hasValidSettingsFile(projectPath) || hasValidSettingsFile(localPath)) {
1439
- return;
1440
- }
1441
- process.stdout.write("\n");
1442
- process.stdout.write(" Welcome to Robota CLI!\n");
1443
- process.stdout.write(" No configuration found. Let's set up your API key.\n");
1444
- process.stdout.write("\n");
1445
- const apiKey = await new Promise((resolve) => {
1446
- process.stdout.write(" Anthropic API key: ");
1462
+ function promptInput(label, masked = false) {
1463
+ return new Promise((resolve) => {
1464
+ process.stdout.write(label);
1447
1465
  let input = "";
1448
1466
  const stdin = process.stdin;
1449
1467
  const wasRaw = stdin.isRaw;
@@ -1469,16 +1487,30 @@ async function ensureConfig(cwd) {
1469
1487
  process.exit(0);
1470
1488
  } else if (ch.charCodeAt(0) >= 32) {
1471
1489
  input += ch;
1472
- process.stdout.write("*");
1490
+ process.stdout.write(masked ? "*" : ch);
1473
1491
  }
1474
1492
  }
1475
1493
  };
1476
1494
  stdin.on("data", onData);
1477
1495
  });
1496
+ }
1497
+ async function ensureConfig(cwd) {
1498
+ const userPath = getUserSettingsPath();
1499
+ const projectPath = (0, import_node_path3.join)(cwd, ".robota", "settings.json");
1500
+ const localPath = (0, import_node_path3.join)(cwd, ".robota", "settings.local.json");
1501
+ if (hasValidSettingsFile(userPath) || hasValidSettingsFile(projectPath) || hasValidSettingsFile(localPath)) {
1502
+ return;
1503
+ }
1504
+ process.stdout.write("\n");
1505
+ process.stdout.write(" Welcome to Robota CLI!\n");
1506
+ process.stdout.write(" No configuration found. Let's set up.\n");
1507
+ process.stdout.write("\n");
1508
+ const apiKey = await promptInput(" Anthropic API key: ", true);
1478
1509
  if (!apiKey) {
1479
1510
  process.stderr.write("\n No API key provided. Exiting.\n");
1480
1511
  process.exit(1);
1481
1512
  }
1513
+ const language = await promptInput(" Response language (ko/en/ja/zh, default: en): ");
1482
1514
  const settingsDir = (0, import_node_path3.dirname)(userPath);
1483
1515
  (0, import_node_fs3.mkdirSync)(settingsDir, { recursive: true });
1484
1516
  const settings = {
@@ -1488,6 +1520,9 @@ async function ensureConfig(cwd) {
1488
1520
  apiKey
1489
1521
  }
1490
1522
  };
1523
+ if (language) {
1524
+ settings.language = language;
1525
+ }
1491
1526
  (0, import_node_fs3.writeFileSync)(userPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
1492
1527
  process.stdout.write(`
1493
1528
  Config saved to ${userPath}
@@ -1524,6 +1559,9 @@ async function startCli() {
1524
1559
  if (args.model !== void 0) {
1525
1560
  config.provider.model = args.model;
1526
1561
  }
1562
+ if (args.language !== void 0) {
1563
+ config.language = args.language;
1564
+ }
1527
1565
  const sessionStore = new import_agent_sdk2.SessionStore();
1528
1566
  if (args.printMode) {
1529
1567
  const prompt = args.positional.join(" ").trim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startCli
3
- } from "./chunk-RE4JCNEA.js";
3
+ } from "./chunk-EFSOR6D7.js";
4
4
 
5
5
  // src/index.ts
6
6
  import { Session, SessionStore, query, TRUST_TO_MODE } from "@robota-sdk/agent-sdk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robota-sdk/agent-cli",
3
- "version": "3.0.0-beta.21",
3
+ "version": "3.0.0-beta.23",
4
4
  "description": "AI coding assistant CLI built on Robota SDK",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,8 +35,8 @@
35
35
  "marked-terminal": "^7.3.0",
36
36
  "react": "19.2.4",
37
37
  "string-width": "^8.2.0",
38
- "@robota-sdk/agent-core": "3.0.0-beta.21",
39
- "@robota-sdk/agent-sdk": "3.0.0-beta.21"
38
+ "@robota-sdk/agent-core": "3.0.0-beta.23",
39
+ "@robota-sdk/agent-sdk": "3.0.0-beta.23"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/marked": "^6.0.0",