fix(cli): surface broker error messages in ban/unban (alpha.38 fix)
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-17 08:57:08 +01:00
parent 3ceac68e67
commit d7f381a1e8
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"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.",
"keywords": [
"claude-code",

View File

@@ -19,12 +19,12 @@ export async function runBan(
if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; }
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) {
render.ok(`Banned ${result.banned} from ${meshSlug}. They cannot reconnect until unbanned.`);
render.hint(`Undo: claudemesh unban ${result.banned} --mesh ${meshSlug}`);
} 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;
});
@@ -40,11 +40,11 @@ export async function runUnban(
if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; }
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) {
render.ok(`Unbanned ${result.unbanned} from ${meshSlug}. They can rejoin.`);
} 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;
});