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.
Files changed (2) hide show
  1. package/bin/cli.js +18 -8
  2. 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 check. Silently skipped if offline or the server
340
- // misbehaves never blocks the launch.
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 manifest = await fetchManifest(agent)
343
- const current = installedVersion(agent)
344
- if (current && manifest.latest !== current) {
345
- console.log(
346
- dim(`⚠ ${agent} ${manifest.latest} available (run: 0101-agents update ${agent})`),
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0101-agents",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "0101-agents": "./bin/cli.js"