gm-skill 2.0.1992 → 2.0.1994

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
@@ -6,6 +6,7 @@ const path = require('path');
6
6
  const os = require('os');
7
7
  const crypto = require('crypto');
8
8
  const { spawnSync } = require('child_process');
9
+ const { ensureDir, pidAlive, sha256OfFile, sha256OfFileSync } = require('../gm-plugkit/gm-process');
9
10
 
10
11
  const NPM_PACKAGE = 'plugkit-wasm';
11
12
  const ATTEMPT_TIMEOUT_MS = 10 * 60 * 1000;
@@ -254,10 +255,6 @@ function copyWasmToGmTools(wasmPath, wrapperDir, version) {
254
255
  } catch (_) {}
255
256
  }
256
257
 
257
- function ensureDir(dir) {
258
- fs.mkdirSync(dir, { recursive: true });
259
- }
260
-
261
258
  function readVersionFile(wrapperDir) {
262
259
  const p = path.join(wrapperDir, 'plugkit.version');
263
260
  if (!fs.existsSync(p)) throw new Error(`plugkit.version not found at ${p}`);
@@ -265,20 +262,6 @@ function readVersionFile(wrapperDir) {
265
262
  }
266
263
 
267
264
 
268
- function sha256OfFileSync(filePath) {
269
- const h = crypto.createHash('sha256');
270
- const fd = fs.openSync(filePath, 'r');
271
- try {
272
- const buf = Buffer.alloc(1024 * 1024);
273
- for (;;) {
274
- const n = fs.readSync(fd, buf, 0, buf.length, null);
275
- if (n <= 0) break;
276
- h.update(buf.subarray(0, n));
277
- }
278
- } finally { try { fs.closeSync(fd); } catch (_) {} }
279
- return h.digest('hex');
280
- }
281
-
282
265
  function healIfShaMatches(binPath, expectedSha, sentinelPath, partialPath, kind) {
283
266
  if (!fs.existsSync(binPath)) return false;
284
267
  if (partialPath) { try { if (fs.existsSync(partialPath)) fs.unlinkSync(partialPath); } catch (_) {} }
@@ -306,10 +289,6 @@ function readShaManifest(wrapperDir, manifestName) {
306
289
  return out;
307
290
  }
308
291
 
309
- function pidAlive(pid) {
310
- try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; }
311
- }
312
-
313
292
  function acquireLock(lockPath) {
314
293
  const start = Date.now();
315
294
  for (;;) {
@@ -341,16 +320,6 @@ function releaseLock(lockPath) {
341
320
  try { fs.unlinkSync(lockPath); } catch (_) {}
342
321
  }
343
322
 
344
- function sha256OfFile(filePath) {
345
- return new Promise((resolve, reject) => {
346
- const h = crypto.createHash('sha256');
347
- const s = fs.createReadStream(filePath);
348
- s.on('data', c => h.update(c));
349
- s.on('end', () => resolve(h.digest('hex')));
350
- s.on('error', reject);
351
- });
352
- }
353
-
354
323
  async function extractNpmPackageWasm(destPath, version) {
355
324
  const tempDir = path.join(path.dirname(destPath), '.npm-extract-' + Date.now());
356
325
  try {
@@ -1 +1 @@
1
- 0d2c2d36dfd496b0eea0998b38b86d9496eb660757a6e91ddae6b49dc93ef878 plugkit-slim.wasm
1
+ fbe58168ec96a0bbea2f5265462a3ed02037ba5ad0351a1ec2889a0c2439c84e plugkit-slim.wasm
@@ -1 +1 @@
1
- 0.1.916
1
+ 0.1.918
@@ -1 +1 @@
1
- fe337c1fdb928a1f15774b3fa0371b4b51e6c3fdbf77f2131da1529610a590c6 plugkit.wasm
1
+ 24c2299759ae746103ff8573e08b250196c64c2ba1913be4ccdc6f0f6994f2b6 plugkit.wasm
@@ -7,7 +7,7 @@ const os = require('os');
7
7
  const crypto = require('crypto');
8
8
  const { spawn, spawnSync } = require('child_process');
9
9
  const { logEvent: _sharedLogEvent } = require('./gm-log');
10
- const { pidCommandLineForKillGuard: _sharedPidCommandLine } = require('./gm-process');
10
+ const { pidCommandLineForKillGuard: _sharedPidCommandLine, ensureDir, pidAlive, sha256OfFile, sha256OfFileSync } = require('./gm-process');
11
11
 
12
12
  function resolveWindowsExe(cmd) {
13
13
  if (process.platform !== 'win32') return cmd;
@@ -311,28 +311,6 @@ function readShaManifest() {
311
311
  return out;
312
312
  }
313
313
 
314
- function sha256OfFileSync(filePath) {
315
- const h = crypto.createHash('sha256');
316
- const fd = fs.openSync(filePath, 'r');
317
- try {
318
- const buf = Buffer.alloc(1024 * 1024);
319
- for (;;) {
320
- const n = fs.readSync(fd, buf, 0, buf.length, null);
321
- if (n <= 0) break;
322
- h.update(buf.subarray(0, n));
323
- }
324
- } finally { try { fs.closeSync(fd); } catch (_) {} }
325
- return h.digest('hex');
326
- }
327
-
328
- function ensureDir(dir) {
329
- fs.mkdirSync(dir, { recursive: true });
330
- }
331
-
332
- function pidAlive(pid) {
333
- try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; }
334
- }
335
-
336
314
  function acquireLock(lockPath) {
337
315
  const start = Date.now();
338
316
  for (;;) {
@@ -364,16 +342,6 @@ function releaseLock(lockPath) {
364
342
  try { fs.unlinkSync(lockPath); } catch (_) {}
365
343
  }
366
344
 
367
- function sha256OfFile(filePath) {
368
- return new Promise((resolve, reject) => {
369
- const h = crypto.createHash('sha256');
370
- const s = fs.createReadStream(filePath);
371
- s.on('data', c => h.update(c));
372
- s.on('end', () => resolve(h.digest('hex')));
373
- s.on('error', reject);
374
- });
375
- }
376
-
377
345
  function resolveNpxJsCli() {
378
346
  if (process.platform !== 'win32') return null;
379
347
  const candidates = [];
@@ -1,7 +1,44 @@
1
1
  'use strict';
2
2
 
3
+ const fs = require('fs');
4
+ const crypto = require('crypto');
3
5
  const { spawnSync } = require('child_process');
4
6
 
7
+ // Pure-leaf helpers shared byte-for-byte between bin/bootstrap.js and
8
+ // gm-plugkit/bootstrap.js (they were identical inline copies in both). Only
9
+ // node builtins, no bootstrap-local state -- safe to centralize here.
10
+ function ensureDir(dir) {
11
+ fs.mkdirSync(dir, { recursive: true });
12
+ }
13
+
14
+ function pidAlive(pid) {
15
+ try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; }
16
+ }
17
+
18
+ function sha256OfFile(filePath) {
19
+ return new Promise((resolve, reject) => {
20
+ const h = crypto.createHash('sha256');
21
+ const s = fs.createReadStream(filePath);
22
+ s.on('data', c => h.update(c));
23
+ s.on('end', () => resolve(h.digest('hex')));
24
+ s.on('error', reject);
25
+ });
26
+ }
27
+
28
+ function sha256OfFileSync(filePath) {
29
+ const h = crypto.createHash('sha256');
30
+ const fd = fs.openSync(filePath, 'r');
31
+ try {
32
+ const buf = Buffer.alloc(1024 * 1024);
33
+ for (;;) {
34
+ const n = fs.readSync(fd, buf, 0, buf.length, null);
35
+ if (n <= 0) break;
36
+ h.update(buf.subarray(0, n));
37
+ }
38
+ } finally { try { fs.closeSync(fd); } catch (_) {} }
39
+ return h.digest('hex');
40
+ }
41
+
5
42
  function pidCommandLineForKillGuard(pid) {
6
43
  try {
7
44
  if (process.platform === 'win32') {
@@ -31,4 +68,4 @@ function waitForPidDeath(pid, timeoutMs) {
31
68
  return !pidAliveSync(pid);
32
69
  }
33
70
 
34
- module.exports = { pidCommandLineForKillGuard, pidAliveSync, waitForPidDeath };
71
+ module.exports = { ensureDir, pidAlive, sha256OfFile, sha256OfFileSync, pidCommandLineForKillGuard, pidAliveSync, waitForPidDeath };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1992",
3
+ "version": "2.0.1994",
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": {
@@ -1 +1 @@
1
- 0d2c2d36dfd496b0eea0998b38b86d9496eb660757a6e91ddae6b49dc93ef878 plugkit-slim.wasm
1
+ fbe58168ec96a0bbea2f5265462a3ed02037ba5ad0351a1ec2889a0c2439c84e plugkit-slim.wasm
@@ -1 +1 @@
1
- 0.1.916
1
+ 0.1.918
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1992",
3
+ "version": "2.0.1994",
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.916"
20
+ "plugkitVersion": "0.1.918"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1992",
3
+ "version": "2.0.1994",
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",