gm-kilo 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.
package/hooks/hooks.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "hooks": [
8
8
  {
9
9
  "type": "command",
10
- "command": "node ${KILO_PLUGIN_ROOT}/hooks/pre-tool-use-hook.js",
10
+ "command": "bun ${KILO_PLUGIN_ROOT}/hooks/pre-tool-use-hook.js",
11
11
  "timeout": 3600
12
12
  }
13
13
  ]
@@ -19,7 +19,7 @@
19
19
  "hooks": [
20
20
  {
21
21
  "type": "command",
22
- "command": "node ${KILO_PLUGIN_ROOT}/hooks/session-start-hook.js",
22
+ "command": "bun ${KILO_PLUGIN_ROOT}/hooks/session-start-hook.js",
23
23
  "timeout": 10000
24
24
  }
25
25
  ]
@@ -31,7 +31,7 @@
31
31
  "hooks": [
32
32
  {
33
33
  "type": "command",
34
- "command": "node ${KILO_PLUGIN_ROOT}/hooks/prompt-submit-hook.js",
34
+ "command": "bun ${KILO_PLUGIN_ROOT}/hooks/prompt-submit-hook.js",
35
35
  "timeout": 3600
36
36
  }
37
37
  ]
@@ -43,12 +43,12 @@
43
43
  "hooks": [
44
44
  {
45
45
  "type": "command",
46
- "command": "node ${KILO_PLUGIN_ROOT}/hooks/stop-hook.js",
46
+ "command": "bun ${KILO_PLUGIN_ROOT}/hooks/stop-hook.js",
47
47
  "timeout": 300000
48
48
  },
49
49
  {
50
50
  "type": "command",
51
- "command": "node ${KILO_PLUGIN_ROOT}/hooks/stop-hook-git.js",
51
+ "command": "bun ${KILO_PLUGIN_ROOT}/hooks/stop-hook-git.js",
52
52
  "timeout": 60000
53
53
  }
54
54
  ]
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-kilo",
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",