gm-plugkit 2.0.1975 → 2.0.1976

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.
Files changed (2) hide show
  1. package/cli.js +27 -14
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -248,21 +248,34 @@ function writeCliError(phase, err) {
248
248
  // This is the actual code-level enforcement of what was previously only a
249
249
  // documented convention (SKILL.md telling an LLM agent to manually prefer
250
250
  // gm-runner) -- with this in place bun/node are only ever exercised on a
251
- // platform gm-runner-bin has no published binary for, or during the
252
- // one-time install before gm-runner itself lands on disk.
253
- function tryDelegateToGmRunner(args) {
251
+ // platform neither runner has a published binary for, or during the
252
+ // one-time install before either runner lands on disk.
253
+ //
254
+ // agentplug-runner is tried FIRST, gm-runner second -- agentplug-runner
255
+ // serves the identical spool ABI (same in/out layout, same verb names;
256
+ // gm.wasm is just one of its loadable plugins now) so it's a strict
257
+ // superset, not an alternative; gm-runner stays as the fallback for any
258
+ // install that has it but hasn't picked up agentplug-runner yet (installer
259
+ // re-run pending, or a platform agentplug-bin hasn't published for yet
260
+ // while gm-runner-bin already has).
261
+ function tryDelegateToRunner(args) {
254
262
  if (process.env.GM_PLUGKIT_NO_RUNNER_DELEGATE === '1') return false;
255
- const exeName = process.platform === 'win32' ? 'gm-runner.exe' : 'gm-runner';
256
- const runnerPath = path.join(gmToolsDir(), exeName);
257
- if (!fs.existsSync(runnerPath)) return false;
258
- try {
259
- const result = cp.spawnSync(runnerPath, args, { stdio: 'inherit', windowsHide: true });
260
- if (result.error) return false; // exec genuinely failed to start -- fall through to bun/node path
261
- process.exit(typeof result.status === 'number' ? result.status : 0);
262
- } catch (_) {
263
- return false;
263
+ const candidates = process.platform === 'win32'
264
+ ? ['agentplug-runner.exe', 'gm-runner.exe']
265
+ : ['agentplug-runner', 'gm-runner'];
266
+ for (const exeName of candidates) {
267
+ const runnerPath = path.join(gmToolsDir(), exeName);
268
+ if (!fs.existsSync(runnerPath)) continue;
269
+ try {
270
+ const result = cp.spawnSync(runnerPath, args, { stdio: 'inherit', windowsHide: true });
271
+ if (result.error) continue; // this candidate genuinely failed to start -- try the next one
272
+ process.exit(typeof result.status === 'number' ? result.status : 0);
273
+ } catch (_) {
274
+ continue;
275
+ }
276
+ return true;
264
277
  }
265
- return true;
278
+ return false;
266
279
  }
267
280
 
268
281
  (async () => {
@@ -273,7 +286,7 @@ function tryDelegateToGmRunner(args) {
273
286
  process.exit(0);
274
287
  }
275
288
 
276
- tryDelegateToGmRunner(args);
289
+ tryDelegateToRunner(args);
277
290
 
278
291
  if (args.includes('--kill-stale-watchers')) {
279
292
  process.exit(killStaleWatchers());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1975",
3
+ "version": "2.0.1976",
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": {