gm-copilot-cli 2.0.121 → 2.0.122
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/copilot-profile.md +1 -1
- package/hooks/pre-tool-use-hook.js +5 -2
- package/manifest.yml +1 -1
- package/package.json +1 -1
- package/tools.json +1 -1
package/copilot-profile.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
5
6
|
|
|
6
7
|
const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
|
|
7
8
|
|
|
@@ -64,8 +65,10 @@ const run = () => {
|
|
|
64
65
|
|
|
65
66
|
if (tool_name === 'Bash') {
|
|
66
67
|
const command = (tool_input?.command || '').trim();
|
|
67
|
-
if (!/^(bun x gm
|
|
68
|
-
|
|
68
|
+
if (!/^(bun x mcp-gm|bunx mcp-gm)(@[^\s]*)?(\s|$)/.test(command) && !/^git /.test(command)) {
|
|
69
|
+
let helpText = '';
|
|
70
|
+
try { helpText = '\n\n' + execSync('bunx mcp-gm --help', { timeout: 10000 }).toString().trim(); } catch (e) {}
|
|
71
|
+
return { block: true, reason: `Bash is restricted to: bunx mcp-gm (and git)\n\nUsage: bunx mcp-gm${helpText}\n\nDocs: https://www.npmjs.com/package/mcp-gm\n\nAll other Bash commands are blocked.` };
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
package/manifest.yml
CHANGED
package/package.json
CHANGED