gm-copilot-cli 2.0.164 → 2.0.166

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.164
3
+ version: 2.0.166
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
@@ -2,6 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const os = require('os');
5
6
  const { execSync, spawnSync } = require('child_process');
6
7
 
7
8
  const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
@@ -100,6 +101,18 @@ const run = () => {
100
101
  if (cwd) args.push(`--cwd=${cwd}`);
101
102
  args.push(code);
102
103
  } else {
104
+ const isMultiLine = code.includes('\n');
105
+ if (isMultiLine) {
106
+ const extMap = { nodejs: 'mjs', typescript: 'ts', python: 'py', go: 'go', rust: 'rs', deno: 'ts' };
107
+ const ext = extMap[lang] || 'mjs';
108
+ const tmpFile = path.join(os.tmpdir(), `gm-exec-${Date.now()}.${ext}`);
109
+ fs.writeFileSync(tmpFile, code, 'utf-8');
110
+ args = ['x', 'gm-exec', 'exec', `--lang=${lang}`, `--file=${tmpFile}`];
111
+ if (cwd) args.push(`--cwd=${cwd}`);
112
+ const result = runExec(args);
113
+ try { fs.unlinkSync(tmpFile); } catch (e) {}
114
+ return { block: true, reason: result || '(no output)' };
115
+ }
103
116
  args = ['x', 'gm-exec', 'exec', `--lang=${lang}`];
104
117
  if (cwd) args.push(`--cwd=${cwd}`);
105
118
  args.push(code);
package/manifest.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: gm
2
- version: 2.0.164
2
+ version: 2.0.166
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.164",
3
+ "version": "2.0.166",
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.164",
3
+ "version": "2.0.166",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "tools": [
6
6
  {