modelstat 0.0.14 → 0.0.15
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 +1 -13
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -9007,18 +9007,6 @@ async function cmdConnect(opts) {
|
|
|
9007
9007
|
process.stdout.write(` \x1B[33m\u26A0\x1B[0m ${msg}
|
|
9008
9008
|
`);
|
|
9009
9009
|
};
|
|
9010
|
-
const hasLegacyBearer = !!state.bearer && !state.bearer.startsWith("ds_live_");
|
|
9011
|
-
const hasLegacyClaim = !!state.claimUrl && (state.claimUrl.includes("/c/") || /\/d\/[a-z]/.test(state.claimUrl) || !state.claimUrl.includes("/device/"));
|
|
9012
|
-
const hasLegacyCode = !!state.claimCode && !/^[0-9a-hjkmnp-tv-z]{32}$/.test(state.claimCode);
|
|
9013
|
-
if (hasLegacyBearer || hasLegacyClaim || hasLegacyCode) {
|
|
9014
|
-
step("Legacy state detected from an older version \u2014 wiping");
|
|
9015
|
-
state.setBearer(null);
|
|
9016
|
-
state.setDeviceId(null);
|
|
9017
|
-
state.setDeviceUuid(null);
|
|
9018
|
-
state.setClaimCode(null);
|
|
9019
|
-
state.setClaimUrl(null);
|
|
9020
|
-
ok("clean slate");
|
|
9021
|
-
}
|
|
9022
9010
|
if (!state.deviceUuid || !state.bearer || !state.deviceId) {
|
|
9023
9011
|
step("Registering this device with modelstat.ai");
|
|
9024
9012
|
await cmdSelfRegister();
|
|
@@ -9028,7 +9016,7 @@ async function cmdConnect(opts) {
|
|
|
9028
9016
|
}
|
|
9029
9017
|
const claimCode = state.claimCode ?? "(unknown)";
|
|
9030
9018
|
const claimUrl = state.claimUrl ?? `https://modelstat.ai/device/${claimCode}`;
|
|
9031
|
-
const agentUrl = `https://modelstat.ai/device
|
|
9019
|
+
const agentUrl = `https://modelstat.ai/device/${claimCode}/agent`;
|
|
9032
9020
|
emitEvent(opts, "registered", {
|
|
9033
9021
|
device_uuid: state.deviceUuid,
|
|
9034
9022
|
device_id: state.deviceId,
|