modelstat 0.0.15 → 0.0.16

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/dist/cli.mjs CHANGED
@@ -9013,6 +9013,18 @@ async function cmdConnect(opts) {
9013
9013
  } else {
9014
9014
  step("Re-using existing device identity");
9015
9015
  ok(`device ${state.deviceId}`);
9016
+ try {
9017
+ const me = await fetchDeviceMe(state.bearer);
9018
+ if (me.claim_code && me.claim_code !== state.claimCode) {
9019
+ state.setClaimCode(me.claim_code);
9020
+ ok(`claim code refreshed from server`);
9021
+ }
9022
+ if (me.claim_url && me.claim_url !== state.claimUrl) {
9023
+ state.setClaimUrl(me.claim_url);
9024
+ }
9025
+ } catch (e) {
9026
+ warn(`couldn't refresh device state: ${e.message}`);
9027
+ }
9016
9028
  }
9017
9029
  const claimCode = state.claimCode ?? "(unknown)";
9018
9030
  const claimUrl = state.claimUrl ?? `https://modelstat.ai/device/${claimCode}`;