sanook-cli 0.5.10 → 0.5.13

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.
@@ -1,9 +1,10 @@
1
+ import { clipToWidth } from './text-width.js';
1
2
  const THINKING_CHAR_LIMIT = 2_000;
2
3
  const THINKING_LINE_LIMIT = 6;
4
+ // display-width aware: the panel body is the model's Thai reasoning — .length-based clipping under-fills
5
+ // the line and can split a cluster (orphaned tone mark)
3
6
  function clip(text, width) {
4
- if (width <= 0)
5
- return '';
6
- return text.length > width ? `${text.slice(0, Math.max(0, width - 3))}...` : text;
7
+ return clipToWidth(text, width, '...');
7
8
  }
8
9
  function normalize(text) {
9
10
  return text.replace(/\s+/g, ' ').trim();
@@ -1,10 +1,10 @@
1
1
  import { inspect } from 'node:util';
2
2
  import { describeToolCall } from './tool-activity.js';
3
+ import { clipToWidth, padEndToWidth } from './text-width.js';
3
4
  export const TOOL_TRAIL_LIMIT = 6;
5
+ // display-width aware (Thai filenames / emoji activity titles) so the trail columns stay aligned
4
6
  function clip(text, width) {
5
- if (width <= 0)
6
- return '';
7
- return text.length > width ? `${text.slice(0, Math.max(0, width - 3))}...` : text;
7
+ return clipToWidth(text, width, '...');
8
8
  }
9
9
  function normalizeWhitespace(text) {
10
10
  return text.replace(/\s+/g, ' ').trim();
@@ -103,7 +103,7 @@ export function toolTrailLines(items, columns, mode = 'expanded') {
103
103
  for (const item of items) {
104
104
  const marker = markerForStatus(item.status);
105
105
  const detail = item.detail ? ` ${clip(item.detail, detailWidth)}` : '';
106
- lines.push(`${marker} ${clip(item.name, nameWidth).padEnd(nameWidth)} ${item.status.padEnd(7)}${detail}`);
106
+ lines.push(`${marker} ${padEndToWidth(clip(item.name, nameWidth), nameWidth)} ${item.status.padEnd(7)}${detail}`);
107
107
  }
108
108
  return lines.map((line) => clip(line, width));
109
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanook-cli",
3
- "version": "0.5.10",
3
+ "version": "0.5.13",
4
4
  "description": "A terminal AI coding agent — BYOK, 9 providers, MCP, cron gateway, skills, and git awareness. Built from scratch in TypeScript.",
5
5
  "type": "module",
6
6
  "bin": {