gm-skill 2.0.1352 → 2.0.1354

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/bin/bootstrap.js CHANGED
@@ -170,7 +170,7 @@ function obsEvent(subsystem, event, fields) {
170
170
  if (process.env.GM_LOG_DISABLE) return;
171
171
  try {
172
172
  const root = process.env.GM_LOG_DIR
173
- || path.join(os.homedir(), '.gm-log');
173
+ || path.join(os.homedir(), '.claude', 'gm-log');
174
174
  const day = new Date().toISOString().slice(0, 10);
175
175
  const dir = path.join(root, day);
176
176
  fs.mkdirSync(dir, { recursive: true });
@@ -15,7 +15,7 @@ const SHUTDOWN_REASON_PATH = path.join(spoolDir, '.shutdown-reason.json');
15
15
  const SUPERVISOR_STATUS_PATH = path.join(spoolDir, '.supervisor-status.json');
16
16
  const SUPERVISOR_PID_PATH = path.join(spoolDir, '.supervisor.pid');
17
17
  const LOG_PATH = path.join(spoolDir, '.watcher.log');
18
- const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.gm-log');
18
+ const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.claude', 'gm-log');
19
19
 
20
20
  const HEARTBEAT_STALE_MS = 60_000;
21
21
  const HEALTH_POLL_MS = 5_000;
@@ -45,7 +45,7 @@ function log(msg) {
45
45
  function obsEvent(subsystem, event, fields) {
46
46
  if (process.env.GM_LOG_DISABLE) return;
47
47
  try {
48
- const root = process.env.GM_LOG_DIR || path.join(os.homedir(), '.gm-log');
48
+ const root = process.env.GM_LOG_DIR || path.join(os.homedir(), '.claude', 'gm-log');
49
49
  const day = new Date().toISOString().slice(0, 10);
50
50
  const dir = path.join(root, day);
51
51
  fs.mkdirSync(dir, { recursive: true });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1352",
3
+ "version": "2.0.1354",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -29,7 +29,7 @@ const GM_TOOLS_ROOT = resolveGmToolsRoot();
29
29
  const KV_DIR = path.join(GM_TOOLS_ROOT, 'kv');
30
30
  fs.mkdirSync(KV_DIR, { recursive: true });
31
31
 
32
- const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.gm-log');
32
+ const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.claude', 'gm-log');
33
33
  const ORCHESTRATOR_VERBS = new Set(['instruction', 'transition', 'phase-status', 'prd-add', 'prd-resolve', 'prd-list', 'mutable-add', 'mutable-resolve', 'mutable-list', 'memorize-fire', 'residual-scan', 'auto-recall']);
34
34
 
35
35
  const TURN_IDLE_MS = 30_000;
@@ -2060,6 +2060,49 @@ async function runSpoolWatcher(instance, spoolDir) {
2060
2060
  try { reapTimedOutTasks(); } catch (_) {}
2061
2061
  }, 5000);
2062
2062
 
2063
+ let _selfStaleLoggedOnce = false;
2064
+ function probeGmPlugkitSelfStale() {
2065
+ try {
2066
+ const ownPkgPath = path.join(__dirname, 'package.json');
2067
+ if (!fs.existsSync(ownPkgPath)) return;
2068
+ const own = JSON.parse(fs.readFileSync(ownPkgPath, 'utf-8')).version;
2069
+ if (!own) return;
2070
+ const https = require('https');
2071
+ const req = https.get('https://registry.npmjs.org/gm-plugkit/latest', { timeout: 3000 }, (res) => {
2072
+ let body = '';
2073
+ res.on('data', (c) => body += c);
2074
+ res.on('end', () => {
2075
+ try {
2076
+ const latest = JSON.parse(body).version;
2077
+ const stalePath = path.join(spoolDir, '.gm-plugkit-stale.json');
2078
+ if (!latest || latest === own) {
2079
+ if (fs.existsSync(stalePath)) { try { fs.unlinkSync(stalePath); } catch (_) {} }
2080
+ return;
2081
+ }
2082
+ const marker = {
2083
+ ts: new Date().toISOString(),
2084
+ reason: 'gm-plugkit-self-stale',
2085
+ running_version: own,
2086
+ latest_version: latest,
2087
+ instruction: `gm-plugkit running ${own} but npm has ${latest}. The npx/bun cache served a stale copy. Clear the cache so the next invocation picks up the latest wrapper fixes: bun pm cache rm; or npx clear-npx-cache; or rm -rf ~/.npm/_npx ~/AppData/Local/npm-cache/_npx`,
2088
+ detected_by: 'watcher-periodic-probe',
2089
+ };
2090
+ try { fs.writeFileSync(stalePath, JSON.stringify(marker, null, 2)); } catch (_) {}
2091
+ if (!_selfStaleLoggedOnce) {
2092
+ _selfStaleLoggedOnce = true;
2093
+ try { logEvent('plugkit', 'gm-plugkit.self-stale', { running_version: own, latest_version: latest, detected_by: 'watcher-periodic-probe' }); } catch (_) {}
2094
+ console.error(`[plugkit-wasm] gm-plugkit self-stale: running ${own}, latest npm ${latest} (marker at .gm/exec-spool/.gm-plugkit-stale.json)`);
2095
+ }
2096
+ } catch (_) {}
2097
+ });
2098
+ });
2099
+ req.on('error', () => {});
2100
+ req.on('timeout', () => { try { req.destroy(); } catch (_) {} });
2101
+ } catch (_) {}
2102
+ }
2103
+ setTimeout(probeGmPlugkitSelfStale, 5000);
2104
+ setInterval(probeGmPlugkitSelfStale, 300_000);
2105
+
2063
2106
  const _instanceVersionAtBoot = readInstanceVersion(instance);
2064
2107
  let _driftLoggedOnce = false;
2065
2108
  setInterval(() => {
@@ -14,7 +14,7 @@ const STATUS_PATH = path.join(spoolDir, '.status.json');
14
14
  const SHUTDOWN_REASON_PATH = path.join(spoolDir, '.shutdown-reason.json');
15
15
  const SUPERVISOR_PATH = path.join(spoolDir, '.supervisor.json');
16
16
  const LOG_PATH = path.join(spoolDir, '.watcher.log');
17
- const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.gm-log');
17
+ const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.claude', 'gm-log');
18
18
 
19
19
  const POLL_INTERVAL_MS = 10_000;
20
20
  const STATUS_STALE_MS = 30_000;
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1352",
3
+ "version": "2.0.1354",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@ const {
9
9
  isBrowserAvailable,
10
10
  } = require('./browser');
11
11
 
12
- const LOG_DIR = path.join(os.homedir(), '.gm-log');
12
+ const LOG_DIR = path.join(os.homedir(), '.claude', 'gm-log');
13
13
 
14
14
  function emitHandlerEvent(severity, message, details) {
15
15
  try {
package/lib/browser.js CHANGED
@@ -3,7 +3,7 @@ const path = require('path');
3
3
  const os = require('os');
4
4
  const spool = require('./spool.js');
5
5
 
6
- const LOG_DIR = path.join(os.homedir(), '.gm-log');
6
+ const LOG_DIR = path.join(os.homedir(), '.claude', 'gm-log');
7
7
  const SESSION_STATE_DIR = path.join(os.homedir(), '.gm', 'browser-sessions');
8
8
 
9
9
  function emitBrowserEvent(severity, message, details) {
@@ -10,7 +10,7 @@ const REQUEST_TIMEOUT_MS = 30000;
10
10
  function emitEvent(severity, message, details = {}) {
11
11
  try {
12
12
  const date = new Date().toISOString().split('T')[0];
13
- const logDir = path.join(os.homedir(), '.gm-log', date);
13
+ const logDir = path.join(os.homedir(), '.claude', 'gm-log', date);
14
14
  if (!fs.existsSync(logDir)) fs.mkdirSync(logDir, { recursive: true });
15
15
  const entry = { ts: new Date().toISOString(), severity, message, ...details };
16
16
  fs.appendFileSync(path.join(logDir, 'codeinsight.jsonl'), JSON.stringify(entry) + '\n');
@@ -37,7 +37,7 @@ function shellQuoteWin(cmdOrArg) {
37
37
  return `"${s.replace(/"/g, '\\"')}"`;
38
38
  }
39
39
 
40
- const LOG_DIR = path.join(os.homedir(), '.gm-log');
40
+ const LOG_DIR = path.join(os.homedir(), '.claude', 'gm-log');
41
41
  const GM_STATE_DIR = path.join(os.homedir(), '.gm');
42
42
 
43
43
  function emitDaemonEvent(daemon, severity, message, details) {
package/lib/git.js CHANGED
@@ -6,7 +6,7 @@ const GIT_USER = 'lanmower';
6
6
  const GIT_EMAIL = 'almagestfraternite@gmail.com';
7
7
 
8
8
  function emitGitEvent(severity, message, data = {}) {
9
- const logDir = path.join(os.homedir(), '.gm-log', new Date().toISOString().split('T')[0]);
9
+ const logDir = path.join(os.homedir(), '.claude', 'gm-log', new Date().toISOString().split('T')[0]);
10
10
  if (!fs.existsSync(logDir)) {
11
11
  try { fs.mkdirSync(logDir, { recursive: true }); } catch (e) {}
12
12
  }
package/lib/learning.js CHANGED
@@ -5,7 +5,7 @@ const spool = require('./spool.js');
5
5
 
6
6
  const RS_LEARN_HOST = '127.0.0.1';
7
7
  const RS_LEARN_PORT = 4801;
8
- const LOG_DIR = path.join(os.homedir(), '.gm-log');
8
+ const LOG_DIR = path.join(os.homedir(), '.claude', 'gm-log');
9
9
 
10
10
  let daemonBootstrap = null;
11
11
  function getDaemonBootstrap() {
@@ -20,7 +20,7 @@ const PLUGKIT_WASM_WRAPPER = path.join(PLUGKIT_TOOLS_DIR, 'plugkit-wasm-wrapper.
20
20
  const PLUGKIT_SUPERVISOR = path.join(PLUGKIT_TOOLS_DIR, 'plugkit-supervisor.js');
21
21
  const BOOTSTRAP_STATUS_FILE = path.join(os.homedir(), '.gm', 'bootstrap-status.json');
22
22
  const BOOTSTRAP_ERROR_FILE = path.join(os.homedir(), '.gm', 'bootstrap-error.json');
23
- const LOG_DIR = path.join(os.homedir(), '.gm-log');
23
+ const LOG_DIR = path.join(os.homedir(), '.claude', 'gm-log');
24
24
 
25
25
  function getPlugkitPath() {
26
26
  return PLUGKIT_WASM_PATH;
@@ -3,7 +3,7 @@ const path = require('path');
3
3
  const os = require('os');
4
4
  const { spawnSync } = require('child_process');
5
5
 
6
- const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.gm-log');
6
+ const GM_LOG_ROOT = process.env.GM_LOG_DIR || path.join(os.homedir(), '.claude', 'gm-log');
7
7
 
8
8
  function logDeviation(event, fields) {
9
9
  if (process.env.GM_LOG_DISABLE) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1352",
3
+ "version": "2.0.1354",
4
4
  "description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",