gm-gc 2.0.479 → 2.0.481

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.479",
3
+ "version": "2.0.481",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "homepage": "https://github.com/AnEntrypoint/gm",
@@ -34,6 +34,26 @@ const run = () => {
34
34
  if (!isExec && !isGit) {
35
35
  return { deny: true, reason: 'run_shell_command requires exec:<lang> format with a NEWLINE between the lang and code. Example: exec:bash\nnpm --version\n(newline after exec:bash, not a space). Allowed: exec:nodejs, exec:bash, exec:python, exec:typescript, git, gh.' };
36
36
  }
37
+ if (isExec) {
38
+ const newline = command.indexOf('\n');
39
+ if (newline === -1) return { allow: true };
40
+ const rawLang = command.substring(5, newline);
41
+ const code = command.substring(newline + 1);
42
+ const { spawnSync } = require('child_process');
43
+ const pluginRoot = path.join(__dirname, '..');
44
+ const plugkitJs = path.join(pluginRoot, 'bin', 'plugkit.js');
45
+ let result;
46
+ if (rawLang === 'browser') {
47
+ result = spawnSync('node', [plugkitJs, 'exec', 'browser'], { input: code, encoding: 'utf-8', timeout: 300000 });
48
+ } else if (rawLang === 'codesearch') {
49
+ const projectDir = process.env.GEMINI_PROJECT_DIR || process.cwd();
50
+ result = spawnSync('node', [plugkitJs, 'search', '--path', projectDir, code], { encoding: 'utf-8', timeout: 60000 });
51
+ } else {
52
+ result = spawnSync('node', [plugkitJs, 'exec', rawLang], { input: code, encoding: 'utf-8', timeout: 120000 });
53
+ }
54
+ const output = (result.stdout || '') + (result.stderr || '');
55
+ return { deny: true, reason: 'exec:' + rawLang + ' output:\n\n' + output };
56
+ }
37
57
  }
38
58
  return { allow: true };
39
59
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-gc",
3
- "version": "2.0.479",
3
+ "version": "2.0.481",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",