Broker (apps/broker/src/index.ts)
- Unified disconnect/kick handler uses close code 1000 for disconnect
(CLI auto-reconnects) vs 4001 for kick (CLI exits, no reconnect).
- Ban now closes with code 4002.
- Hello handler: revoked members get a specific 'revoked' error with a
'Contact the mesh owner to rejoin' message, then ws.close(4002).
Previously banned users saw the generic 'unauthorized' error.
- list_bans handler returns { name, pubkey, revokedAt } for each
revoked member.
CLI (apps/cli)
- ws-client: close codes 4001 and 4002 set .closed = true and stash
.terminalClose so callers can surface a friendly message instead of
the low-level 'ws terminal close' error. Revoked error in hello is
also captured as a terminal close.
- withMesh catches terminalClose and prints:
4001 → 'Kicked from this mesh. Run claudemesh to rejoin.'
4002 → the broker's 'Contact the mesh owner to rejoin.' message
- kick.ts now exports runDisconnect + runKick with clear hints:
'disconnect' → 'They will auto-reconnect within seconds.'
'kick' → 'They can rejoin anytime by running claudemesh.'
- cli.ts adds 'disconnect' dispatch; HELP updated.
Semantics:
disconnect: session reset, no DB state, auto-reconnects
kick : session ends, no DB state, user must manually rejoin
ban : session ends + revokedAt set, cannot rejoin until unban
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
70 lines
1.8 KiB
JSON
70 lines
1.8 KiB
JSON
{
|
|
"name": "claudemesh-cli",
|
|
"version": "1.0.0-alpha.43",
|
|
"description": "Peer mesh for Claude Code sessions — CLI + MCP server.",
|
|
"keywords": [
|
|
"claude-code",
|
|
"mcp",
|
|
"model-context-protocol",
|
|
"claudemesh",
|
|
"peer-messaging",
|
|
"multi-agent"
|
|
],
|
|
"author": "Alejandro Gutiérrez",
|
|
"license": "MIT",
|
|
"homepage": "https://claudemesh.com",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/alezmad/claudemesh.git",
|
|
"directory": "apps/cli"
|
|
},
|
|
"type": "module",
|
|
"bin": {
|
|
"claudemesh": "./dist/entrypoints/cli.js"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"publishConfig": {
|
|
"access": "public"
|
|
},
|
|
"scripts": {
|
|
"build": "bun build.ts",
|
|
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
|
"dev": "bun --hot src/entrypoints/cli.ts",
|
|
"start": "bun src/entrypoints/cli.ts",
|
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
|
"lint": "eslint",
|
|
"prepublishOnly": "bun run build",
|
|
"test": "vitest run",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"prettier": "@turbostarter/prettier-config",
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"dependencies": {
|
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
"citty": "0.2.2",
|
|
"libsodium-wrappers": "0.7.15",
|
|
"qrcode-terminal": "0.12.0",
|
|
"ws": "8.20.0",
|
|
"zod": "4.1.13"
|
|
},
|
|
"devDependencies": {
|
|
"@turbostarter/eslint-config": "workspace:*",
|
|
"@turbostarter/prettier-config": "workspace:*",
|
|
"@turbostarter/tsconfig": "workspace:*",
|
|
"@turbostarter/vitest-config": "workspace:*",
|
|
"@types/libsodium-wrappers": "0.7.14",
|
|
"@types/qrcode-terminal": "0.12.2",
|
|
"@types/ws": "8.5.13",
|
|
"eslint": "catalog:",
|
|
"prettier": "catalog:",
|
|
"typescript": "catalog:",
|
|
"vitest": "catalog:"
|
|
}
|
|
}
|