mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-25 23:31:11 +00:00
* fix: make native session discovery configurable * refactor: split native session discovery helpers * chore: keep release notes in PR body * fix: refresh generated session protocol models * test(ui): avoid shared lazy-element mock race
18 lines
587 B
TypeScript
18 lines
587 B
TypeScript
export function createNodeListFailedError(error: unknown): { code: string; message: string } {
|
|
const detail =
|
|
error instanceof Error ? error.message.trim() : typeof error === "string" ? error.trim() : "";
|
|
const summary = "Paired nodes could not be listed";
|
|
return {
|
|
code: "NODE_LIST_FAILED",
|
|
message: detail && detail !== summary ? `${summary}: ${detail}` : summary,
|
|
};
|
|
}
|
|
|
|
export function resolveNodeLabel(node: {
|
|
displayName?: string;
|
|
remoteIp?: string;
|
|
nodeId: string;
|
|
}): string {
|
|
return node.displayName?.trim() || node.remoteIp?.trim() || node.nodeId;
|
|
}
|