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.
- package/cli.js +27 -14
- 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
|
|
252
|
-
// one-time install before
|
|
253
|
-
|
|
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
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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": {
|