gm-kilo 2.0.335 → 2.0.337

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.
Files changed (3) hide show
  1. package/cli.js +2 -0
  2. package/gm-kilo.mjs +24 -0
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -14,6 +14,7 @@ console.log(isUpgrade ? 'Upgrading gm-kilo...' : 'Installing gm-kilo...');
14
14
  try {
15
15
  fs.mkdirSync(path.join(kiloConfigDir, 'plugins'), { recursive: true });
16
16
  fs.mkdirSync(path.join(kiloConfigDir, 'agents'), { recursive: true });
17
+ fs.mkdirSync(path.join(kiloConfigDir, 'skills'), { recursive: true });
17
18
 
18
19
  function copyRecursive(src, dst) {
19
20
  if (!fs.existsSync(src)) return;
@@ -27,6 +28,7 @@ try {
27
28
 
28
29
  fs.copyFileSync(path.join(srcDir, 'gm-kilo.mjs'), path.join(kiloConfigDir, 'plugins', 'gm-kilo.mjs'));
29
30
  copyRecursive(path.join(srcDir, 'agents'), path.join(kiloConfigDir, 'agents'));
31
+ copyRecursive(path.join(srcDir, 'skills'), path.join(kiloConfigDir, 'skills'));
30
32
 
31
33
  const kiloJsonPath = path.join(kiloConfigDir, 'kilocode.json');
32
34
  let kiloConfig = {};
package/gm-kilo.mjs CHANGED
@@ -19,10 +19,26 @@ function detectLang(src) {
19
19
 
20
20
  function stripFooter(s) { return s ? s.replace(/\n\[Running tools\][\s\S]*$/, '').trimEnd() : ''; }
21
21
 
22
+ function tryLangPlugin(lang, code, cwd) {
23
+ const langPluginDir = join(__dirname, '..', 'lang');
24
+ const langPluginFile = join(langPluginDir, lang+'.js');
25
+ if (!existsSync(langPluginFile)) return null;
26
+ try {
27
+ const plugin = require(langPluginFile);
28
+ if (plugin && plugin.exec && plugin.exec.run) {
29
+ const result = plugin.exec.run(code, cwd || process.cwd());
30
+ return String(result === undefined ? '' : result);
31
+ }
32
+ } catch(e) {}
33
+ return null;
34
+ }
35
+
22
36
  function runExec(rawLang, code, cwd) {
23
37
  const lang = LANG_ALIASES[rawLang] || (rawLang || detectLang(code));
24
38
  const opts = { encoding: 'utf-8', timeout: 30000, ...(cwd && { cwd }) };
25
39
  const out = (r) => { const o = (r.stdout||'').trimEnd(), e = stripFooter(r.stderr||'').trimEnd(); return o && e ? o+'\n[stderr]\n'+e : o||e||'(no output)'; };
40
+ const pluginResult = tryLangPlugin(lang, code, cwd);
41
+ if (pluginResult !== null) return pluginResult;
26
42
  if (lang === 'python') return out(spawnSync('python3',['-c',code],opts));
27
43
  const ext = lang === 'typescript' ? 'ts' : lang === 'bash' ? 'sh' : 'mjs';
28
44
  const tmp = join(tmpdir(),'gm-plugin-'+Date.now()+'.'+ext);
@@ -94,6 +110,14 @@ export async function GmPlugin({ directory }) {
94
110
  output.args = { ...output.args, command: safePrintf('Use the code-search skill for codebase exploration instead of '+input.tool+'. Describe what you need in plain language.') };
95
111
  return;
96
112
  }
113
+ if (input.tool === 'EnterPlanMode') {
114
+ output.args = { ...output.args, command: safePrintf('Plan mode is disabled. Use the gm skill (PLAN→EXECUTE→EMIT→VERIFY→COMPLETE state machine) instead.') };
115
+ return;
116
+ }
117
+ if (input.tool === 'Task' && input.args?.subagent_type === 'Explore') {
118
+ output.args = { ...output.args, command: safePrintf('The Explore agent is blocked. Use exec:codesearch in the Bash tool instead.\n\nexec:codesearch\n<natural language description of what to find>') };
119
+ return;
120
+ }
97
121
  if (input.tool === 'write' || input.tool === 'Write') {
98
122
  const fp = (output.args && output.args.file_path) || '';
99
123
  const base = basename(fp).toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-kilo",
3
- "version": "2.0.335",
3
+ "version": "2.0.337",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",