gm-skill 2.0.1499 → 2.0.1501

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-plugkit",
3
- "version": "2.0.1499",
3
+ "version": "2.0.1501",
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": {
@@ -1004,7 +1004,7 @@ function getOrCreateBrowserSession(cwd, claudeSessionId, pw) {
1004
1004
  if (pidOk && profileOk && cdpOk) {
1005
1005
  const pwIds = sessions[claudeSessionId] || [];
1006
1006
  if (pwIds.length > 0 && existing.pwSessionId) return existing.pwSessionId;
1007
- const r = runBrowserRunner(pw, ['session', 'new', '--direct', existing.wsEndpoint], 30000);
1007
+ const r = runBrowserRunner(pw, ['session', 'new', '--direct', existing.wsEndpoint], 30000, cwd, claudeSessionId);
1008
1008
  if (r && r.status === 0) {
1009
1009
  const sid = parseSessionId(r.stdout || '');
1010
1010
  if (sid) {
@@ -1070,7 +1070,7 @@ function getOrCreateBrowserSession(cwd, claudeSessionId, pw) {
1070
1070
  logEvent('plugkit', 'browser.start', { profileDir });
1071
1071
  ({ pid: browserPid, port, wsEndpoint } = startManagedBrowser(pw, profileDir));
1072
1072
  }
1073
- const r = runBrowserRunner(pw, ['session', 'new', '--direct', wsEndpoint], 30000);
1073
+ const r = runBrowserRunner(pw, ['session', 'new', '--direct', wsEndpoint], 30000, cwd, claudeSessionId);
1074
1074
  if (!r || r.status !== 0) {
1075
1075
  const errTxt = scrubBrowserRunnerText((r && (r.stderr || r.stdout)) || 'unknown');
1076
1076
  logEvent('plugkit', 'browser.launch-failed', { reason: 'session-attach-failed', pid: browserPid, port, error: errTxt });
@@ -1839,7 +1839,7 @@ function makeHostFunctions(instanceRef) {
1839
1839
  // and pass list/new/delete/reset through verbatim. Anything else is rejected
1840
1840
  // by playwriter with its own usage text, which is the correct surface.
1841
1841
  if (parts[0] === 'close' || parts[0] === 'kill') parts[0] = 'delete';
1842
- const r = runBrowserRunner(pw, ['session', ...parts], 30000);
1842
+ const r = runBrowserRunner(pw, ['session', ...parts], 30000, cwd, sessionId);
1843
1843
  return writeWasmJson(instanceRef.value, {
1844
1844
  ok: r.status === 0,
1845
1845
  stdout: scrubBrowserRunnerText(r.stdout || ''),
@@ -1861,7 +1861,7 @@ function makeHostFunctions(instanceRef) {
1861
1861
  }
1862
1862
  }
1863
1863
  const outerTimeoutMs = Math.min(timeoutMs + 6000, 60000);
1864
- const r = runBrowserRunner(pw, ['-s', pwSessionId, '--timeout', String(timeoutMs), '-e', evalBody], outerTimeoutMs);
1864
+ const r = runBrowserRunner(pw, ['-s', pwSessionId, '--timeout', String(timeoutMs), '-e', evalBody], outerTimeoutMs, cwd, sessionId);
1865
1865
  const ok = r.status === 0;
1866
1866
  if (!ok && r.status === null) {
1867
1867
  logEvent('plugkit', 'browser.runner-timeout', { session_id: pwSessionId, timeout_ms: timeoutMs, body_bytes: evalBody.length });
@@ -3263,6 +3263,48 @@ async function runSpoolWatcher(instance, spoolDir) {
3263
3263
  setTimeout(checkForUpdate, 10_000);
3264
3264
  setInterval(checkForUpdate, UPDATE_CHECK_INTERVAL_MS);
3265
3265
 
3266
+ function periodicSkillMdRefresh() {
3267
+ try {
3268
+ const skillCandidates = [
3269
+ path.join(wrapperDir, 'SKILL.md'),
3270
+ path.join(wrapperDir, '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
3271
+ path.join(wrapperDir, '..', '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
3272
+ path.join(wrapperDir, '..', 'skills', 'gm-skill', 'SKILL.md'),
3273
+ ];
3274
+ const bundledPath = skillCandidates.find(p => { try { return fs.existsSync(p); } catch (_) { return false; } });
3275
+ if (!bundledPath) return;
3276
+ const bundled = fs.readFileSync(bundledPath, 'utf-8');
3277
+ const bundledHash = crypto.createHash('sha256').update(bundled).digest('hex');
3278
+ const home = process.env.HOME || process.env.USERPROFILE || os.homedir();
3279
+ const targets = [
3280
+ path.join(home, '.agents', 'skills', 'gm-skill', 'SKILL.md'),
3281
+ path.join(home, '.claude', 'skills', 'gm-skill', 'SKILL.md'),
3282
+ ];
3283
+ const refreshed = [];
3284
+ for (const target of targets) {
3285
+ try {
3286
+ let needsWrite = true;
3287
+ if (fs.existsSync(target)) {
3288
+ const existingHash = crypto.createHash('sha256').update(fs.readFileSync(target, 'utf-8')).digest('hex');
3289
+ if (existingHash === bundledHash) needsWrite = false;
3290
+ }
3291
+ if (needsWrite) {
3292
+ fs.mkdirSync(path.dirname(target), { recursive: true });
3293
+ const tmp = target + '.tmp';
3294
+ fs.writeFileSync(tmp, bundled);
3295
+ fs.renameSync(tmp, target);
3296
+ refreshed.push(target);
3297
+ }
3298
+ } catch (_) {}
3299
+ }
3300
+ if (refreshed.length > 0) {
3301
+ try { logEvent('plugkit', 'skill-md.refreshed-periodic', { hash: bundledHash.slice(0, 12), targets: refreshed.length, source: bundledPath }); } catch (_) {}
3302
+ }
3303
+ } catch (_) {}
3304
+ }
3305
+ setTimeout(periodicSkillMdRefresh, 12_000);
3306
+ setInterval(periodicSkillMdRefresh, UPDATE_CHECK_INTERVAL_MS);
3307
+
3266
3308
  const pollInterval = setInterval(async () => {
3267
3309
  const existing = walkDir(inDir);
3268
3310
  if (existing.length > 0) markActivity('poll');
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1499",
3
+ "version": "2.0.1501",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1499",
3
+ "version": "2.0.1501",
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",