gm-kilo 2.0.28 → 2.0.30
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/cli.js +2 -2
- package/{gm.js → gm.mjs} +9 -14
- package/hooks/session-start-hook.js +6 -4
- package/index.mjs +1 -0
- package/package.json +4 -4
- package/index.js +0 -1
package/cli.js
CHANGED
|
@@ -21,8 +21,8 @@ try {
|
|
|
21
21
|
['agents', 'agents'],
|
|
22
22
|
['hooks', 'hooks'],
|
|
23
23
|
['skills', 'skills'],
|
|
24
|
-
['index.
|
|
25
|
-
['gm.
|
|
24
|
+
['index.mjs', 'index.mjs'],
|
|
25
|
+
['gm.mjs', 'gm.mjs'],
|
|
26
26
|
['kilocode.json', 'kilocode.json'],
|
|
27
27
|
['.mcp.json', '.mcp.json'],
|
|
28
28
|
['README.md', 'README.md'],
|
package/{gm.js → gm.mjs}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
export default async ({ project, client, $, directory, worktree }) => {
|
|
5
7
|
const pluginDir = __dirname;
|
|
6
8
|
let agentRules = '';
|
|
7
9
|
|
|
@@ -67,19 +69,12 @@ const GmPlugin = async ({ project, client, $, directory, worktree }) => {
|
|
|
67
69
|
console.log('✓ gm plugin loaded');
|
|
68
70
|
},
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
'experimental.chat.system.transform': async (input, output) => {
|
|
71
73
|
const rules = loadAgentRules();
|
|
72
74
|
const prd = fs.existsSync(prdFile) ? fs.readFileSync(prdFile, 'utf-8').trim() : '';
|
|
73
|
-
let
|
|
74
|
-
if (prd)
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
onSessionEnd: async () => {
|
|
79
|
-
const prd = fs.existsSync(prdFile) ? fs.readFileSync(prdFile, 'utf-8').trim() : '';
|
|
80
|
-
if (prd) throw new Error('Work items remain in .prd - commit changes before exiting');
|
|
75
|
+
let content = rules || '';
|
|
76
|
+
if (prd) content += '\n\nPENDING WORK (.prd):\n' + prd;
|
|
77
|
+
if (content) output.system.push(content);
|
|
81
78
|
}
|
|
82
79
|
};
|
|
83
80
|
};
|
|
84
|
-
|
|
85
|
-
module.exports = { GmPlugin };
|
|
@@ -4,8 +4,8 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const { execSync } = require('child_process');
|
|
6
6
|
|
|
7
|
-
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.GEMINI_PROJECT_DIR || process.env.OC_PLUGIN_ROOT;
|
|
8
|
-
const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR;
|
|
7
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.GEMINI_PROJECT_DIR || process.env.OC_PLUGIN_ROOT || process.env.KILO_PLUGIN_ROOT;
|
|
8
|
+
const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR || process.env.KILO_PROJECT_DIR;
|
|
9
9
|
|
|
10
10
|
const ensureGitignore = () => {
|
|
11
11
|
if (!projectDir) return;
|
|
@@ -113,13 +113,14 @@ When exploring unfamiliar code, finding similar patterns, understanding integrat
|
|
|
113
113
|
|
|
114
114
|
const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
|
|
115
115
|
const isOpenCode = process.env.OC_PLUGIN_ROOT !== undefined;
|
|
116
|
+
const isKilo = process.env.KILO_PLUGIN_ROOT !== undefined;
|
|
116
117
|
|
|
117
118
|
if (isGemini) {
|
|
118
119
|
const result = {
|
|
119
120
|
systemMessage: additionalContext
|
|
120
121
|
};
|
|
121
122
|
console.log(JSON.stringify(result, null, 2));
|
|
122
|
-
} else if (isOpenCode) {
|
|
123
|
+
} else if (isOpenCode || isKilo) {
|
|
123
124
|
const result = {
|
|
124
125
|
hookSpecificOutput: {
|
|
125
126
|
hookEventName: 'session.created',
|
|
@@ -139,12 +140,13 @@ When exploring unfamiliar code, finding similar patterns, understanding integrat
|
|
|
139
140
|
} catch (error) {
|
|
140
141
|
const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
|
|
141
142
|
const isOpenCode = process.env.OC_PLUGIN_ROOT !== undefined;
|
|
143
|
+
const isKilo = process.env.KILO_PLUGIN_ROOT !== undefined;
|
|
142
144
|
|
|
143
145
|
if (isGemini) {
|
|
144
146
|
console.log(JSON.stringify({
|
|
145
147
|
systemMessage: `Error executing hook: ${error.message}`
|
|
146
148
|
}, null, 2));
|
|
147
|
-
} else if (isOpenCode) {
|
|
149
|
+
} else if (isOpenCode || isKilo) {
|
|
148
150
|
console.log(JSON.stringify({
|
|
149
151
|
hookSpecificOutput: {
|
|
150
152
|
hookEventName: 'session.created',
|
package/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './gm.mjs';
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-kilo",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.30",
|
|
4
4
|
"description": "State machine agent with hooks, skills, and automated git enforcement",
|
|
5
5
|
"author": "AnEntrypoint",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "gm.
|
|
7
|
+
"main": "gm.mjs",
|
|
8
8
|
"bin": {
|
|
9
9
|
"gm-kilo": "./cli.js",
|
|
10
10
|
"gm-kilo-install": "./install.js"
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"hooks/",
|
|
42
42
|
"skills/",
|
|
43
43
|
"scripts/",
|
|
44
|
-
"gm.
|
|
45
|
-
"index.
|
|
44
|
+
"gm.mjs",
|
|
45
|
+
"index.mjs",
|
|
46
46
|
"kilocode.json",
|
|
47
47
|
".github/",
|
|
48
48
|
".mcp.json",
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = { GmPlugin: require('./gm.js').GmPlugin };
|