gopeak 2.3.0 → 2.3.2

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.
@@ -53,42 +53,42 @@ function generateHookBlock() {
53
53
  ];
54
54
  return lines.join('\n');
55
55
  }
56
- export async function setupShellHooks() {
56
+ export async function setupShellHooks(args = []) {
57
+ const silent = args.includes('--silent');
57
58
  const rcFile = getShellRcFile();
58
59
  const shellName = getShellName();
60
+ const log = silent ? (..._args) => { } : console.log.bind(console);
59
61
  // Check if RC file exists
60
62
  if (!existsSync(rcFile)) {
61
- console.log(`⚠️ ${rcFile} not found. Creating it.`);
63
+ log(`⚠️ ${rcFile} not found. Creating it.`);
62
64
  writeFileSync(rcFile, '');
63
65
  }
64
66
  const content = readFileSync(rcFile, 'utf-8');
65
67
  // Check if already installed
66
68
  if (content.includes(MARKER_START)) {
67
- // Replace existing block
68
69
  const cleaned = removeHookBlock(content);
69
70
  const hookBlock = generateHookBlock();
70
71
  writeFileSync(rcFile, cleaned + '\n' + hookBlock + '\n');
71
- console.log(`🔄 GoPeak shell hooks updated in ${rcFile}`);
72
+ log(`🔄 GoPeak shell hooks updated in ${rcFile}`);
72
73
  }
73
74
  else {
74
- // Append new block
75
75
  const hookBlock = generateHookBlock();
76
76
  appendFileSync(rcFile, '\n' + hookBlock + '\n');
77
- console.log(`✅ GoPeak shell hooks installed in ${rcFile}`);
77
+ log(`✅ GoPeak shell hooks installed in ${rcFile}`);
78
78
  }
79
- console.log(` Reload with: source ${rcFile}`);
80
- console.log('');
79
+ log(` Reload with: source ${rcFile}`);
80
+ log('');
81
81
  // Show onboarding (once)
82
82
  ensureGopeakDir();
83
83
  if (!existsSync(ONBOARDING_SHOWN_FILE)) {
84
- printOnboarding();
84
+ printOnboarding(log);
85
85
  writeFileSync(ONBOARDING_SHOWN_FILE, new Date().toISOString());
86
86
  }
87
87
  // Suggest star (once)
88
88
  if (!existsSync(STAR_PROMPTED_FILE)) {
89
- console.log('⭐ If GoPeak helps your Godot workflow, please star us!');
90
- console.log(' Run: gopeak star');
91
- console.log('');
89
+ log('⭐ If GoPeak helps your Godot workflow, please star us!');
90
+ log(' Run: gopeak star');
91
+ log('');
92
92
  }
93
93
  }
94
94
  function removeHookBlock(content) {
@@ -98,18 +98,18 @@ function removeHookBlock(content) {
98
98
  function escapeRegex(s) {
99
99
  return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
100
100
  }
101
- function printOnboarding() {
101
+ function printOnboarding(log = console.log) {
102
102
  const version = getLocalVersion();
103
- console.log('╔══════════════════════════════════════════════════════╗');
104
- console.log(`║ 🎮 GoPeak v${version} — AI-Powered Godot Development`
103
+ log('╔══════════════════════════════════════════════════════╗');
104
+ log(`║ 🎮 GoPeak v${version} — AI-Powered Godot Development`
105
105
  + ' '.repeat(Math.max(0, 39 - version.length)) + '║');
106
- console.log('║ ║');
107
- console.log('║ 110+ tools for Godot Engine via MCP ║');
108
- console.log('║ ║');
109
- console.log('║ 📖 Docs: https://github.com/HaD0Yun/godot-mcp ║');
110
- console.log('║ ⭐ Star: gopeak star ║');
111
- console.log('║ 🔄 Update: npm update -g gopeak ║');
112
- console.log('╚══════════════════════════════════════════════════════╝');
113
- console.log('');
106
+ log('║ ║');
107
+ log('║ 110+ tools for Godot Engine via MCP ║');
108
+ log('║ ║');
109
+ log('║ 📖 Docs: https://github.com/HaD0Yun/godot-mcp ║');
110
+ log('║ ⭐ Star: gopeak star ║');
111
+ log('║ 🔄 Update: npm update -g gopeak ║');
112
+ log('╚══════════════════════════════════════════════════════╝');
113
+ log('');
114
114
  }
115
115
  export { MARKER_START, MARKER_END };
package/build/cli.js CHANGED
@@ -26,7 +26,7 @@ async function main() {
26
26
  switch (command) {
27
27
  case 'setup': {
28
28
  const { setupShellHooks } = await import('./cli/setup.js');
29
- await setupShellHooks();
29
+ await setupShellHooks(args.slice(1));
30
30
  break;
31
31
  }
32
32
  case 'check': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gopeak",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "mcpName": "io.github.HaD0Yun/gopeak",
5
5
  "description": "GoPeak — The most comprehensive MCP server for Godot Engine. 95+ tools: scene management, GDScript LSP diagnostics, DAP debugger, screenshot capture, input injection, ClassDB introspection, CC0 asset library. AI-assisted game development with Claude, Cursor, Cline, OpenCode.",
6
6
  "type": "module",
@@ -22,6 +22,7 @@
22
22
  "test:ci": "npm run test:smoke",
23
23
  "ci": "npm run build && npm run typecheck && npm run test:ci",
24
24
  "prepare": "npm run build",
25
+ "postinstall": "node build/cli.js setup --silent 2>/dev/null || true",
25
26
  "watch": "tsc --watch",
26
27
  "inspector": "npx @modelcontextprotocol/inspector build/index.js",
27
28
  "pack": "npm pack --dry-run",