@keak/webmcp-core 0.1.1 → 0.1.3
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/package.json +3 -1
- package/scripts/postinstall.mjs +67 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keak/webmcp-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Auto-generate WebMCP tool definitions from any website",
|
|
5
5
|
"author": "Keak <hello@keak.com> (https://keak.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"build": "tsc",
|
|
45
45
|
"dev": "tsc --watch",
|
|
46
46
|
"lint": "tsc --noEmit",
|
|
47
|
+
"postinstall": "node scripts/postinstall.mjs || true",
|
|
47
48
|
"prepublishOnly": "npm run build"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"files": [
|
|
71
72
|
"dist",
|
|
72
73
|
"bin",
|
|
74
|
+
"scripts",
|
|
73
75
|
"LICENSE",
|
|
74
76
|
"README.md"
|
|
75
77
|
]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Postinstall banner for @keak/webmcp-core
|
|
5
|
+
* Shows ASCII art + quick-start commands after npm install.
|
|
6
|
+
* Wrapped in try/catch so it never blocks installation.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
const { readFileSync } = await import("node:fs");
|
|
11
|
+
const { dirname, join } = await import("node:path");
|
|
12
|
+
const { fileURLToPath } = await import("node:url");
|
|
13
|
+
|
|
14
|
+
// Read version from package.json
|
|
15
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf8"));
|
|
17
|
+
const version = pkg.version;
|
|
18
|
+
|
|
19
|
+
// Try to use chalk for colors, fall back to plain text
|
|
20
|
+
let chalk;
|
|
21
|
+
try {
|
|
22
|
+
chalk = (await import("chalk")).default;
|
|
23
|
+
} catch {
|
|
24
|
+
chalk = null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const c = (color, text) => {
|
|
28
|
+
if (!chalk) return text;
|
|
29
|
+
switch (color) {
|
|
30
|
+
case "cyan": return chalk.cyan(text);
|
|
31
|
+
case "green": return chalk.green(text);
|
|
32
|
+
case "yellow": return chalk.yellow(text);
|
|
33
|
+
case "dim": return chalk.dim(text);
|
|
34
|
+
case "bold": return chalk.bold(text);
|
|
35
|
+
case "magenta": return chalk.magenta(text);
|
|
36
|
+
default: return text;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const logo = [
|
|
41
|
+
"",
|
|
42
|
+
c("cyan", " ██╗ ██╗███████╗ █████╗ ██╗ ██╗"),
|
|
43
|
+
c("cyan", " ██║ ██╔╝██╔════╝██╔══██╗██║ ██╔╝"),
|
|
44
|
+
c("cyan", " █████╔╝ █████╗ ███████║█████╔╝ "),
|
|
45
|
+
c("cyan", " ██╔═██╗ ██╔══╝ ██╔══██║██╔═██╗ "),
|
|
46
|
+
c("cyan", " ██║ ██╗███████╗██║ ██║██║ ██╗"),
|
|
47
|
+
c("cyan", " ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝"),
|
|
48
|
+
"",
|
|
49
|
+
` ${c("bold", "WebMCP")} ${c("dim", `v${version}`)} ${c("dim", "— Auto-generate MCP tools from any website")}`,
|
|
50
|
+
"",
|
|
51
|
+
c("dim", " ─────────────────────────────────────"),
|
|
52
|
+
"",
|
|
53
|
+
` ${c("green", "Get started:")}`,
|
|
54
|
+
"",
|
|
55
|
+
` ${c("yellow", "$")} ${c("bold", "npx webmcp init")} ${c("dim", "Set up config for your project")}`,
|
|
56
|
+
` ${c("yellow", "$")} ${c("bold", "npx webmcp generate <url>")} ${c("dim", "Scan a site & generate tools")}`,
|
|
57
|
+
` ${c("yellow", "$")} ${c("bold", "npx webmcp scan <url>")} ${c("dim", "Quick scan without saving")}`,
|
|
58
|
+
` ${c("yellow", "$")} ${c("bold", "npx webmcp export")} ${c("dim", "Export tools to JSON, MCP, etc.")}`,
|
|
59
|
+
"",
|
|
60
|
+
` ${c("dim", "Docs:")} ${c("magenta", "https://github.com/keak-resources/webmcp-core")}`,
|
|
61
|
+
"",
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
console.log(logo.join("\n"));
|
|
65
|
+
} catch {
|
|
66
|
+
// Never block installation
|
|
67
|
+
}
|