@atolis-hq/corum 0.1.31 → 0.1.33
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.
- package/dist/src/banner.js +26 -0
- package/dist/src/mcp/index.js +6 -0
- package/dist/src/web/server.js +9 -5
- package/package.json +1 -1
- package/web/graph.jsx +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const _require = createRequire(import.meta.url);
|
|
3
|
+
const { version } = _require('../../package.json');
|
|
4
|
+
const CORAL = '\x1b[38;2;232;97;74m';
|
|
5
|
+
const RESET = '\x1b[0m';
|
|
6
|
+
export function printBanner(options) {
|
|
7
|
+
const { config, services, logger = (line) => process.stdout.write(line + '\n') } = options;
|
|
8
|
+
const c = process.env.NO_COLOR ? '' : CORAL;
|
|
9
|
+
const r = process.env.NO_COLOR ? '' : RESET;
|
|
10
|
+
logger(` ${c}· · ⡎⠑ ⡎⢱ ⣏⡱ ⡇⢸ ⡷⢾${r}`);
|
|
11
|
+
logger(` ${c}· ◉ · ⠣⠔ ⠣⠜ ⠇⠱ ⠣⠜ ⠇⠸${r}`);
|
|
12
|
+
logger(` ${c}· ·${r} v${version}`);
|
|
13
|
+
const keyWidth = config.length > 0 ? Math.max(...config.map(e => e.key.length)) : 0;
|
|
14
|
+
const minWidth = 44;
|
|
15
|
+
const contentWidth = Math.max(minWidth, ...config.map(e => e.key.length + 2 + e.value.length));
|
|
16
|
+
logger(' ' + '─'.repeat(contentWidth));
|
|
17
|
+
for (const { key, value } of config) {
|
|
18
|
+
logger(` ${key.padEnd(keyWidth)} ${value}`);
|
|
19
|
+
}
|
|
20
|
+
if (services.length > 0) {
|
|
21
|
+
logger('');
|
|
22
|
+
for (const { name, url } of services) {
|
|
23
|
+
logger(` ${c}●${r} ${name} ${c}${url}${r}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
package/dist/src/mcp/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { printBanner } from '../banner.js';
|
|
1
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
4
|
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -323,6 +324,11 @@ export async function startMcpServer(options = {}) {
|
|
|
323
324
|
return { content: [{ type: 'text', text: `Unknown tool: ${request.params.name}` }], isError: true };
|
|
324
325
|
}
|
|
325
326
|
});
|
|
327
|
+
printBanner({
|
|
328
|
+
config: [{ key: 'graphPath', value: config.graphPath }],
|
|
329
|
+
services: [{ name: 'mcp', url: 'stdio' }],
|
|
330
|
+
logger: (line) => process.stderr.write(line + '\n'),
|
|
331
|
+
});
|
|
326
332
|
await server.connect(new StdioServerTransport());
|
|
327
333
|
}
|
|
328
334
|
function isEntrypoint() {
|
package/dist/src/web/server.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { printBanner } from '../banner.js';
|
|
1
2
|
import express from 'express';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { existsSync, readFileSync, readdirSync, watch } from 'node:fs';
|
|
@@ -587,11 +588,14 @@ export function startWebServer(graph, options = {}) {
|
|
|
587
588
|
const server = app.listen(port, () => {
|
|
588
589
|
const addr = server.address();
|
|
589
590
|
if (options.port !== 0) {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
591
|
+
printBanner({
|
|
592
|
+
config: [
|
|
593
|
+
{ key: 'graphPath', value: graphPath },
|
|
594
|
+
{ key: 'webDir', value: WEB_DIR },
|
|
595
|
+
{ key: 'port', value: String(addr.port) },
|
|
596
|
+
],
|
|
597
|
+
services: [{ name: 'web', url: `http://localhost:${addr.port}` }],
|
|
598
|
+
});
|
|
595
599
|
}
|
|
596
600
|
resolve({
|
|
597
601
|
port: addr.port,
|
package/package.json
CHANGED