fix(cli): surface broker error messages in ban/unban (alpha.38 fix)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claudemesh-cli",
|
"name": "claudemesh-cli",
|
||||||
"version": "1.0.0-alpha.37",
|
"version": "1.0.0-alpha.38",
|
||||||
"description": "Peer mesh for Claude Code sessions — CLI + MCP server.",
|
"description": "Peer mesh for Claude Code sessions — CLI + MCP server.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"claude-code",
|
"claude-code",
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ export async function runBan(
|
|||||||
if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; }
|
if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; }
|
||||||
|
|
||||||
return await withMesh({ meshSlug }, async (client) => {
|
return await withMesh({ meshSlug }, async (client) => {
|
||||||
const result = await client.sendAndWait({ type: "ban", target }) as { banned?: string; error?: string };
|
const result = await client.sendAndWait({ type: "ban", target }) as { banned?: string; error?: string; message?: string; code?: string };
|
||||||
if (result?.banned) {
|
if (result?.banned) {
|
||||||
render.ok(`Banned ${result.banned} from ${meshSlug}. They cannot reconnect until unbanned.`);
|
render.ok(`Banned ${result.banned} from ${meshSlug}. They cannot reconnect until unbanned.`);
|
||||||
render.hint(`Undo: claudemesh unban ${result.banned} --mesh ${meshSlug}`);
|
render.hint(`Undo: claudemesh unban ${result.banned} --mesh ${meshSlug}`);
|
||||||
} else {
|
} else {
|
||||||
render.err(result?.error ?? "ban failed");
|
render.err(result?.message ?? result?.error ?? result?.code ?? "ban failed");
|
||||||
}
|
}
|
||||||
return result?.banned ? EXIT.SUCCESS : EXIT.INTERNAL_ERROR;
|
return result?.banned ? EXIT.SUCCESS : EXIT.INTERNAL_ERROR;
|
||||||
});
|
});
|
||||||
@@ -40,11 +40,11 @@ export async function runUnban(
|
|||||||
if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; }
|
if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; }
|
||||||
|
|
||||||
return await withMesh({ meshSlug }, async (client) => {
|
return await withMesh({ meshSlug }, async (client) => {
|
||||||
const result = await client.sendAndWait({ type: "unban", target }) as { unbanned?: string; error?: string };
|
const result = await client.sendAndWait({ type: "unban", target }) as { unbanned?: string; error?: string; message?: string; code?: string };
|
||||||
if (result?.unbanned) {
|
if (result?.unbanned) {
|
||||||
render.ok(`Unbanned ${result.unbanned} from ${meshSlug}. They can rejoin.`);
|
render.ok(`Unbanned ${result.unbanned} from ${meshSlug}. They can rejoin.`);
|
||||||
} else {
|
} else {
|
||||||
render.err(result?.error ?? "unban failed");
|
render.err(result?.message ?? result?.error ?? result?.code ?? "unban failed");
|
||||||
}
|
}
|
||||||
return result?.unbanned ? EXIT.SUCCESS : EXIT.INTERNAL_ERROR;
|
return result?.unbanned ? EXIT.SUCCESS : EXIT.INTERNAL_ERROR;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user