gm-qwen 2.0.809 → 2.0.810
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 +4 -2
- package/bin/plugkit.js +1 -1
- package/gm.json +1 -1
- package/package.json +1 -1
package/bin/bootstrap.js
CHANGED
|
@@ -17,7 +17,6 @@ const LOCK_STALE_MS = 5 * 60 * 1000;
|
|
|
17
17
|
|
|
18
18
|
function log(msg) {
|
|
19
19
|
try { process.stderr.write(`[plugkit-bootstrap] ${msg}\n`); } catch (_) {}
|
|
20
|
-
try { obsEvent('bootstrap', 'log', { msg }); } catch (_) {}
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
function obsEvent(subsystem, event, fields) {
|
|
@@ -218,6 +217,7 @@ async function downloadWithRetry(url, destPath) {
|
|
|
218
217
|
} catch (err) {
|
|
219
218
|
lastErr = err;
|
|
220
219
|
log(`attempt ${attempt} failed: ${err.message}`);
|
|
220
|
+
obsEvent('bootstrap', 'fetch.attempt_failed', { url, attempt, max: MAX_ATTEMPTS, err: String(err.message || err) });
|
|
221
221
|
if (attempt < MAX_ATTEMPTS) {
|
|
222
222
|
const wait = BACKOFF_MS[attempt - 1] || 120000;
|
|
223
223
|
log(`backing off ${wait}ms`);
|
|
@@ -306,6 +306,7 @@ async function bootstrap(opts) {
|
|
|
306
306
|
|
|
307
307
|
fs.writeFileSync(okSentinel, new Date().toISOString());
|
|
308
308
|
log(`installed ${finalPath}`);
|
|
309
|
+
obsEvent('bootstrap', 'install.done', { path: finalPath, version, kind: 'plugkit' });
|
|
309
310
|
pruneOldVersions(root, version);
|
|
310
311
|
// Best-effort rtk fetch: failures here never block plugkit usage
|
|
311
312
|
try { await bootstrapRtk(verDir, version, wrapperDir, opts.silent); }
|
|
@@ -346,6 +347,7 @@ async function bootstrapRtk(verDir, version, wrapperDir, silent) {
|
|
|
346
347
|
if (os.platform() !== 'win32') { try { fs.chmodSync(rtkPath, 0o755); } catch (_) {} }
|
|
347
348
|
fs.writeFileSync(rtkOk, new Date().toISOString());
|
|
348
349
|
log(`installed ${rtkPath}`);
|
|
350
|
+
obsEvent('bootstrap', 'install.done', { path: rtkPath, version, kind: 'rtk' });
|
|
349
351
|
return rtkPath;
|
|
350
352
|
}
|
|
351
353
|
|
|
@@ -384,5 +386,5 @@ module.exports = { bootstrap, resolveCachedBinary, resolveCachedRtk, platformKey
|
|
|
384
386
|
if (require.main === module) {
|
|
385
387
|
bootstrap({ silent: false })
|
|
386
388
|
.then(p => { process.stdout.write(p + '\n'); process.exit(0); })
|
|
387
|
-
.catch(err => { log(`FATAL: ${err.message}`); process.exit(1); });
|
|
389
|
+
.catch(err => { log(`FATAL: ${err.message}`); obsEvent('bootstrap', 'fatal', { err: String(err.message || err) }); process.exit(1); });
|
|
388
390
|
}
|
package/bin/plugkit.js
CHANGED
|
@@ -31,7 +31,7 @@ async function main() {
|
|
|
31
31
|
bin = await resolveBinary();
|
|
32
32
|
} catch (err) {
|
|
33
33
|
process.stderr.write(`[plugkit] bootstrap failed: ${err.message}\n`);
|
|
34
|
-
obsEvent('plugkit_wrapper', 'bootstrap_failed', { err: err.message });
|
|
34
|
+
obsEvent('plugkit_wrapper', 'bootstrap_failed', { err: err.message, dur_ms: Date.now() - startedAt, argv: args.slice(0, 4), is_hook: isHook });
|
|
35
35
|
const legacy = legacyFallback();
|
|
36
36
|
if (legacy) { bin = legacy; }
|
|
37
37
|
else if (isHook) { process.exit(0); }
|
package/gm.json
CHANGED