neuxnbcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export declare const shouldShowBanner: (command: string | undefined, stream?: Pick<NodeJS.WriteStream, "isTTY">) => boolean;
2
+ export declare const renderNbcpBanner: (stream?: Pick<NodeJS.WriteStream, "isTTY">) => string;
package/dist/banner.js ADDED
@@ -0,0 +1,45 @@
1
+ const LOGO_LINES = [
2
+ 'NN NN EEEEEEE U U XX XX SSSSS BBBBB OOOOO TTTTTTT',
3
+ 'NNN NN EE U U XX XX SS BB B OO OO TTT ',
4
+ 'NN N NN EEEEE U U XXX SSSSS BBBBB OO OO TTT ',
5
+ 'NN NNN EE U U XX XX SS BB B OO OO TTT ',
6
+ 'NN NN EEEEEEE UUUUU XX XX SSSSS BBBBB OOOOO TTT ',
7
+ ];
8
+ const WEBSITE_LINE = 'www.neuxsbot.com';
9
+ const ANSI_RESET = '\x1b[0m';
10
+ const SHADOW_COLOR = '\x1b[38;2;20;47;75m';
11
+ const FOREGROUND_COLORS = [
12
+ '\x1b[38;2;222;244;255m',
13
+ '\x1b[38;2;189;228;255m',
14
+ '\x1b[38;2;153;212;255m',
15
+ '\x1b[38;2;120;194;248m',
16
+ '\x1b[38;2;90;175;240m',
17
+ ];
18
+ const WEBSITE_COLOR = '\x1b[38;2;199;231;255m';
19
+ const colorize = (value, color, enabled) => enabled ? `${color}${value}${ANSI_RESET}` : value;
20
+ const centerText = (value, width) => {
21
+ const padding = Math.max(0, Math.floor((width - value.length) / 2));
22
+ return `${' '.repeat(padding)}${value}`;
23
+ };
24
+ export const shouldShowBanner = (command, stream = process.stdout) => {
25
+ if (command === 'serve') {
26
+ return false;
27
+ }
28
+ if (process.env.NBCP_DISABLE_BANNER === '1') {
29
+ return false;
30
+ }
31
+ if (process.env.NBCP_FORCE_BANNER === '1') {
32
+ return true;
33
+ }
34
+ return Boolean(stream.isTTY);
35
+ };
36
+ export const renderNbcpBanner = (stream = process.stdout) => {
37
+ const colorEnabled = process.env.NO_COLOR !== '1' &&
38
+ (process.env.FORCE_COLOR === '1' || process.env.NBCP_FORCE_BANNER === '1' || Boolean(stream.isTTY));
39
+ const maxWidth = Math.max(...LOGO_LINES.map((line) => line.length));
40
+ const renderedLines = LOGO_LINES.flatMap((line, index) => [
41
+ colorize(` ${line}`, SHADOW_COLOR, colorEnabled),
42
+ colorize(line, FOREGROUND_COLORS[index], colorEnabled),
43
+ ]);
44
+ return ['', ...renderedLines, '', colorize(centerText(WEBSITE_LINE, maxWidth), WEBSITE_COLOR, colorEnabled), ''].join('\n');
45
+ };
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { renderNbcpBanner, shouldShowBanner } from './banner.js';
3
+ const LOTTERY_MCP_TOOLS = [
4
+ 'lottery.latest',
5
+ 'lottery.history',
6
+ 'lottery.periods',
7
+ 'lottery.summary',
8
+ ];
9
+ const MCP_SERVER_TRANSPORT = 'stdio';
10
+ const HELP_TEXT = `NexusBot Lottery MCP
11
+
12
+ Usage:
13
+ nbcp <command>
14
+ nbcp --help
15
+
16
+ Commands:
17
+ serve Start the MCP stdio server
18
+ init Create a local config file
19
+ doctor Check local config and remote website health
20
+ login Open the website token page
21
+
22
+ Current scaffold:
23
+ transport: ${MCP_SERVER_TRANSPORT}
24
+ tools: ${LOTTERY_MCP_TOOLS.join(', ')}
25
+ `;
26
+ const args = process.argv.slice(2);
27
+ const command = args[0];
28
+ if (shouldShowBanner(command)) {
29
+ process.stdout.write(renderNbcpBanner());
30
+ }
31
+ if (!command || command === '--help' || command === '-h') {
32
+ console.log(HELP_TEXT);
33
+ process.exit(0);
34
+ }
35
+ if (['serve', 'init', 'doctor', 'login'].includes(command)) {
36
+ console.log(`Command "${command}" is scaffolded and will be implemented in later tasks.`);
37
+ process.exit(0);
38
+ }
39
+ console.error(`Unknown command: ${command}`);
40
+ console.log(HELP_TEXT);
41
+ process.exit(1);
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "neuxnbcp",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "NEUXSBOT lottery MCP command line entrypoint",
7
+ "license": "MIT",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "bin": {
14
+ "nbcp": "dist/index.js"
15
+ },
16
+ "scripts": {
17
+ "build": "tsc -p tsconfig.json",
18
+ "prepack": "npm run build"
19
+ },
20
+ "engines": {
21
+ "node": ">=20"
22
+ },
23
+ "keywords": [
24
+ "mcp",
25
+ "cli",
26
+ "lottery",
27
+ "neuxsbot",
28
+ "nbcp"
29
+ ],
30
+ "homepage": "https://www.neuxsbot.com",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
34
+ }