@autodevjapan/godd-mcp-alpha 1.29.0 → 1.31.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.
- package/dist/godd.cjs +112 -112
- package/package.json +4 -2
- package/scripts/postinstall-godd-tk.js +126 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autodevjapan/godd-mcp-alpha",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "GoDD MCP α Server — AI Prompt Delivery System for Cursor IDE",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/godd.cjs",
|
|
13
|
+
"scripts/postinstall-godd-tk.js",
|
|
13
14
|
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"engines": {
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
"test": "vitest run",
|
|
30
31
|
"test:watch": "vitest",
|
|
31
32
|
"dev": "tsx src/index.ts serve",
|
|
32
|
-
"prepublishOnly": "node esbuild.config.js"
|
|
33
|
+
"prepublishOnly": "node esbuild.config.js",
|
|
34
|
+
"postinstall": "node scripts/postinstall-godd-tk.js || true"
|
|
33
35
|
},
|
|
34
36
|
"dependencies": {
|
|
35
37
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* GoDD Token Killer — postinstall script
|
|
5
|
+
*
|
|
6
|
+
* Downloads the pre-built godd-tk binary for the current OS/arch
|
|
7
|
+
* from GitHub Releases via `gh` CLI (supports private repos) and
|
|
8
|
+
* places it in ~/.local/bin/ (Unix) or %LOCALAPPDATA%/godd-tk/ (Windows).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { mkdirSync, chmodSync, existsSync, renameSync, unlinkSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { homedir, platform, arch } from "node:os";
|
|
14
|
+
import { execFileSync, execSync } from "node:child_process";
|
|
15
|
+
|
|
16
|
+
const REPO = "AutoDevJapan/GoDD-MCP-Alpha";
|
|
17
|
+
const BINARY_NAME = "godd-tk";
|
|
18
|
+
const VERSION_TAG = "godd-tk-v0.1.0";
|
|
19
|
+
|
|
20
|
+
const TARGETS = {
|
|
21
|
+
"darwin-x64": "godd-tk-x86_64-apple-darwin",
|
|
22
|
+
"darwin-arm64": "godd-tk-aarch64-apple-darwin",
|
|
23
|
+
"linux-x64": "godd-tk-x86_64-unknown-linux-musl",
|
|
24
|
+
"win32-x64": "godd-tk-x86_64-pc-windows-msvc.exe",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function getInstallDir() {
|
|
28
|
+
if (platform() === "win32") {
|
|
29
|
+
const localAppData = process.env.LOCALAPPDATA || join(homedir(), "AppData", "Local");
|
|
30
|
+
return join(localAppData, "godd-tk");
|
|
31
|
+
}
|
|
32
|
+
return join(homedir(), ".local", "bin");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getTarget() {
|
|
36
|
+
const key = `${platform()}-${arch()}`;
|
|
37
|
+
return TARGETS[key];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getBinaryPath(installDir) {
|
|
41
|
+
const ext = platform() === "win32" ? ".exe" : "";
|
|
42
|
+
return join(installDir, `${BINARY_NAME}${ext}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isGhAvailable() {
|
|
46
|
+
try {
|
|
47
|
+
execFileSync("gh", ["--version"], { stdio: "ignore", timeout: 5000 });
|
|
48
|
+
return true;
|
|
49
|
+
} catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function main() {
|
|
55
|
+
const target = getTarget();
|
|
56
|
+
if (!target) {
|
|
57
|
+
console.log(`[godd-tk] No pre-built binary for ${platform()}-${arch()}, skipping.`);
|
|
58
|
+
console.log(`[godd-tk] Build from source: cd godd-mcp-alpha/godd-tk && cargo build --release`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const installDir = getInstallDir();
|
|
63
|
+
const binaryPath = getBinaryPath(installDir);
|
|
64
|
+
|
|
65
|
+
if (existsSync(binaryPath)) {
|
|
66
|
+
try {
|
|
67
|
+
const version = execFileSync(binaryPath, ["--version"], { encoding: "utf8" }).trim();
|
|
68
|
+
console.log(`[godd-tk] Already installed: ${version}`);
|
|
69
|
+
return;
|
|
70
|
+
} catch {
|
|
71
|
+
// corrupted binary, re-download
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!isGhAvailable()) {
|
|
76
|
+
console.log(`[godd-tk] GitHub CLI (gh) not found — required for private repo download.`);
|
|
77
|
+
console.log(`[godd-tk] Install gh: https://cli.github.com/ then run this script again.`);
|
|
78
|
+
console.log(`[godd-tk] Or build from source: cd godd-mcp-alpha/godd-tk && cargo build --release`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
console.log(`[godd-tk] Downloading ${target} via gh CLI...`);
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
mkdirSync(installDir, { recursive: true });
|
|
86
|
+
|
|
87
|
+
const tmpDir = join(installDir, ".godd-tk-tmp");
|
|
88
|
+
mkdirSync(tmpDir, { recursive: true });
|
|
89
|
+
|
|
90
|
+
execSync(
|
|
91
|
+
`gh release download ${VERSION_TAG} --repo ${REPO} --pattern "${target}" --dir "${tmpDir}" --clobber`,
|
|
92
|
+
{ stdio: "pipe", timeout: 60000 }
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const downloadedPath = join(tmpDir, target);
|
|
96
|
+
if (!existsSync(downloadedPath)) {
|
|
97
|
+
throw new Error(`Downloaded file not found at ${downloadedPath}`);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (existsSync(binaryPath)) unlinkSync(binaryPath);
|
|
101
|
+
renameSync(downloadedPath, binaryPath);
|
|
102
|
+
|
|
103
|
+
if (platform() !== "win32") {
|
|
104
|
+
chmodSync(binaryPath, 0o755);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Clean up temp dir
|
|
108
|
+
try { unlinkSync(tmpDir); } catch {}
|
|
109
|
+
|
|
110
|
+
console.log(`[godd-tk] Installed to ${binaryPath}`);
|
|
111
|
+
console.log(`[godd-tk] Run 'godd-tk init --agent cursor' to set up hooks`);
|
|
112
|
+
|
|
113
|
+
// Add to PATH hint for Windows
|
|
114
|
+
if (platform() === "win32") {
|
|
115
|
+
const pathDirs = (process.env.PATH || "").toLowerCase().split(";");
|
|
116
|
+
if (!pathDirs.includes(installDir.toLowerCase())) {
|
|
117
|
+
console.log(`[godd-tk] Add ${installDir} to your PATH for global access`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} catch (err) {
|
|
121
|
+
console.log(`[godd-tk] Download failed: ${err.message}`);
|
|
122
|
+
console.log(`[godd-tk] Build from source: cd godd-mcp-alpha/godd-tk && cargo build --release`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
main().catch(console.error);
|