gm-skill 2.0.1500 → 2.0.1502

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.1500",
3
+ "version": "2.0.1502",
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": {
@@ -787,11 +787,22 @@ function sleepSync(ms) {
787
787
  spawnSync(process.execPath, ['-e', `setTimeout(()=>{}, ${ms})`], { timeout: ms + 2000 });
788
788
  }
789
789
 
790
- function runBrowserRunner(pw, args, timeoutMs) {
790
+ function playwriterHomeFor(cwd, claudeSessionId) {
791
+ if (process.env.PLAYWRITER_HOME) return process.env.PLAYWRITER_HOME;
792
+ if (!cwd) return path.join(GM_TOOLS_ROOT, `pw-sock-${sessionProfileSlug(claudeSessionId)}`);
793
+ try { ensureGitignored(cwd, '.gm/pw-sock-*/'); } catch (_) {}
794
+ return path.join(cwd, '.gm', `pw-sock-${sessionProfileSlug(claudeSessionId)}`);
795
+ }
796
+
797
+ function runBrowserRunner(pw, args, timeoutMs, cwd, claudeSessionId) {
791
798
  const allArgs = [...pw.baseArgs, ...args];
792
799
  const useShell = !!pw.shell;
793
800
  const spawnCmd = useShell && /\s/.test(pw.cmd) ? `"${pw.cmd}"` : pw.cmd;
794
801
  const spawnArgs = useShell ? allArgs.map(a => /[\s"]/.test(String(a)) ? `"${String(a).replace(/"/g, '\\"')}"` : a) : allArgs;
802
+ const env = { ...process.env };
803
+ const sockDir = playwriterHomeFor(cwd, claudeSessionId);
804
+ try { fs.mkdirSync(sockDir, { recursive: true }); } catch (_) {}
805
+ env.PLAYWRITER_HOME = sockDir;
795
806
  // Stamp a busy window before the synchronous spawn so the blocked event loop's stale heartbeat
796
807
  // is not misread as a dead watcher. Pad past the spawn timeout for teardown.
797
808
  _writeStatusBusy((timeoutMs || 30000) + 5000);
@@ -800,7 +811,7 @@ function runBrowserRunner(pw, args, timeoutMs) {
800
811
  timeout: timeoutMs,
801
812
  shell: useShell,
802
813
  windowsHide: true,
803
- env: process.env,
814
+ env,
804
815
  });
805
816
  }
806
817
 
@@ -1004,7 +1015,7 @@ function getOrCreateBrowserSession(cwd, claudeSessionId, pw) {
1004
1015
  if (pidOk && profileOk && cdpOk) {
1005
1016
  const pwIds = sessions[claudeSessionId] || [];
1006
1017
  if (pwIds.length > 0 && existing.pwSessionId) return existing.pwSessionId;
1007
- const r = runBrowserRunner(pw, ['session', 'new', '--direct', existing.wsEndpoint], 30000);
1018
+ const r = runBrowserRunner(pw, ['session', 'new', '--direct', existing.wsEndpoint], 30000, cwd, claudeSessionId);
1008
1019
  if (r && r.status === 0) {
1009
1020
  const sid = parseSessionId(r.stdout || '');
1010
1021
  if (sid) {
@@ -1070,7 +1081,7 @@ function getOrCreateBrowserSession(cwd, claudeSessionId, pw) {
1070
1081
  logEvent('plugkit', 'browser.start', { profileDir });
1071
1082
  ({ pid: browserPid, port, wsEndpoint } = startManagedBrowser(pw, profileDir));
1072
1083
  }
1073
- const r = runBrowserRunner(pw, ['session', 'new', '--direct', wsEndpoint], 30000);
1084
+ const r = runBrowserRunner(pw, ['session', 'new', '--direct', wsEndpoint], 30000, cwd, claudeSessionId);
1074
1085
  if (!r || r.status !== 0) {
1075
1086
  const errTxt = scrubBrowserRunnerText((r && (r.stderr || r.stdout)) || 'unknown');
1076
1087
  logEvent('plugkit', 'browser.launch-failed', { reason: 'session-attach-failed', pid: browserPid, port, error: errTxt });
@@ -1839,7 +1850,7 @@ function makeHostFunctions(instanceRef) {
1839
1850
  // and pass list/new/delete/reset through verbatim. Anything else is rejected
1840
1851
  // by playwriter with its own usage text, which is the correct surface.
1841
1852
  if (parts[0] === 'close' || parts[0] === 'kill') parts[0] = 'delete';
1842
- const r = runBrowserRunner(pw, ['session', ...parts], 30000);
1853
+ const r = runBrowserRunner(pw, ['session', ...parts], 30000, cwd, sessionId);
1843
1854
  return writeWasmJson(instanceRef.value, {
1844
1855
  ok: r.status === 0,
1845
1856
  stdout: scrubBrowserRunnerText(r.stdout || ''),
@@ -1861,7 +1872,7 @@ function makeHostFunctions(instanceRef) {
1861
1872
  }
1862
1873
  }
1863
1874
  const outerTimeoutMs = Math.min(timeoutMs + 6000, 60000);
1864
- const r = runBrowserRunner(pw, ['-s', pwSessionId, '--timeout', String(timeoutMs), '-e', evalBody], outerTimeoutMs);
1875
+ const r = runBrowserRunner(pw, ['-s', pwSessionId, '--timeout', String(timeoutMs), '-e', evalBody], outerTimeoutMs, cwd, sessionId);
1865
1876
  const ok = r.status === 0;
1866
1877
  if (!ok && r.status === null) {
1867
1878
  logEvent('plugkit', 'browser.runner-timeout', { session_id: pwSessionId, timeout_ms: timeoutMs, body_bytes: evalBody.length });
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1500",
3
+ "version": "2.0.1502",
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.1500",
3
+ "version": "2.0.1502",
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",