gm-kilo 2.0.48 → 2.0.50

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/.mcp.json CHANGED
@@ -1,3 +1,9 @@
1
1
  {
2
- "$schema": "https://schemas.modelcontextprotocol.io/0.1.0/mcp.json"
2
+ "$schema": "https://schemas.modelcontextprotocol.io/0.1.0/mcp.json",
3
+ "mcpServers": {
4
+ "code_execution": {
5
+ "command": "npx",
6
+ "args": ["-y", "mcp-gm"]
7
+ }
8
+ }
3
9
  }
package/agents/gm.md CHANGED
@@ -54,11 +54,11 @@ The .prd path must resolve to exactly ./.prd in current working directory. No va
54
54
 
55
55
  Scope: Where and how code runs. Governs tool selection and execution context.
56
56
 
57
- All execution via `dev` skill or `agent-browser` skill. Every hypothesis proven by execution before changing files. Know nothing until execution proves it.
57
+ All execution via `code_execution` tool (Python) or `agent-browser` skill. Every hypothesis proven by execution before changing files. Know nothing until execution proves it.
58
58
 
59
- **CODE YOUR HYPOTHESES**: Test every possible hypothesis using the `dev` skill or `agent-browser` skill. Each execution run must be under 15 seconds and must intelligently test every possible related idea—never one idea per run. Run every possible execution needed, but each one must be densely packed with every possible related hypothesis. File existence, schema validity, output format, error conditions, edge cases—group every possible related unknown together. The goal is every possible hypothesis per run. Use `agent-browser` skill for cross-client UI testing and browser-based hypothesis validation.
59
+ **CODE YOUR HYPOTHESES**: Test every possible hypothesis using the `code_execution` tool with Python or `agent-browser` skill. Each run must be under 15 seconds and must densely pack every possible related hypothesis. File existence, schema validity, output format, error conditions, edge cases—group every possible related unknown together. The goal is every possible hypothesis per run. Use `agent-browser` skill for cross-client UI testing and browser-based hypothesis validation.
60
60
 
61
- **DEFAULT IS CODE, NOT BASH**: `dev` skill is the primary execution tool. Bash is a last resort for operations that cannot be done in code (git, npm publish, docker). If you find yourself writing a bash command, stop and ask: can this be done in the `dev` skill? The answer is almost always yes.
61
+ **DEFAULT IS code_execution WITH PYTHON**: Call the `code_execution` tool with Python code. The PreToolUse hook intercepts it, runs python3, and returns the output. Bash is blocked except for git, npm publish, and docker. If you find yourself writing a bash command, stop and ask: can this be done in Python? The answer is almost always yes. Use `subprocess.run()` for shell operations that truly can't be done otherwise.
62
62
 
63
63
  **TOOL POLICY**: All code execution via `dev` skill. Use `code-search` skill for exploration. Reference TOOL_INVARIANTS for enforcement.
64
64
 
@@ -74,8 +74,8 @@ All execution via `dev` skill or `agent-browser` skill. Every hypothesis proven
74
74
 
75
75
  **REQUIRED TOOL MAPPING**:
76
76
  - Code exploration: `code-search` skill — THE ONLY exploration tool. Semantic search 102 file types. Natural language queries with line numbers. No glob, no grep, no find, no explore agent, no Read for discovery.
77
- - Code execution: `dev` skillrun JS/TS/Python/Go/Rust/etc via Bash
78
- - File operations: `dev` skill with bun/node fs inline — read, write, stat files
77
+ - Code execution: call the `code_execution` tool directly with Python code the PreToolUse hook intercepts it, runs python3, and returns `[CODE EXECUTION RESULT]\nstdout: ...\nstderr: ...\nexit_code: N` as the result. Use Python's `subprocess` module for shell operations, `pathlib`/`os` for files, `requests` for HTTP.
78
+ - File operations: `code_execution` tool with Python `pathlib`/`os`/`open()` — read, write, stat files
79
79
  - Bash: ONLY git, npm publish/pack, docker, system daemons
80
80
  - Browser: Use **`agent-browser` skill** instead of puppeteer/playwright - same power, cleaner syntax, built for AI agents
81
81
 
@@ -59,25 +59,10 @@ const run = () => {
59
59
  const command = (tool_input?.command || '').trim();
60
60
  const allowed = /^(git |npm publish|npm pack|docker |sudo systemctl|systemctl )/.test(command);
61
61
  if (!allowed) {
62
- return { block: true, reason: 'Bash is blocked. Use the code_execution tool with Python instead. The hook intercepts code_execution, runs python3, and returns stdout/stderr/exit_code. Example: use code_execution with code "import subprocess; r=subprocess.run([\'node\',\'--version\'],capture_output=True,text=True); print(r.stdout)"' };
62
+ return { block: true, reason: 'Bash is blocked. Use the code_execution MCP tool instead. It supports Python, JS/TS, Go, Rust, C/C++ and bash via the language parameter. Example: code_execution({ code: "print(1+1)", language: "python", workingDirectory: process.cwd() })' };
63
63
  }
64
64
  }
65
65
 
66
- if (tool_name === 'code_execution') {
67
- const code = tool_input?.code || '';
68
- const { spawnSync } = require('child_process');
69
- const proc = spawnSync('python3', ['-'], {
70
- input: code,
71
- encoding: 'utf-8',
72
- timeout: 30000
73
- });
74
- const stdout = proc.stdout || '';
75
- const stderr = proc.stderr || '';
76
- const exitCode = proc.status !== null ? proc.status : 1;
77
- const result = `[CODE EXECUTION RESULT]\nstdout: ${stdout}\nstderr: ${stderr}\nexit_code: ${exitCode}`;
78
- return { block: true, reason: result };
79
- }
80
-
81
66
  return { allow: true };
82
67
  } catch (error) {
83
68
  return { allow: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-kilo",
3
- "version": "2.0.48",
3
+ "version": "2.0.50",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -127,11 +127,31 @@ function install() {
127
127
  // Copy files
128
128
  safeCopyDirectory(path.join(sourceDir, 'agents'), path.join(claudeDir, 'agents'));
129
129
  safeCopyDirectory(path.join(sourceDir, 'hooks'), path.join(claudeDir, 'hooks'));
130
+ safeCopyDirectory(path.join(sourceDir, 'skills'), path.join(claudeDir, 'skills'));
130
131
  safeCopyFile(path.join(sourceDir, '.mcp.json'), path.join(claudeDir, '.mcp.json'));
131
-
132
+
133
+ // Write settings.json with autoUpdates and hooks wired up
134
+ const settingsPath = path.join(claudeDir, 'settings.json');
135
+ let settings = {};
136
+ if (fs.existsSync(settingsPath)) {
137
+ try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8')); } catch (e) {}
138
+ }
139
+ settings.autoUpdates = true;
140
+ settings.hooks = settings.hooks || {};
141
+ const hookCmd = `node ${path.join(claudeDir, 'hooks', 'pre-tool-use-hook.js')}`;
142
+ settings.hooks.PreToolUse = settings.hooks.PreToolUse || [{ matcher: '*', hooks: [{ type: 'command', command: hookCmd }] }];
143
+ const sessionHookCmd = `node ${path.join(claudeDir, 'hooks', 'session-start-hook.js')}`;
144
+ settings.hooks.SessionStart = settings.hooks.SessionStart || [{ hooks: [{ type: 'command', command: sessionHookCmd }] }];
145
+ const stopHookCmd = `node ${path.join(claudeDir, 'hooks', 'stop-hook.js')}`;
146
+ const stopGitCmd = `node ${path.join(claudeDir, 'hooks', 'stop-hook-git.js')}`;
147
+ settings.hooks.Stop = settings.hooks.Stop || [{ hooks: [{ type: 'command', command: stopHookCmd }, { type: 'command', command: stopGitCmd }] }];
148
+ const promptHookCmd = `node ${path.join(claudeDir, 'hooks', 'prompt-submit-hook.js')}`;
149
+ settings.hooks.UserPromptSubmit = settings.hooks.UserPromptSubmit || [{ hooks: [{ type: 'command', command: promptHookCmd }] }];
150
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
151
+
132
152
  // Update .gitignore
133
153
  updateGitignore(projectRoot);
134
-
154
+
135
155
  // Silent success
136
156
  }
137
157