livedesk 0.1.432 → 0.1.433

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.190",
3
+ "version": "0.1.191",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,10 +41,10 @@
41
41
  "ws": "^8.18.3"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@livedesk/fast-linux-x64": "0.1.397",
45
- "@livedesk/fast-osx-arm64": "0.1.397",
46
- "@livedesk/fast-osx-x64": "0.1.397",
47
- "@livedesk/fast-win-x64": "0.1.397"
44
+ "@livedesk/fast-linux-x64": "0.1.398",
45
+ "@livedesk/fast-osx-arm64": "0.1.398",
46
+ "@livedesk/fast-osx-x64": "0.1.398",
47
+ "@livedesk/fast-win-x64": "0.1.398"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
@@ -3334,6 +3334,20 @@ export function createRemoteHub(options = {}) {
3334
3334
  return {
3335
3335
  deviceId: device.deviceId,
3336
3336
  commandId: safeString(message.commandId || message.CommandId || pending?.commandId, 128),
3337
+ hubConnectionId: safeString(
3338
+ message.hubConnectionId
3339
+ || message.HubConnectionId
3340
+ || result.hubConnectionId
3341
+ || result.HubConnectionId
3342
+ || pending?.hubConnectionId,
3343
+ 128),
3344
+ inputEventId: safeString(
3345
+ message.inputEventId
3346
+ || message.InputEventId
3347
+ || result.inputEventId
3348
+ || result.InputEventId
3349
+ || pending?.inputEventId,
3350
+ 128),
3337
3351
  inputSeq,
3338
3352
  inputType: safeString(
3339
3353
  message.inputType
@@ -4536,23 +4550,12 @@ export function createRemoteHub(options = {}) {
4536
4550
 
4537
4551
  if (state.inputOnly) {
4538
4552
  device.inputLastSeenAt = new Date().toISOString();
4539
- if (message.type === 'input.applied') {
4553
+ if (message.type === 'input.applied' || message.type === 'input.error') {
4540
4554
  handleRemoteInputOutcome(device, {
4541
4555
  ...message,
4542
4556
  agentApplyMs: Number(message.agentApplyMs || 0) || 0
4543
4557
  }, 'input');
4544
4558
  }
4545
- if (message.type === 'input.error') {
4546
- const pending = takePendingInputFallback(
4547
- device,
4548
- message.commandId || message.CommandId,
4549
- message.inputSeq ?? message.InputSeq);
4550
- emitEvent('RemoteInputError', {
4551
- ...buildRemoteInputOutcome(device, message, pending),
4552
- error: safeString(message.error || message.Error, 600) || 'remote-input-failed',
4553
- failedAtEpochMs: Number(message.failedAtEpochMs ?? message.FailedAtEpochMs ?? 0) || 0
4554
- });
4555
- }
4556
4559
  return;
4557
4560
  }
4558
4561
  if (state.frameOnly) {
@@ -5386,6 +5389,8 @@ export function createRemoteHub(options = {}) {
5386
5389
  inputSeq: normalized.inputSeq,
5387
5390
  inputType: normalized.type,
5388
5391
  monitorIndex: normalized.monitorIndex,
5392
+ hubConnectionId: normalized.hubConnectionId,
5393
+ inputEventId: normalized.inputEventId,
5389
5394
  issuedAtEpochMs: normalized.issuedAtEpochMs,
5390
5395
  hubReceivedAtEpochMs: normalized.hubReceivedAtEpochMs,
5391
5396
  hubForwardedAtEpochMs,
package/hub/src/server.js CHANGED
@@ -170,19 +170,27 @@ function readPositiveIntegerEnv(name, fallback) {
170
170
  function handleRemoteHubEvent(type, event) {
171
171
  liveDeskUpdateManager?.handleRemoteEvent(type, event);
172
172
  hubTransferJobs?.handleRemoteEvent(type, event);
173
- if (type === 'RemoteInputApplied') {
174
- for (const ws of inputClients) {
175
- sendJson(ws, {
176
- type: 'RemoteInputApplied',
177
- ...event
173
+ if (type === 'RemoteInputApplied') {
174
+ const targetConnectionId = String(event?.hubConnectionId || '').trim();
175
+ for (const ws of inputClients) {
176
+ if (targetConnectionId && ws.liveDeskInputClientId !== targetConnectionId) {
177
+ continue;
178
+ }
179
+ sendJson(ws, {
180
+ type: 'RemoteInputApplied',
181
+ ...event
178
182
  });
179
183
  }
180
184
  return;
181
- }
185
+ }
182
186
  if (type === 'RemoteInputError') {
183
- for (const ws of inputClients) {
184
- sendJson(ws, {
185
- type: 'RemoteInputError',
187
+ const targetConnectionId = String(event?.hubConnectionId || '').trim();
188
+ for (const ws of inputClients) {
189
+ if (targetConnectionId && ws.liveDeskInputClientId !== targetConnectionId) {
190
+ continue;
191
+ }
192
+ sendJson(ws, {
193
+ type: 'RemoteInputError',
186
194
  ...event
187
195
  });
188
196
  }
@@ -4224,11 +4232,14 @@ inputWss.on('connection', ws => {
4224
4232
  if (fireAndForget && result?.ok) {
4225
4233
  return;
4226
4234
  }
4227
- sendJson(ws, {
4228
- type: result?.ok ? 'RemoteInputQueued' : 'RemoteInputError',
4229
- requestId: payload?.requestId || '',
4230
- deviceId,
4231
- result,
4235
+ sendJson(ws, {
4236
+ type: result?.ok ? 'RemoteInputQueued' : 'RemoteInputError',
4237
+ requestId: payload?.requestId || '',
4238
+ deviceId,
4239
+ inputSeq: Number(input?.inputSeq || 0) || 0,
4240
+ inputEventId: String(input?.inputEventId || ''),
4241
+ hubConnectionId: ws.liveDeskInputClientId,
4242
+ result,
4232
4243
  timestamp: new Date().toISOString()
4233
4244
  });
4234
4245
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "livedesk",
3
- "version": "0.1.432",
4
- "livedeskClientVersion": "0.1.190",
3
+ "version": "0.1.433",
4
+ "livedeskClientVersion": "0.1.191",
5
5
  "buildFlavor": "production",
6
6
  "description": "LiveDesk Hub and client launcher",
7
7
  "type": "module",
@@ -50,10 +50,10 @@
50
50
  "ws": "^8.18.3"
51
51
  },
52
52
  "optionalDependencies": {
53
- "@livedesk/fast-linux-x64": "0.1.397",
54
- "@livedesk/fast-osx-arm64": "0.1.397",
55
- "@livedesk/fast-osx-x64": "0.1.397",
56
- "@livedesk/fast-win-x64": "0.1.397"
53
+ "@livedesk/fast-linux-x64": "0.1.398",
54
+ "@livedesk/fast-osx-arm64": "0.1.398",
55
+ "@livedesk/fast-osx-x64": "0.1.398",
56
+ "@livedesk/fast-win-x64": "0.1.398"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"