0101-agents 0.1.7 → 0.1.8
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/cli.js +18 -8
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -336,15 +336,25 @@ async function cmdStart(args) {
|
|
|
336
336
|
die(`${agent} is not installed. Try: 0101-agents install ${agent}`)
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
// Best-effort update
|
|
340
|
-
//
|
|
339
|
+
// Best-effort update nag. Needs a saved key (the releases API is gated);
|
|
340
|
+
// no key, offline, or any non-200 (revoked, lapsed, agent not on the
|
|
341
|
+
// server) → skip silently. Launching NEVER depends on this — deliberately
|
|
342
|
+
// not fetchManifest(), whose die() on HTTP errors would kill the launch.
|
|
341
343
|
try {
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
)
|
|
344
|
+
const key = readConfig().license_key
|
|
345
|
+
if (key) {
|
|
346
|
+
const res = await fetch(`${apiBase()}/api/releases/${encodeURIComponent(agent)}`, {
|
|
347
|
+
headers: { Authorization: `Bearer ${key}` },
|
|
348
|
+
})
|
|
349
|
+
if (res.ok) {
|
|
350
|
+
const manifest = await res.json()
|
|
351
|
+
const current = installedVersion(agent)
|
|
352
|
+
if (current && manifest.latest !== current) {
|
|
353
|
+
console.log(
|
|
354
|
+
dim(`⚠ ${agent} ${manifest.latest} available (run: 0101-agents update ${agent})`),
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
}
|
|
348
358
|
}
|
|
349
359
|
} catch {
|
|
350
360
|
// ignore
|