livedesk 0.1.459 → 0.1.460

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/livedesk.js +34 -23
  2. package/package.json +1 -1
package/bin/livedesk.js CHANGED
@@ -2947,14 +2947,6 @@ async function main() {
2947
2947
  await runLegacyClientUpdateSupervisorCli();
2948
2948
  return;
2949
2949
  }
2950
- const roleStateOptions = {
2951
- stateDir: MANAGER_STATE_DIR,
2952
- legacyClientStateDir: process.env.LIVEDESK_LEGACY_CLIENT_STATE_DIR
2953
- };
2954
- migrateLegacyClientState({
2955
- stateDir: MANAGER_STATE_DIR,
2956
- legacyClientStateDir: process.env.LIVEDESK_LEGACY_CLIENT_STATE_DIR
2957
- });
2958
2950
  const topLevel = parseTopLevelArgs(rawArgs);
2959
2951
  if (topLevel.debug) {
2960
2952
  process.env.LIVEDESK_DEBUG = '1';
@@ -2969,10 +2961,37 @@ async function main() {
2969
2961
  console.log(readVersion());
2970
2962
  return;
2971
2963
  }
2972
- await assertNoActiveMacPhysicalDiagnosticLease();
2973
2964
  const explicitRoleCommand = command === 'hub' || command === 'manager' || command === 'client';
2974
- let resolvedRole;
2975
- let runtimeArgs = args;
2965
+ if (explicitRoleCommand) {
2966
+ const commandArgs = args.slice(1).map(value => String(value || '').trim().toLowerCase());
2967
+ if (commandArgs.some(value => value === '--help' || value === '-h' || value === 'help')) {
2968
+ if (command === 'client') {
2969
+ console.warn('[LiveDesk] Legacy client command detected. Use `npx -y --prefer-online livedesk@latest` for automatic role selection.');
2970
+ printClientHelp();
2971
+ } else {
2972
+ printHelp();
2973
+ }
2974
+ return;
2975
+ }
2976
+ if (commandArgs.some(value => value === '--version' || value === '-v' || value === 'version')) {
2977
+ if (command === 'client') {
2978
+ console.warn('[LiveDesk] Legacy client command detected. Use `npx -y --prefer-online livedesk@latest` for automatic role selection.');
2979
+ }
2980
+ console.log(readVersion());
2981
+ return;
2982
+ }
2983
+ }
2984
+ await assertNoActiveMacPhysicalDiagnosticLease();
2985
+ const roleStateOptions = {
2986
+ stateDir: MANAGER_STATE_DIR,
2987
+ legacyClientStateDir: process.env.LIVEDESK_LEGACY_CLIENT_STATE_DIR
2988
+ };
2989
+ migrateLegacyClientState({
2990
+ stateDir: MANAGER_STATE_DIR,
2991
+ legacyClientStateDir: process.env.LIVEDESK_LEGACY_CLIENT_STATE_DIR
2992
+ });
2993
+ let resolvedRole;
2994
+ let runtimeArgs = args;
2976
2995
  if (explicitRoleCommand) {
2977
2996
  const role = command === 'client' ? 'client' : 'hub';
2978
2997
  resolvedRole = await resolveDeviceRole({ forcedRole: role, ...roleStateOptions });
@@ -3091,20 +3110,12 @@ async function main() {
3091
3110
  }
3092
3111
 
3093
3112
  if (command === 'client') {
3094
- if (args.slice(1).some(arg => arg === '--help' || arg === '-h' || arg === 'help')) {
3095
- printClientHelp();
3096
- return;
3097
- }
3098
3113
  await runClient(runtimeArgs, resolvedRole, lock);
3099
- return;
3100
- }
3101
- if (command === 'hub' || command === 'manager') {
3102
- if (args.slice(1).some(arg => arg === '--help' || arg === '-h' || arg === 'help')) {
3103
- printHelp();
3104
- return;
3105
- }
3114
+ return;
3115
+ }
3116
+ if (command === 'hub' || command === 'manager') {
3106
3117
  await runManager(runtimeArgs, resolvedRole, lock);
3107
- return;
3118
+ return;
3108
3119
  }
3109
3120
  if (resolvedRole.role === 'client') {
3110
3121
  await runClient(runtimeArgs, resolvedRole, lock);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "livedesk",
3
- "version": "0.1.459",
3
+ "version": "0.1.460",
4
4
  "livedeskClientVersion": "0.1.213",
5
5
  "buildFlavor": "production",
6
6
  "description": "LiveDesk Hub and client launcher",