refactor(cli): rename nc to ncl
Rename the CLI binary, socket path, container wrapper, error prefixes, and all references from `nc` to `ncl`. Add ~/.local/bin symlink during setup and pnpm script alias. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* per connection, calls dispatch() with caller='host', writes the response
|
||||
* frame, closes.
|
||||
*
|
||||
* Lives at data/nc.sock (separate from data/cli.sock, which the existing
|
||||
* Lives at data/ncl.sock (separate from data/cli.sock, which the existing
|
||||
* chat-style CLI channel adapter owns). Socket file is chmod 0600 — only
|
||||
* the user that started the host can connect.
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ export async function startCliServer(socketPath: string = DEFAULT_SOCKET_PATH):
|
||||
} catch (err) {
|
||||
const e = err as NodeJS.ErrnoException;
|
||||
if (e.code !== 'ENOENT') {
|
||||
log.warn('Failed to unlink stale nc socket (will try to bind anyway)', { socketPath, err });
|
||||
log.warn('Failed to unlink stale ncl socket (will try to bind anyway)', { socketPath, err });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ export async function startCliServer(socketPath: string = DEFAULT_SOCKET_PATH):
|
||||
try {
|
||||
fs.chmodSync(socketPath, 0o600);
|
||||
} catch (err) {
|
||||
log.warn('Failed to chmod nc socket (continuing)', { socketPath, err });
|
||||
log.warn('Failed to chmod ncl socket (continuing)', { socketPath, err });
|
||||
}
|
||||
log.info('nc CLI server listening', { socketPath });
|
||||
log.info('ncl CLI server listening', { socketPath });
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
@@ -65,7 +65,7 @@ function handleConnection(conn: net.Socket): void {
|
||||
}
|
||||
});
|
||||
conn.on('error', (err) => {
|
||||
log.warn('nc CLI server connection error', { err });
|
||||
log.warn('ncl CLI server connection error', { err });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ async function handleFrame(conn: net.Socket, line: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
// Host caller — connecting to data/nc.sock requires file-system access
|
||||
// Host caller — connecting to data/ncl.sock requires file-system access
|
||||
// to a 0600 socket owned by the host user, so we treat the socket path
|
||||
// itself as the auth boundary.
|
||||
const ctx: CallerContext = { caller: 'host' };
|
||||
@@ -100,7 +100,7 @@ function write(conn: net.Socket, frame: ResponseFrame): void {
|
||||
conn.write(JSON.stringify(frame) + '\n');
|
||||
conn.end();
|
||||
} catch (err) {
|
||||
log.warn('Failed to write nc CLI response', { err });
|
||||
log.warn('Failed to write ncl CLI response', { err });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user