gm-skill 2.0.1338 → 2.0.1340

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 +1 @@
1
- 0.1.501
1
+ 0.1.502
@@ -1 +1 @@
1
- 242f4e3fa2b916e509aefb360e49558d7684bdbb34f3ae55e1febdaa04350a6b plugkit.wasm
1
+ ead0376a1e522a6b4171e1705e82db208fc8ffd9f18615da0baa31734bdef8b7 plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1338",
3
+ "version": "2.0.1340",
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": {
@@ -357,13 +357,18 @@ function logEvent(sub, event, fields) {
357
357
  const day = new Date().toISOString().slice(0, 10);
358
358
  const dir = path.join(GM_LOG_ROOT, day);
359
359
  fs.mkdirSync(dir, { recursive: true });
360
+ const safeFields = { ...(fields || {}) };
361
+ if (Object.prototype.hasOwnProperty.call(safeFields, 'pid')) {
362
+ safeFields.child_pid = safeFields.pid;
363
+ delete safeFields.pid;
364
+ }
360
365
  const line = JSON.stringify({
361
366
  ts: new Date().toISOString(),
362
367
  sub,
363
368
  event,
364
369
  pid: process.pid,
365
370
  sess: readCurrentSess(),
366
- ...fields,
371
+ ...safeFields,
367
372
  });
368
373
  fs.appendFileSync(path.join(dir, `${sub}.jsonl`), line + '\n');
369
374
  } catch (_) {}
@@ -1691,13 +1696,29 @@ function makeHostFunctions(instanceRef) {
1691
1696
 
1692
1697
  const pwSessionId = getOrCreateBrowserSession(cwd, sessionId, pw);
1693
1698
  try { lastBrowserActivityMs = Date.now(); } catch (_) {}
1694
- const r = runBrowserRunner(pw, ['-s', pwSessionId, '--timeout', '14000', '-e', body], 60000);
1699
+ let evalBody = body;
1700
+ let timeoutMs = 14000;
1701
+ const timeoutMatch = body.match(/^timeout=(\d+)\s*\n([\s\S]*)$/);
1702
+ if (timeoutMatch) {
1703
+ const requested = parseInt(timeoutMatch[1], 10);
1704
+ if (Number.isFinite(requested) && requested > 0) {
1705
+ timeoutMs = Math.min(requested, 50000);
1706
+ evalBody = timeoutMatch[2];
1707
+ }
1708
+ }
1709
+ const outerTimeoutMs = Math.min(timeoutMs + 6000, 60000);
1710
+ const r = runBrowserRunner(pw, ['-s', pwSessionId, '--timeout', String(timeoutMs), '-e', evalBody], outerTimeoutMs);
1711
+ const ok = r.status === 0;
1712
+ if (!ok && r.status === null) {
1713
+ logEvent('plugkit', 'browser.runner-timeout', { session_id: pwSessionId, timeout_ms: timeoutMs, body_bytes: evalBody.length });
1714
+ }
1695
1715
  return writeWasmJson(instanceRef.value, {
1696
- ok: r.status === 0,
1716
+ ok,
1697
1717
  stdout: scrubBrowserRunnerText(r.stdout || ''),
1698
1718
  stderr: scrubBrowserRunnerText(r.stderr || ''),
1699
1719
  exit_code: r.status === null ? -1 : r.status,
1700
1720
  session_id: pwSessionId,
1721
+ timeout_ms_used: timeoutMs,
1701
1722
  });
1702
1723
  } catch (e) {
1703
1724
  return writeWasmJson(instanceRef.value, { ok: false, error: scrubBrowserRunnerText(e.message) });
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1338",
3
+ "version": "2.0.1340",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "plugkitVersion": "0.1.501"
20
+ "plugkitVersion": "0.1.502"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1338",
3
+ "version": "2.0.1340",
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",