gm-copilot-cli 2.0.160 → 2.0.162

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/agents/gm.md CHANGED
@@ -50,7 +50,19 @@ Scope: All available skills and their mandatory usage rules. Every skill listed
50
50
 
51
51
  **`gm` agent** — Subagent orchestration. MANDATORY for parallel work waves. Launch via Task tool with subagent_type gm:gm. Maximum 3 per wave. Independent items run simultaneously; dependent items wait. Sequential execution of independent items is forbidden.
52
52
 
53
- **`exec` tool** — Transparent code execution via pre-tool-use hook interception. Call as a native tool with params: `lang` (nodejs|python|bash|sh|cmd|go|rust|c|cpp|java|deno|typescript, default nodejs), `code` (the code or command to run), `cmd` (alias for code, preferred for bash/cmd langs), `cwd` (optional working directory). Returns stdout+stderr of execution as the tool response. The hook intercepts the call, runs it via gm-exec, and returns the output synchronously. Use instead of Bash tool for all code and shell execution.
53
+ **`exec` via Bash interception** Run raw code by using the Bash tool with an `exec` prefix. The hook intercepts it, runs via gm-exec, and returns output as the tool result. Syntax:
54
+ ```
55
+ exec:<lang>
56
+ <code or shell commands here>
57
+ ```
58
+ - `exec:nodejs` or just `exec` (default) — JavaScript/TypeScript via bun
59
+ - `exec:python` — Python
60
+ - `exec:bash` or `exec:sh` — Shell commands (multi-line supported)
61
+ - `exec:cmd` — Windows cmd.exe
62
+ - `exec:go`, `exec:rust`, `exec:c`, `exec:cpp`, `exec:java`, `exec:deno` — compiled langs
63
+ - Optional `cwd` field on the Bash tool input sets working directory
64
+ - Output returned as tool result synchronously (up to 30s)
65
+ - Use this for ALL code execution instead of `bun x gm-exec exec` — cleaner and more direct
54
66
 
55
67
 
56
68
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gm
3
- version: 2.0.160
3
+ version: 2.0.162
4
4
  description: State machine agent with hooks, skills, and automated git enforcement
5
5
  author: AnEntrypoint
6
6
  repository: https://github.com/AnEntrypoint/gm-copilot-cli
@@ -18,35 +18,6 @@ const run = () => {
18
18
 
19
19
  if (!tool_name) return { allow: true };
20
20
 
21
- if (tool_name === 'exec') {
22
- const { lang = 'nodejs', code, cmd, cwd } = tool_input || {};
23
- const actualCode = code || cmd;
24
- if (!actualCode) {
25
- return { block: true, reason: 'exec tool requires code or cmd parameter' };
26
- }
27
- try {
28
- let args;
29
- if (lang === 'bash' || lang === 'cmd' || lang === 'sh') {
30
- args = ['x', 'gm-exec', 'bash'];
31
- if (cwd) args.push(`--cwd=${cwd}`);
32
- args.push(actualCode);
33
- } else {
34
- args = ['x', 'gm-exec', 'exec', `--lang=${lang}`];
35
- if (cwd) args.push(`--cwd=${cwd}`);
36
- args.push(actualCode);
37
- }
38
- const result = execSync('bun ' + args.map(a => JSON.stringify(a)).join(' '), {
39
- encoding: 'utf-8',
40
- timeout: 30000,
41
- stdio: ['ignore', 'pipe', 'pipe']
42
- });
43
- return { block: true, reason: result || '(no output)' };
44
- } catch (e) {
45
- const err = (e.stdout || '') + (e.stderr || '') || e.message;
46
- return { block: true, reason: `exec error: ${err}` };
47
- }
48
- }
49
-
50
21
  if (forbiddenTools.includes(tool_name)) {
51
22
  return { block: true, reason: 'Use the code-search skill for codebase exploration instead of Grep/Glob/find. Describe what you need in plain language — it understands intent, not just patterns.' };
52
23
  }
@@ -94,6 +65,33 @@ const run = () => {
94
65
 
95
66
  if (tool_name === 'Bash') {
96
67
  const command = (tool_input?.command || '').trim();
68
+
69
+ const execMatch = command.match(/^exec(?::(\S+))?\n([\s\S]+)$/);
70
+ if (execMatch) {
71
+ const lang = execMatch[1] || 'nodejs';
72
+ const code = execMatch[2];
73
+ const cwd = tool_input?.cwd;
74
+ try {
75
+ let args;
76
+ if (lang === 'bash' || lang === 'sh' || lang === 'cmd') {
77
+ args = ['x', 'gm-exec', 'bash'];
78
+ if (cwd) args.push(`--cwd=${cwd}`);
79
+ args.push(code);
80
+ } else {
81
+ args = ['x', 'gm-exec', 'exec', `--lang=${lang}`];
82
+ if (cwd) args.push(`--cwd=${cwd}`);
83
+ args.push(code);
84
+ }
85
+ const result = execSync(['bun'].concat(args).map(a => JSON.stringify(a)).join(' '), {
86
+ encoding: 'utf-8', timeout: 30000, stdio: ['ignore', 'pipe', 'pipe']
87
+ });
88
+ return { block: true, reason: result || '(no output)' };
89
+ } catch (e) {
90
+ const err = (e.stdout || '') + (e.stderr || '') || e.message;
91
+ return { block: true, reason: err || '(exec failed)' };
92
+ }
93
+ }
94
+
97
95
  if (!/^bun x gm-exec(@[^\s]*)?(\s|$)/.test(command) && !/^git /.test(command) && !/^bun x codebasesearch/.test(command) && !/(\bclaude\b)/.test(command) && !/^npm install .* \/config\/.gmweb\/npm-global\/lib\/node_modules\/gm-exec/.test(command) && !/^bun install --cwd \/config\/.gmweb\/npm-global\/lib\/node_modules\/gm-exec/.test(command)) {
98
96
  let helpText = '';
99
97
  try { helpText = '\n\n' + execSync('bun x gm-exec --help', { timeout: 10000 }).toString().trim(); } catch (e) {}
package/manifest.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: gm
2
- version: 2.0.160
2
+ version: 2.0.162
3
3
  description: State machine agent with hooks, skills, and automated git enforcement
4
4
  author: AnEntrypoint
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-copilot-cli",
3
- "version": "2.0.160",
3
+ "version": "2.0.162",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/tools.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.160",
3
+ "version": "2.0.162",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "tools": [
6
6
  {