gm-cc 2.0.55 → 2.0.57

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,10 +1,10 @@
1
1
  {
2
- "name": "gm",
2
+ "name": "gm-cc",
3
3
  "owner": {
4
4
  "name": "AnEntrypoint"
5
5
  },
6
6
  "description": "State machine agent with hooks, skills, and automated git enforcement",
7
- "version": "2.0.55",
7
+ "version": "2.0.57",
8
8
  "metadata": {
9
9
  "description": "State machine agent with hooks, skills, and automated git enforcement"
10
10
  },
package/cli.js CHANGED
@@ -38,6 +38,7 @@ try {
38
38
 
39
39
  filesToCopy.forEach(name => copyRecursive(path.join(srcDir, name), path.join(destDir, name)));
40
40
 
41
+ // Register in settings.json (enabledPlugins only, no hook injection)
41
42
  const settingsPath = path.join(claudeDir, 'settings.json');
42
43
  let settings = {};
43
44
  if (fs.existsSync(settingsPath)) {
@@ -45,10 +46,47 @@ try {
45
46
  }
46
47
  if (!settings.enabledPlugins) settings.enabledPlugins = {};
47
48
  settings.enabledPlugins['gm@gm-cc'] = true;
49
+ // Remove stale hook entries (handled by plugin hooks.json)
50
+ if (settings.hooks) delete settings.hooks;
51
+ // Register marketplace so Claude Code resolves gm@gm-cc locally
52
+ if (!settings.extraKnownMarketplaces) settings.extraKnownMarketplaces = {};
53
+ settings.extraKnownMarketplaces['gm-cc'] = { source: { source: 'directory', path: destDir } };
48
54
  fs.mkdirSync(claudeDir, { recursive: true });
49
55
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
50
56
  console.log('✓ Plugin registered in ~/.claude/settings.json');
51
57
 
58
+ // Write installed_plugins.json so Claude Code loads from local cache
59
+ const pluginVersion = require('./package.json').version;
60
+ const installedPluginsPath = path.join(pluginsDir, 'installed_plugins.json');
61
+ let installedPlugins = { version: 2, plugins: {} };
62
+ if (fs.existsSync(installedPluginsPath)) {
63
+ try { installedPlugins = JSON.parse(fs.readFileSync(installedPluginsPath, 'utf-8')); } catch (e) {}
64
+ }
65
+ if (!installedPlugins.plugins || Array.isArray(installedPlugins.plugins)) installedPlugins.plugins = {};
66
+ const now = new Date().toISOString();
67
+ const existing = Array.isArray(installedPlugins.plugins['gm@gm-cc']) ? installedPlugins.plugins['gm@gm-cc'][0] : null;
68
+ // Also write cache dir so Claude Code finds it without network fetch
69
+ const cacheDir = path.join(pluginsDir, 'cache', 'gm-cc', 'gm', pluginVersion);
70
+ const filesToCache = ['agents', 'hooks', '.mcp.json', '.claude-plugin', 'plugin.json', 'README.md', 'CLAUDE.md'];
71
+ function copyRecursiveCache(src, dst) {
72
+ if (!fs.existsSync(src)) return;
73
+ if (fs.statSync(src).isDirectory()) {
74
+ fs.mkdirSync(dst, { recursive: true });
75
+ fs.readdirSync(src).forEach(f => copyRecursiveCache(path.join(src, f), path.join(dst, f)));
76
+ } else { fs.copyFileSync(src, dst); }
77
+ }
78
+ fs.mkdirSync(cacheDir, { recursive: true });
79
+ filesToCache.forEach(name => copyRecursiveCache(path.join(destDir, name), path.join(cacheDir, name)));
80
+ installedPlugins.plugins['gm@gm-cc'] = [{
81
+ scope: 'user',
82
+ installPath: cacheDir,
83
+ version: pluginVersion,
84
+ installedAt: existing?.installedAt || now,
85
+ lastUpdated: now
86
+ }];
87
+ fs.writeFileSync(installedPluginsPath, JSON.stringify(installedPlugins, null, 2), 'utf-8');
88
+ console.log('✓ Plugin registered in installed_plugins.json');
89
+
52
90
  console.log(`✓ gm-cc ${isUpgrade ? 'upgraded' : 'installed'} to ${destDir}`);
53
91
  console.log('Restart Claude Code to activate the gm plugin.');
54
92
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-cc",
3
- "version": "2.0.55",
3
+ "version": "2.0.57",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.55",
3
+ "version": "2.0.57",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",