@robota-sdk/agent-cli 3.0.0-beta.12 → 3.0.0-beta.14

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/README.md CHANGED
@@ -12,6 +12,8 @@ npm install -g @robota-sdk/agent-cli
12
12
  npx @robota-sdk/agent-cli
13
13
  ```
14
14
 
15
+ > **macOS users**: Korean/CJK IME input may crash macOS Terminal.app. Use **[iTerm2](https://iterm2.com/)** instead. This is a known Ink + Terminal.app issue shared with Claude Code.
16
+
15
17
  After installing globally, the `robota` command is available system-wide:
16
18
 
17
19
  ```bash
package/dist/node/bin.cjs CHANGED
@@ -306,9 +306,16 @@ var import_ink6 = require("ink");
306
306
  // src/ui/CjkTextInput.tsx
307
307
  var import_react = require("react");
308
308
  var import_ink3 = require("ink");
309
- var import_string_width = __toESM(require("string-width"), 1);
310
309
  var import_chalk = __toESM(require("chalk"), 1);
311
310
  var import_jsx_runtime3 = require("react/jsx-runtime");
311
+ function filterPrintable(input) {
312
+ if (!input || input.length === 0) return "";
313
+ return input.replace(/[\x00-\x1f\x7f]/g, "");
314
+ }
315
+ function insertAtCursor(value, cursor, input) {
316
+ const next = value.slice(0, cursor) + input + value.slice(cursor);
317
+ return { value: next, cursor: cursor + input.length };
318
+ }
312
319
  function CjkTextInput({
313
320
  value,
314
321
  onChange,
@@ -320,7 +327,6 @@ function CjkTextInput({
320
327
  const valueRef = (0, import_react.useRef)(value);
321
328
  const cursorRef = (0, import_react.useRef)(value.length);
322
329
  const [, forceRender] = (0, import_react.useState)(0);
323
- const { setCursorPosition } = (0, import_ink3.useCursor)();
324
330
  if (value !== valueRef.current) {
325
331
  valueRef.current = value;
326
332
  if (cursorRef.current > value.length) {
@@ -353,37 +359,25 @@ function CjkTextInput({
353
359
  }
354
360
  if (key.backspace || key.delete) {
355
361
  if (cursorRef.current > 0) {
356
- const v2 = valueRef.current;
357
- const next2 = v2.slice(0, cursorRef.current - 1) + v2.slice(cursorRef.current);
362
+ const v = valueRef.current;
363
+ const next = v.slice(0, cursorRef.current - 1) + v.slice(cursorRef.current);
358
364
  cursorRef.current -= 1;
359
- valueRef.current = next2;
360
- onChange(next2);
365
+ valueRef.current = next;
366
+ onChange(next);
361
367
  }
362
368
  return;
363
369
  }
364
- if (!input || input.length === 0) return;
365
- const printable = input.replace(/[\x00-\x1f\x7f]/g, "");
370
+ const printable = filterPrintable(input);
366
371
  if (printable.length === 0) return;
367
- const v = valueRef.current;
368
- const c = cursorRef.current;
369
- const next = v.slice(0, c) + printable + v.slice(c);
370
- cursorRef.current = c + printable.length;
371
- valueRef.current = next;
372
- onChange(next);
372
+ const result = insertAtCursor(valueRef.current, cursorRef.current, printable);
373
+ cursorRef.current = result.cursor;
374
+ valueRef.current = result.value;
375
+ onChange(result.value);
373
376
  } catch {
374
377
  }
375
378
  },
376
379
  { isActive: focus }
377
380
  );
378
- if (showCursor && focus) {
379
- try {
380
- const textBeforeCursor = [...valueRef.current].slice(0, cursorRef.current).join("");
381
- const cursorX = 4 + (0, import_string_width.default)(textBeforeCursor);
382
- setCursorPosition({ x: cursorX, y: 0 });
383
- } catch {
384
- setCursorPosition({ x: 4, y: 0 });
385
- }
386
- }
387
381
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink3.Text, { children: renderWithCursor(valueRef.current, cursorRef.current, placeholder, showCursor && focus) });
388
382
  }
389
383
  function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
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-CT2VGJIF.js";
4
+ } from "./chunk-73QW5EEP.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.on("uncaughtException", (err) => {
@@ -288,10 +288,17 @@ import { Box as Box4, Text as Text6, useInput as useInput2 } from "ink";
288
288
 
289
289
  // src/ui/CjkTextInput.tsx
290
290
  import { useRef, useState } from "react";
291
- import { Text as Text3, useInput, useCursor } from "ink";
292
- import stringWidth from "string-width";
291
+ import { Text as Text3, useInput } from "ink";
293
292
  import chalk from "chalk";
294
293
  import { jsx as jsx3 } from "react/jsx-runtime";
294
+ function filterPrintable(input) {
295
+ if (!input || input.length === 0) return "";
296
+ return input.replace(/[\x00-\x1f\x7f]/g, "");
297
+ }
298
+ function insertAtCursor(value, cursor, input) {
299
+ const next = value.slice(0, cursor) + input + value.slice(cursor);
300
+ return { value: next, cursor: cursor + input.length };
301
+ }
295
302
  function CjkTextInput({
296
303
  value,
297
304
  onChange,
@@ -303,7 +310,6 @@ function CjkTextInput({
303
310
  const valueRef = useRef(value);
304
311
  const cursorRef = useRef(value.length);
305
312
  const [, forceRender] = useState(0);
306
- const { setCursorPosition } = useCursor();
307
313
  if (value !== valueRef.current) {
308
314
  valueRef.current = value;
309
315
  if (cursorRef.current > value.length) {
@@ -336,37 +342,25 @@ function CjkTextInput({
336
342
  }
337
343
  if (key.backspace || key.delete) {
338
344
  if (cursorRef.current > 0) {
339
- const v2 = valueRef.current;
340
- const next2 = v2.slice(0, cursorRef.current - 1) + v2.slice(cursorRef.current);
345
+ const v = valueRef.current;
346
+ const next = v.slice(0, cursorRef.current - 1) + v.slice(cursorRef.current);
341
347
  cursorRef.current -= 1;
342
- valueRef.current = next2;
343
- onChange(next2);
348
+ valueRef.current = next;
349
+ onChange(next);
344
350
  }
345
351
  return;
346
352
  }
347
- if (!input || input.length === 0) return;
348
- const printable = input.replace(/[\x00-\x1f\x7f]/g, "");
353
+ const printable = filterPrintable(input);
349
354
  if (printable.length === 0) return;
350
- const v = valueRef.current;
351
- const c = cursorRef.current;
352
- const next = v.slice(0, c) + printable + v.slice(c);
353
- cursorRef.current = c + printable.length;
354
- valueRef.current = next;
355
- onChange(next);
355
+ const result = insertAtCursor(valueRef.current, cursorRef.current, printable);
356
+ cursorRef.current = result.cursor;
357
+ valueRef.current = result.value;
358
+ onChange(result.value);
356
359
  } catch {
357
360
  }
358
361
  },
359
362
  { isActive: focus }
360
363
  );
361
- if (showCursor && focus) {
362
- try {
363
- const textBeforeCursor = [...valueRef.current].slice(0, cursorRef.current).join("");
364
- const cursorX = 4 + stringWidth(textBeforeCursor);
365
- setCursorPosition({ x: cursorX, y: 0 });
366
- } catch {
367
- setCursorPosition({ x: 4, y: 0 });
368
- }
369
- }
370
364
  return /* @__PURE__ */ jsx3(Text3, { children: renderWithCursor(valueRef.current, cursorRef.current, placeholder, showCursor && focus) });
371
365
  }
372
366
  function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
@@ -322,9 +322,16 @@ var import_ink6 = require("ink");
322
322
  // src/ui/CjkTextInput.tsx
323
323
  var import_react = require("react");
324
324
  var import_ink3 = require("ink");
325
- var import_string_width = __toESM(require("string-width"), 1);
326
325
  var import_chalk = __toESM(require("chalk"), 1);
327
326
  var import_jsx_runtime3 = require("react/jsx-runtime");
327
+ function filterPrintable(input) {
328
+ if (!input || input.length === 0) return "";
329
+ return input.replace(/[\x00-\x1f\x7f]/g, "");
330
+ }
331
+ function insertAtCursor(value, cursor, input) {
332
+ const next = value.slice(0, cursor) + input + value.slice(cursor);
333
+ return { value: next, cursor: cursor + input.length };
334
+ }
328
335
  function CjkTextInput({
329
336
  value,
330
337
  onChange,
@@ -336,7 +343,6 @@ function CjkTextInput({
336
343
  const valueRef = (0, import_react.useRef)(value);
337
344
  const cursorRef = (0, import_react.useRef)(value.length);
338
345
  const [, forceRender] = (0, import_react.useState)(0);
339
- const { setCursorPosition } = (0, import_ink3.useCursor)();
340
346
  if (value !== valueRef.current) {
341
347
  valueRef.current = value;
342
348
  if (cursorRef.current > value.length) {
@@ -369,37 +375,25 @@ function CjkTextInput({
369
375
  }
370
376
  if (key.backspace || key.delete) {
371
377
  if (cursorRef.current > 0) {
372
- const v2 = valueRef.current;
373
- const next2 = v2.slice(0, cursorRef.current - 1) + v2.slice(cursorRef.current);
378
+ const v = valueRef.current;
379
+ const next = v.slice(0, cursorRef.current - 1) + v.slice(cursorRef.current);
374
380
  cursorRef.current -= 1;
375
- valueRef.current = next2;
376
- onChange(next2);
381
+ valueRef.current = next;
382
+ onChange(next);
377
383
  }
378
384
  return;
379
385
  }
380
- if (!input || input.length === 0) return;
381
- const printable = input.replace(/[\x00-\x1f\x7f]/g, "");
386
+ const printable = filterPrintable(input);
382
387
  if (printable.length === 0) return;
383
- const v = valueRef.current;
384
- const c = cursorRef.current;
385
- const next = v.slice(0, c) + printable + v.slice(c);
386
- cursorRef.current = c + printable.length;
387
- valueRef.current = next;
388
- onChange(next);
388
+ const result = insertAtCursor(valueRef.current, cursorRef.current, printable);
389
+ cursorRef.current = result.cursor;
390
+ valueRef.current = result.value;
391
+ onChange(result.value);
389
392
  } catch {
390
393
  }
391
394
  },
392
395
  { isActive: focus }
393
396
  );
394
- if (showCursor && focus) {
395
- try {
396
- const textBeforeCursor = [...valueRef.current].slice(0, cursorRef.current).join("");
397
- const cursorX = 4 + (0, import_string_width.default)(textBeforeCursor);
398
- setCursorPosition({ x: cursorX, y: 0 });
399
- } catch {
400
- setCursorPosition({ x: 4, y: 0 });
401
- }
402
- }
403
397
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink3.Text, { children: renderWithCursor(valueRef.current, cursorRef.current, placeholder, showCursor && focus) });
404
398
  }
405
399
  function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startCli
3
- } from "./chunk-CT2VGJIF.js";
3
+ } from "./chunk-73QW5EEP.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.12",
3
+ "version": "3.0.0-beta.14",
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.12",
39
- "@robota-sdk/agent-sdk": "3.0.0-beta.12"
38
+ "@robota-sdk/agent-core": "3.0.0-beta.14",
39
+ "@robota-sdk/agent-sdk": "3.0.0-beta.14"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/marked": "^6.0.0",