gm-copilot-cli 2.0.245 → 2.0.246

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.245
3
+ version: 2.0.246
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
@@ -13,7 +13,7 @@ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_
13
13
  const TOOLS_DIR = path.join(os.homedir(), '.claude', 'gm-tools');
14
14
  const CHECK_STAMP = path.join(TOOLS_DIR, '.last-check');
15
15
  const PKG_JSON = path.join(TOOLS_DIR, 'package.json');
16
- const MANAGED_PKGS = ['codebasesearch', 'mcp-thorns', 'agent-browser'];
16
+ const MANAGED_PKGS = ['agent-browser'];
17
17
  const CHECK_INTERVAL_MS = 60 * 1000; // 60 seconds
18
18
 
19
19
  function ensureToolsDir() {
@@ -178,15 +178,15 @@ const allowWithNoop = (context) => {
178
178
  };
179
179
  };
180
180
 
181
- // ─── rs-exec runner helper ────────────────────────────────────────────────────
182
- function rsExecBin() { return path.join(TOOLS_DIR, IS_WIN ? 'rs-exec.exe' : 'rs-exec'); }
181
+ // ─── plugkit runner helper ────────────────────────────────────────────────────
182
+ function plugkitBin() { return path.join(TOOLS_DIR, IS_WIN ? 'plugkit.exe' : 'plugkit'); }
183
183
 
184
184
  function runGmExec(args, opts = {}) {
185
- const bin = rsExecBin();
185
+ const bin = plugkitBin();
186
186
  if (fs.existsSync(bin)) {
187
187
  return spawnSync(bin, args, { encoding: 'utf8', windowsHide: true, timeout: 65000, ...opts });
188
188
  }
189
- return spawnSync('rs-exec', args, { encoding: 'utf8', windowsHide: true, timeout: 65000, ...opts });
189
+ return spawnSync('plugkit', args, { encoding: 'utf8', windowsHide: true, timeout: 65000, ...opts });
190
190
  }
191
191
 
192
192
  // ─── Main hook ────────────────────────────────────────────────────────────────
@@ -409,7 +409,7 @@ const run = () => {
409
409
 
410
410
  if (['codesearch', 'search'].includes(lang)) {
411
411
  const query = safeCode.trim();
412
- const r = runLocal('codebasesearch', [query], { timeout: 30000, ...(cwd && { cwd }) });
412
+ const r = runGmExec(['search', ...(cwd ? ['--path', cwd] : []), query], { timeout: 30000, ...(cwd && { cwd }) });
413
413
  return allowWithNoop(`exec:${lang} output:\n\n${stripFooter((r.stdout || '') + (r.stderr || '')) || '(no results)'}`);
414
414
  }
415
415
  if (lang === 'status') {
@@ -477,7 +477,7 @@ const run = () => {
477
477
  }
478
478
  }
479
479
 
480
- if (/^bun\s+x\s+(gm-exec|rs-exec|codebasesearch)/.test(command)) {
480
+ if (/^bun\s+x\s+(gm-exec|rs-exec|plugkit|codebasesearch)/.test(command)) {
481
481
  return deny(`Do not call ${command.match(/^bun\s+x\s+(\S+)/)[1]} directly. Use exec:<lang> syntax instead.\n\nExamples:\n exec:nodejs\n console.log("hello")\n\n exec:codesearch\n find all database queries\n\n exec:bash\n ls -la\n\nThe exec: prefix routes through the hook dispatcher which handles language detection, background tasks, and tool management automatically.`);
482
482
  }
483
483
 
@@ -26,6 +26,16 @@ function runLocal(name, args, opts = {}) {
26
26
  return spawnSync('bun', ['x', name, ...args], { encoding: 'utf8', windowsHide: true, timeout: 30000, ...opts });
27
27
  }
28
28
 
29
+ function plugkitBin() { return path.join(TOOLS_DIR, IS_WIN ? 'plugkit.exe' : 'plugkit'); }
30
+
31
+ function runPlugkit(args, opts = {}) {
32
+ const bin = plugkitBin();
33
+ if (fs.existsSync(bin)) {
34
+ return spawnSync(bin, args, { encoding: 'utf8', windowsHide: true, timeout: 30000, ...opts });
35
+ }
36
+ return spawnSync('plugkit', args, { encoding: 'utf8', windowsHide: true, timeout: 30000, ...opts });
37
+ }
38
+
29
39
  const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR || process.env.KILO_PROJECT_DIR;
30
40
 
31
41
  function loadLangPlugins(dir) {
@@ -107,9 +117,9 @@ const ensureGitignore = () => {
107
117
  const runThorns = () => {
108
118
  if (!projectDir || !fs.existsSync(projectDir)) return '';
109
119
  try {
110
- const r = runLocal('mcp-thorns', [projectDir], { timeout: 15000 });
120
+ const r = runPlugkit(['codeinsight', projectDir], { timeout: 15000 });
111
121
  const out = ((r.stdout || '') + (r.stderr || '')).trim();
112
- return out ? `=== mcp-thorns ===\n${out}` : '';
122
+ return out ? `=== codeinsight ===\n${out}` : '';
113
123
  } catch (e) {
114
124
  return '';
115
125
  }
@@ -118,9 +128,9 @@ const runThorns = () => {
118
128
  const runCodeSearch = (prompt) => {
119
129
  if (!prompt || !projectDir) return '';
120
130
  try {
121
- const r = runLocal('codebasesearch', [prompt], { timeout: 10000, cwd: projectDir });
131
+ const r = runPlugkit(['search', '--path', projectDir, prompt], { timeout: 10000, cwd: projectDir });
122
132
  const out = ((r.stdout || '') + (r.stderr || '')).trim();
123
- return out ? `=== codebasesearch ===\n${out}` : '';
133
+ return out ? `=== search ===\n${out}` : '';
124
134
  } catch (e) {
125
135
  return '';
126
136
  }
@@ -37,28 +37,22 @@ function runLocal(name, args, opts = {}) {
37
37
  return spawnSync('bun', ['x', name, ...args], { encoding: 'utf8', windowsHide: true, timeout: 30000, ...opts });
38
38
  }
39
39
 
40
- const MANAGED_PKGS = ['codebasesearch', 'mcp-thorns', 'agent-browser'];
40
+ const MANAGED_PKGS = ['agent-browser'];
41
41
  const PKG_JSON = path.join(TOOLS_DIR, 'package.json');
42
42
 
43
- const RS_EXEC_REPO = 'AnEntrypoint/rs-exec';
43
+ const PLUGKIT_REPO = 'AnEntrypoint/rs-plugkit';
44
44
  const archMap = { x64: 'x86_64', arm64: 'aarch64', ia32: 'x86_64' };
45
- const osTargets = {
46
- win32: a => `rs-exec-${a}-pc-windows-msvcexe`,
47
- darwin: a => `rs-exec-${a}-apple-darwin`,
48
- linux: a => `rs-exec-${a}-unknown-linux-gnu`,
49
- };
50
- const osProcTargets = {
51
- win32: a => `rs-exec-process-${a}-pc-windows-msvcexe`,
52
- darwin: a => `rs-exec-process-${a}-apple-darwin`,
53
- linux: a => `rs-exec-process-${a}-unknown-linux-gnu`,
45
+ const plugkitTargets = {
46
+ win32: a => `plugkit-x86_64-pc-windows-msvc/plugkit.exe`,
47
+ darwin: a => `plugkit-x86_64-unknown-linux-gnu/plugkit`,
48
+ linux: a => `plugkit-x86_64-unknown-linux-gnu/plugkit`,
54
49
  };
55
50
 
56
- function rsExecBin() { return path.join(TOOLS_DIR, IS_WIN ? 'rs-exec.exe' : 'rs-exec'); }
57
- function rsExecProcessBin() { return path.join(TOOLS_DIR, IS_WIN ? 'rs-exec-process.exe' : 'rs-exec-process'); }
51
+ function plugkitBin() { return path.join(TOOLS_DIR, IS_WIN ? 'plugkit.exe' : 'plugkit'); }
58
52
 
59
- function downloadBin(assetName, dest) {
53
+ function downloadBin(assetPath, dest) {
60
54
  const https = require('https');
61
- const url = `https://github.com/${RS_EXEC_REPO}/releases/latest/download/${assetName}`;
55
+ const url = `https://github.com/${PLUGKIT_REPO}/releases/latest/download/${assetPath}`;
62
56
  return new Promise((resolve) => {
63
57
  const follow = (u) => https.get(u, { headers: { 'User-Agent': 'gm' } }, res => {
64
58
  if (res.statusCode >= 300 && res.statusCode < 400) return follow(res.headers.location);
@@ -70,15 +64,12 @@ function downloadBin(assetName, dest) {
70
64
  });
71
65
  }
72
66
 
73
- async function ensureRsExec() {
74
- const arch = archMap[process.arch] || 'x86_64';
75
- const plat = process.platform;
76
- const mainBin = rsExecBin();
77
- const procBin = rsExecProcessBin();
78
- const downloads = [];
79
- if (!fs.existsSync(mainBin)) downloads.push(downloadBin(osTargets[plat]?.(arch) || osTargets.linux(arch), mainBin));
80
- if (!fs.existsSync(procBin)) downloads.push(downloadBin(osProcTargets[plat]?.(arch) || osProcTargets.linux(arch), procBin));
81
- if (downloads.length) await Promise.all(downloads);
67
+ async function ensurePlugkit() {
68
+ const bin = plugkitBin();
69
+ if (!fs.existsSync(bin)) {
70
+ const assetPath = plugkitTargets[process.platform]?.(archMap[process.arch] || 'x86_64') || plugkitTargets.linux('x86_64');
71
+ await downloadBin(assetPath, bin);
72
+ }
82
73
  }
83
74
 
84
75
  function ensureTools() {
@@ -97,7 +88,7 @@ function ensureTools() {
97
88
  }
98
89
 
99
90
  ensureTools();
100
- ensureRsExec().catch(() => {});
91
+ ensurePlugkit().catch(() => {});
101
92
 
102
93
  const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR || process.env.KILO_PROJECT_DIR;
103
94
 
@@ -150,14 +141,17 @@ ensureGitignore();
150
141
  try {
151
142
  let outputs = [];
152
143
 
153
- outputs.push('Use the Skill tool with skill: "gm" to begin — do NOT use the Agent tool to load skills. Skills are invoked via the Skill tool only, never as agents. All code execution uses exec:<lang> via the Bash tool — never direct Bash(node ...) or Bash(npm ...) or Bash(npx ...) or Bash(bun x rs-exec ...).');
144
+ outputs.push('Use the Skill tool with skill: "gm" to begin — do NOT use the Agent tool to load skills. Skills are invoked via the Skill tool only, never as agents. All code execution uses exec:<lang> via the Bash tool — never direct Bash(node ...) or Bash(npm ...) or Bash(npx ...) or Bash(plugkit ...).');
154
145
 
155
146
  if (projectDir && fs.existsSync(projectDir)) {
156
147
  try {
157
- const r = runLocal('mcp-thorns', [projectDir], { timeout: 15000 });
158
- const thornOutput = ((r.stdout || '') + (r.stderr || '')).trim();
159
- if (thornOutput) {
160
- outputs.push(`=== This is your initial insight of the repository, look at every possible aspect of this for initial opinionation and to offset the need for code exploration ===\n${thornOutput}`);
148
+ const bin = plugkitBin();
149
+ const r = fs.existsSync(bin)
150
+ ? spawnSync(bin, ['codeinsight', projectDir], { encoding: 'utf8', windowsHide: true, timeout: 15000 })
151
+ : spawnSync('plugkit', ['codeinsight', projectDir], { encoding: 'utf8', windowsHide: true, timeout: 15000 });
152
+ const insightOutput = ((r.stdout || '') + (r.stderr || '')).trim();
153
+ if (insightOutput) {
154
+ outputs.push(`=== This is your initial insight of the repository, look at every possible aspect of this for initial opinionation and to offset the need for code exploration ===\n${insightOutput}`);
161
155
  }
162
156
  } catch (e) {}
163
157
  }
package/index.html CHANGED
@@ -18,7 +18,7 @@
18
18
  <script type="module">
19
19
  import { createElement as h, applyDiff, Fragment } from "webjsx";
20
20
  const PLATFORM_NAME="Copilot CLI",PLATFORM_TYPE="CLI Tool",PLATFORM_TYPE_COLOR="#3b82f6";
21
- const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.245";
21
+ const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.246";
22
22
  const GITHUB_URL="https://github.com/AnEntrypoint/gm-copilot-cli",BADGE_LABEL="copilot-cli";
23
23
  const FEATURES=[{"title":"State Machine","desc":"Immutable PLAN→EXECUTE→EMIT→VERIFY→COMPLETE phases with full mutable tracking"},{"title":"Semantic Search","desc":"Natural language codebase exploration via codesearch skill — no grep needed"},{"title":"Hooks","desc":"Pre-tool, session-start, prompt-submit, and stop hooks for full lifecycle control"},{"title":"Agents","desc":"gm, codesearch, and websearch agents pre-configured and ready to use"},{"title":"MCP Integration","desc":"Model Context Protocol server support built in"},{"title":"Auto-Recovery","desc":"Supervisor hierarchy ensures the system never crashes"}],INSTALL_STEPS=[{"desc":"Install via GitHub CLI","cmd":"gh extension install AnEntrypoint/gm-copilot-cli"},{"desc":"Restart your terminal — activates automatically"}];
24
24
  const CURRENT_PLATFORM="gm-copilot-cli";
package/manifest.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: gm
2
- version: 2.0.245
2
+ version: 2.0.246
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.245",
3
+ "version": "2.0.246",
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.245",
3
+ "version": "2.0.246",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "tools": [
6
6
  {