mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 02:03:43 +00:00
refactor(commands): centralize shared command formatting helpers
This commit is contained in:
@@ -6,14 +6,7 @@ import type { MessageActionRunResult } from "../infra/outbound/message-action-ru
|
||||
import { formatTargetDisplay } from "../infra/outbound/target-resolver.js";
|
||||
import { renderTable } from "../terminal/table.js";
|
||||
import { isRich, theme } from "../terminal/theme.js";
|
||||
|
||||
const shortenText = (value: string, maxLen: number) => {
|
||||
const chars = Array.from(value);
|
||||
if (chars.length <= maxLen) {
|
||||
return value;
|
||||
}
|
||||
return `${chars.slice(0, Math.max(0, maxLen - 1)).join("")}…`;
|
||||
};
|
||||
import { shortenText } from "./text-format.js";
|
||||
|
||||
const resolveChannelLabel = (channel: ChannelId) =>
|
||||
getChannelPlugin(channel)?.meta.label ?? channel;
|
||||
|
||||
Reference in New Issue
Block a user