promptgraph-mcp 1.5.0 → 1.5.1
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/cli.js +9 -9
- package/package.json +2 -1
package/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import boxen from 'boxen';
|
|
4
|
+
import fs from 'fs';
|
|
4
5
|
|
|
5
6
|
export const colors = {
|
|
6
7
|
primary: chalk.hex('#7C3AED'),
|
|
@@ -12,10 +13,17 @@ export const colors = {
|
|
|
12
13
|
bold: chalk.bold,
|
|
13
14
|
};
|
|
14
15
|
|
|
16
|
+
function getVersion() {
|
|
17
|
+
try {
|
|
18
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
|
|
19
|
+
return pkg.version;
|
|
20
|
+
} catch { return ''; }
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
export function banner() {
|
|
16
24
|
console.log(
|
|
17
25
|
boxen(
|
|
18
|
-
colors.primary.bold('PromptGraph') + ' ' + colors.muted('v' +
|
|
26
|
+
colors.primary.bold('PromptGraph') + ' ' + colors.muted('v' + getVersion()) + '\n' +
|
|
19
27
|
colors.muted('Semantic skill router for Claude Code'),
|
|
20
28
|
{
|
|
21
29
|
padding: { top: 0, bottom: 0, left: 2, right: 2 },
|
|
@@ -27,14 +35,6 @@ export function banner() {
|
|
|
27
35
|
);
|
|
28
36
|
}
|
|
29
37
|
|
|
30
|
-
async function getVersion() {
|
|
31
|
-
try {
|
|
32
|
-
const { createRequire } = await import('module');
|
|
33
|
-
const require = createRequire(import.meta.url);
|
|
34
|
-
return require('./package.json').version;
|
|
35
|
-
} catch { return ''; }
|
|
36
|
-
}
|
|
37
|
-
|
|
38
38
|
export function spinner(text) {
|
|
39
39
|
return ora({
|
|
40
40
|
text: colors.muted(text),
|