@yu_robotics/remote-cli-router 1.6.183 → 1.6.187
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/README.md +37 -0
- package/dist/binding/BindingManager.d.ts +18 -59
- package/dist/binding/BindingManager.d.ts.map +1 -1
- package/dist/binding/BindingManager.js +124 -155
- package/dist/binding/BindingManager.js.map +1 -1
- package/dist/commands/start.d.ts +1 -3
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +129 -63
- package/dist/commands/start.js.map +1 -1
- package/dist/feishu/FeishuLongConnHandler.d.ts.map +1 -1
- package/dist/feishu/FeishuLongConnHandler.js +9 -24
- package/dist/feishu/FeishuLongConnHandler.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +79 -22
- package/dist/server.js.map +1 -1
- package/dist/storage/JsonStore.d.ts +20 -64
- package/dist/storage/JsonStore.d.ts.map +1 -1
- package/dist/storage/JsonStore.js +295 -179
- package/dist/storage/JsonStore.js.map +1 -1
- package/dist/utils/PidManager.d.ts +6 -0
- package/dist/utils/PidManager.d.ts.map +1 -1
- package/dist/utils/PidManager.js +26 -1
- package/dist/utils/PidManager.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -364,6 +364,13 @@ docker compose up -d
|
|
|
364
364
|
|
|
365
365
|
The `./router-data` bind mount stores Router data under the container's `/router-data` home directory (`/router-data/.remote-cli-router/`). On Linux, set `ROUTER_UID` and `ROUTER_GID` in `.env` to the output of `id -u` and `id -g`; they must match the directory owner. Set `ROUTER_PORT` before setup if port `3000` is unavailable; it must match the server port entered in the setup wizard. The Compose service uses `restart: always`, so Docker starts the Router again after unexpected exits and Docker daemon restarts; `docker compose down` still removes the container. Use `docker compose logs -f router` to inspect logs and `docker compose down` to stop the service. Run local clients directly on their host machines rather than in Docker so they can access project files and local AI CLI binaries.
|
|
366
366
|
|
|
367
|
+
From Router 1.6.184, startup accepts a stale PID record that points to the new
|
|
368
|
+
startup process itself, including PID 1 after Docker recreation. Startup failures
|
|
369
|
+
and shutdown attempt bounded cleanup of the current instance's PID record.
|
|
370
|
+
Abrupt termination can still leave a record; successful cleanup is not required
|
|
371
|
+
for this self-PID recovery. Run only one Router per storage directory. This does
|
|
372
|
+
not provide concurrent-start locking or identity checks for unrelated reused PIDs.
|
|
373
|
+
|
|
367
374
|
Clients automatically install a newer Router's exact published npm version when their tasks and queues are idle. Manual clients continue running the old version until their next start; clients launched with `--non-interactive` exit for their supervisor to restart. A rejected CLI protocol requires a restart after installation. Publish the matching CLI package when upgrading the Router.
|
|
368
375
|
|
|
369
376
|
## Commands
|
|
@@ -503,6 +510,36 @@ From CLI 1.6.165, Pi connection and detach confirmations exclude simultaneous se
|
|
|
503
510
|
|
|
504
511
|
For full documentation, see the [project README](https://github.com/Yu-Robotics/remote-cli#readme).
|
|
505
512
|
|
|
513
|
+
## Upgrade compatibility
|
|
514
|
+
|
|
515
|
+
Router 1.6.185 retains protocol-v1 compatibility with existing CLIs, including
|
|
516
|
+
legacy registration and response formats. Task output must belong to the
|
|
517
|
+
connected device's bound user; binding requests and heartbeats remain available
|
|
518
|
+
before binding. Device binding changes are serialized and persistence failures
|
|
519
|
+
are reported rather than acknowledged as saved. Existing binding records keep
|
|
520
|
+
their JSON format. Malformed binding files are preserved and stop initialization
|
|
521
|
+
instead of being replaced with empty records. If a file replacement succeeds but
|
|
522
|
+
its durability cannot be confirmed, binding reads and writes stop until the
|
|
523
|
+
storage issue is resolved and the Router restarts to reconcile the saved file.
|
|
524
|
+
|
|
525
|
+
The ACP permission-error and Codex turn-start cleanup fixes are CLI-side changes:
|
|
526
|
+
upgrade the CLI to receive them. Older CLIs can continue using the updated Router
|
|
527
|
+
while retaining their previous local behavior. Legacy credentialless device
|
|
528
|
+
identification keeps its existing trust limitations; this release does not
|
|
529
|
+
require every older CLI to enroll a signed device key.
|
|
530
|
+
|
|
531
|
+
If Codex cannot confirm that its previous process stopped, the thread stays busy
|
|
532
|
+
and does not start queued work. Retry `/abort` to confirm termination and release
|
|
533
|
+
the thread. An unsuccessful retry reports the uncertainty and keeps the thread
|
|
534
|
+
blocked; it does not replay the failed prompt.
|
|
535
|
+
|
|
536
|
+
From Router 1.6.187, binding files must have a supported version and valid record
|
|
537
|
+
structure before they are loaded or migrated. Invalid files are preserved
|
|
538
|
+
without replacement, and the rejected store instance blocks reads and writes.
|
|
539
|
+
Correct or restore the file before restarting the Router. Valid version-1 files
|
|
540
|
+
and versionless single-device files, including empty legacy collections, remain
|
|
541
|
+
supported. The binding schema and protocol-v1 flow for existing CLIs are unchanged.
|
|
542
|
+
|
|
506
543
|
## License
|
|
507
544
|
|
|
508
545
|
MIT
|
|
@@ -1,76 +1,35 @@
|
|
|
1
|
-
import { DeviceBinding, UserBinding } from '../types';
|
|
1
|
+
import { BindingCode, DeviceBinding, UserBinding } from '../types';
|
|
2
2
|
import { JsonStore } from '../storage/JsonStore';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export interface BindingRedemption {
|
|
4
|
+
bindingCode: BindingCode;
|
|
5
|
+
alreadyBound: boolean;
|
|
6
|
+
isFirstDevice: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Serializes ownership mutations sharing one JsonStore, including key callbacks. */
|
|
8
9
|
export declare class BindingManager {
|
|
9
10
|
private store;
|
|
11
|
+
private mutationTail;
|
|
10
12
|
constructor(store: JsonStore);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* @param deviceName Device name
|
|
15
|
-
* @returns Binding code object
|
|
16
|
-
*/
|
|
17
|
-
generateBindingCode(deviceId: string, deviceName: string, devicePublicKey?: string): Promise<import('../types').BindingCode>;
|
|
18
|
-
/**
|
|
19
|
-
* Verify binding code
|
|
20
|
-
* @param code Binding code
|
|
21
|
-
* @returns Binding code object, returns null if invalid or expired
|
|
22
|
-
*/
|
|
23
|
-
verifyBindingCode(code: string): Promise<import('../types').BindingCode | null>;
|
|
13
|
+
private mutate;
|
|
14
|
+
generateBindingCode(deviceId: string, deviceName: string, devicePublicKey?: string): Promise<BindingCode>;
|
|
15
|
+
verifyBindingCode(code: string): Promise<BindingCode | null>;
|
|
24
16
|
consumeBindingCode(code: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
* First device becomes active; subsequent devices are added as inactive.
|
|
28
|
-
*/
|
|
17
|
+
/** Validate, assign, enroll, and consume without admitting competing mutations. */
|
|
18
|
+
redeemBindingCode(openId: string, code: string, deviceName: string, approveDeviceKey?: (openId: string, deviceId: string, publicKey: string) => Promise<void>): Promise<BindingRedemption | null>;
|
|
29
19
|
bindUser(openId: string, deviceId: string, deviceName: string): Promise<void>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
private bindUserLocked;
|
|
21
|
+
/** Detect conflicting records rather than silently choosing or repairing an owner. */
|
|
22
|
+
private assertOwnership;
|
|
33
23
|
getUserBinding(openId: string): Promise<UserBinding | null>;
|
|
34
24
|
listBoundUserIds(): Promise<string[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Get all devices for a user
|
|
37
|
-
*/
|
|
38
25
|
getUserDevices(openId: string): Promise<DeviceBinding[]>;
|
|
39
|
-
/**
|
|
40
|
-
* Get the active device for a user
|
|
41
|
-
*/
|
|
42
26
|
getActiveDevice(openId: string): Promise<DeviceBinding | null>;
|
|
43
|
-
/**
|
|
44
|
-
* Switch the active device for a user
|
|
45
|
-
* @returns true if switch was successful
|
|
46
|
-
*/
|
|
47
27
|
switchActiveDevice(openId: string, deviceId: string): Promise<boolean>;
|
|
48
|
-
|
|
49
|
-
* Unbind a specific device from a user
|
|
50
|
-
* If the active device is removed, promotes the first remaining device.
|
|
51
|
-
* If no devices remain, removes the entire user binding.
|
|
52
|
-
* @returns true if device was found and removed
|
|
53
|
-
*/
|
|
54
|
-
unbindDevice(openId: string, deviceId: string): Promise<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Get device binding information via reverse lookup
|
|
57
|
-
*/
|
|
28
|
+
unbindDevice(openId: string, deviceId: string, beforeUnbind?: (deviceId: string) => Promise<void>): Promise<boolean>;
|
|
58
29
|
getDeviceBinding(deviceId: string): Promise<UserBinding | null>;
|
|
59
|
-
|
|
60
|
-
* Unbind all devices for a user
|
|
61
|
-
*/
|
|
62
|
-
unbindUser(openId: string): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Update user last active time
|
|
65
|
-
*/
|
|
30
|
+
unbindUser(openId: string, beforeUnbind?: (deviceId: string) => Promise<void>): Promise<void>;
|
|
66
31
|
updateLastActive(openId: string): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Generate random binding code (format: XXX-XXX-XXX)
|
|
69
|
-
*/
|
|
70
32
|
private generateRandomCode;
|
|
71
|
-
/**
|
|
72
|
-
* Close and flush data
|
|
73
|
-
*/
|
|
74
33
|
close(): Promise<void>;
|
|
75
34
|
}
|
|
76
35
|
//# sourceMappingURL=BindingManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingManager.d.ts","sourceRoot":"","sources":["../../src/binding/BindingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"BindingManager.d.ts","sourceRoot":"","sources":["../../src/binding/BindingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qFAAqF;AACrF,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO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AAE,MAAM,EACjD,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAuBjE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAK/D,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAU7F,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,OAAO,CAAC,kBAAkB;IAWpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
|
@@ -2,224 +2,193 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BindingManager = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
-
/**
|
|
6
|
-
* Binding Manager
|
|
7
|
-
* Responsible for managing user and device binding relationships
|
|
8
|
-
* Supports multiple devices per user with one active device
|
|
9
|
-
*/
|
|
5
|
+
/** Serializes ownership mutations sharing one JsonStore, including key callbacks. */
|
|
10
6
|
class BindingManager {
|
|
11
7
|
store;
|
|
8
|
+
mutationTail = Promise.resolve();
|
|
12
9
|
constructor(store) {
|
|
13
10
|
this.store = store;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
12
|
+
mutate(operation) {
|
|
13
|
+
const result = this.mutationTail.then(operation);
|
|
14
|
+
this.mutationTail = result.then(() => undefined, () => undefined);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
21
17
|
async generateBindingCode(deviceId, deviceName, devicePublicKey) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Verify binding code
|
|
38
|
-
* @param code Binding code
|
|
39
|
-
* @returns Binding code object, returns null if invalid or expired
|
|
40
|
-
*/
|
|
18
|
+
return this.mutate(async () => {
|
|
19
|
+
const code = this.generateRandomCode();
|
|
20
|
+
const now = Date.now();
|
|
21
|
+
const bindingCode = {
|
|
22
|
+
code,
|
|
23
|
+
deviceId,
|
|
24
|
+
...(devicePublicKey ? { devicePublicKey } : {}),
|
|
25
|
+
createdAt: now,
|
|
26
|
+
expiresAt: now + 5 * 60 * 1000,
|
|
27
|
+
};
|
|
28
|
+
await this.store.setBindingCode(code, bindingCode);
|
|
29
|
+
return bindingCode;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
41
32
|
async verifyBindingCode(code) {
|
|
42
33
|
return this.store.getBindingCode(code);
|
|
43
34
|
}
|
|
44
35
|
async consumeBindingCode(code) {
|
|
45
|
-
|
|
36
|
+
return this.mutate(() => this.store.deleteBindingCode(code));
|
|
37
|
+
}
|
|
38
|
+
/** Validate, assign, enroll, and consume without admitting competing mutations. */
|
|
39
|
+
async redeemBindingCode(openId, code, deviceName, approveDeviceKey) {
|
|
40
|
+
return this.mutate(async () => {
|
|
41
|
+
const bindingCode = this.store.getBindingCode(code);
|
|
42
|
+
if (!bindingCode)
|
|
43
|
+
return null;
|
|
44
|
+
if (bindingCode.devicePublicKey && !approveDeviceKey)
|
|
45
|
+
throw new Error('Secure device enrollment is unavailable.');
|
|
46
|
+
this.assertOwnership(bindingCode.deviceId, openId);
|
|
47
|
+
const existingDevices = this.store.getUserBinding(openId)?.devices ?? [];
|
|
48
|
+
const alreadyBound = existingDevices.some(device => device.deviceId === bindingCode.deviceId);
|
|
49
|
+
if (alreadyBound && !bindingCode.devicePublicKey) {
|
|
50
|
+
return { bindingCode, alreadyBound, isFirstDevice: existingDevices.length === 0 };
|
|
51
|
+
}
|
|
52
|
+
await this.bindUserLocked(openId, bindingCode.deviceId, deviceName);
|
|
53
|
+
if (bindingCode.devicePublicKey) {
|
|
54
|
+
await approveDeviceKey(openId, bindingCode.deviceId, bindingCode.devicePublicKey);
|
|
55
|
+
}
|
|
56
|
+
await this.store.deleteBindingCode(code);
|
|
57
|
+
return { bindingCode, alreadyBound, isFirstDevice: existingDevices.length === 0 };
|
|
58
|
+
});
|
|
46
59
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Bind user and device (supports multi-device)
|
|
49
|
-
* First device becomes active; subsequent devices are added as inactive.
|
|
50
|
-
*/
|
|
51
60
|
async bindUser(openId, deviceId, deviceName) {
|
|
61
|
+
return this.mutate(() => this.bindUserLocked(openId, deviceId, deviceName));
|
|
62
|
+
}
|
|
63
|
+
async bindUserLocked(openId, deviceId, deviceName) {
|
|
64
|
+
this.assertOwnership(deviceId, openId);
|
|
52
65
|
const now = Date.now();
|
|
53
|
-
|
|
54
|
-
// This prevents cross-user data leakage and routing confusion
|
|
55
|
-
const existingOwner = this.store.getUserByDeviceId(deviceId);
|
|
56
|
-
if (existingOwner && existingOwner !== openId) {
|
|
57
|
-
throw new Error(`Device ${deviceId} is already bound to another user. ` +
|
|
58
|
-
`Please unbind it first or use a different device ID.`);
|
|
59
|
-
}
|
|
60
|
-
const existingBinding = await this.getUserBinding(openId);
|
|
66
|
+
const existingBinding = this.store.getUserBinding(openId);
|
|
61
67
|
if (existingBinding) {
|
|
62
|
-
|
|
63
|
-
const deviceIndex = existingBinding.devices.findIndex(d => d.deviceId === deviceId);
|
|
68
|
+
const deviceIndex = existingBinding.devices.findIndex(device => device.deviceId === deviceId);
|
|
64
69
|
if (deviceIndex >= 0) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
existingBinding.devices[deviceIndex] = {
|
|
71
|
+
...existingBinding.devices[deviceIndex], deviceName, lastActiveAt: now,
|
|
72
|
+
};
|
|
68
73
|
}
|
|
69
74
|
else {
|
|
70
|
-
|
|
71
|
-
existingBinding.devices.push({
|
|
72
|
-
deviceId,
|
|
73
|
-
deviceName,
|
|
74
|
-
boundAt: now,
|
|
75
|
-
lastActiveAt: now,
|
|
76
|
-
isActive: false,
|
|
77
|
-
});
|
|
75
|
+
existingBinding.devices.push({ deviceId, deviceName, boundAt: now, lastActiveAt: now, isActive: false });
|
|
78
76
|
}
|
|
79
77
|
existingBinding.updatedAt = now;
|
|
80
78
|
await this.store.setUserBinding(openId, existingBinding);
|
|
81
79
|
}
|
|
82
80
|
else {
|
|
83
|
-
// First device for this user - set as active
|
|
84
81
|
const binding = {
|
|
85
82
|
openId,
|
|
86
|
-
devices: [{
|
|
87
|
-
deviceId,
|
|
88
|
-
deviceName,
|
|
89
|
-
boundAt: now,
|
|
90
|
-
lastActiveAt: now,
|
|
91
|
-
isActive: true,
|
|
92
|
-
}],
|
|
83
|
+
devices: [{ deviceId, deviceName, boundAt: now, lastActiveAt: now, isActive: true }],
|
|
93
84
|
activeDeviceId: deviceId,
|
|
94
85
|
createdAt: now,
|
|
95
86
|
updatedAt: now,
|
|
96
87
|
};
|
|
97
88
|
await this.store.setUserBinding(openId, binding);
|
|
98
89
|
}
|
|
99
|
-
// Update device-to-user reverse mapping to ensure consistency
|
|
100
90
|
await this.store.setDeviceToUserMap(deviceId, openId);
|
|
101
91
|
}
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
92
|
+
/** Detect conflicting records rather than silently choosing or repairing an owner. */
|
|
93
|
+
assertOwnership(deviceId, openId) {
|
|
94
|
+
const owners = [];
|
|
95
|
+
for (const candidate of this.store.listBoundUserIds()) {
|
|
96
|
+
if (this.store.getUserBinding(candidate)?.devices.some(device => device.deviceId === deviceId))
|
|
97
|
+
owners.push(candidate);
|
|
98
|
+
}
|
|
99
|
+
const mapped = this.store.getUserByDeviceId(deviceId);
|
|
100
|
+
const ambiguous = owners.length > 1 || Boolean(mapped && owners.length > 0 && !owners.includes(mapped));
|
|
101
|
+
if (ambiguous) {
|
|
102
|
+
throw new Error(`Device ${deviceId} has ambiguous historical ownership. Repair the binding records manually before changing them.`);
|
|
103
|
+
}
|
|
104
|
+
const owner = mapped ?? owners[0];
|
|
105
|
+
if (owner && owner !== openId) {
|
|
106
|
+
throw new Error(`Device ${deviceId} is already bound to another user. Please unbind it first or use a different device ID.`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
105
109
|
async getUserBinding(openId) {
|
|
106
110
|
return this.store.getUserBinding(openId);
|
|
107
111
|
}
|
|
108
112
|
async listBoundUserIds() {
|
|
109
113
|
return this.store.listBoundUserIds();
|
|
110
114
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Get all devices for a user
|
|
113
|
-
*/
|
|
114
115
|
async getUserDevices(openId) {
|
|
115
|
-
|
|
116
|
-
return binding?.devices || [];
|
|
116
|
+
return this.store.getUserBinding(openId)?.devices ?? [];
|
|
117
117
|
}
|
|
118
|
-
/**
|
|
119
|
-
* Get the active device for a user
|
|
120
|
-
*/
|
|
121
118
|
async getActiveDevice(openId) {
|
|
122
119
|
const binding = this.store.getUserBinding(openId);
|
|
123
|
-
if (!binding
|
|
120
|
+
if (!binding?.activeDeviceId)
|
|
124
121
|
return null;
|
|
125
|
-
|
|
126
|
-
return binding.devices.find(d => d.deviceId === binding.activeDeviceId) || null;
|
|
122
|
+
return binding.devices.find(device => device.deviceId === binding.activeDeviceId) ?? null;
|
|
127
123
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Switch the active device for a user
|
|
130
|
-
* @returns true if switch was successful
|
|
131
|
-
*/
|
|
132
124
|
async switchActiveDevice(openId, deviceId) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// Update isActive flags
|
|
142
|
-
for (const device of binding.devices) {
|
|
143
|
-
device.isActive = device.deviceId === deviceId;
|
|
144
|
-
}
|
|
145
|
-
binding.activeDeviceId = deviceId;
|
|
146
|
-
binding.updatedAt = Date.now();
|
|
147
|
-
await this.store.setUserBinding(openId, binding);
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Unbind a specific device from a user
|
|
152
|
-
* If the active device is removed, promotes the first remaining device.
|
|
153
|
-
* If no devices remain, removes the entire user binding.
|
|
154
|
-
* @returns true if device was found and removed
|
|
155
|
-
*/
|
|
156
|
-
async unbindDevice(openId, deviceId) {
|
|
157
|
-
const binding = this.store.getUserBinding(openId);
|
|
158
|
-
if (!binding) {
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
const deviceIndex = binding.devices.findIndex(d => d.deviceId === deviceId);
|
|
162
|
-
if (deviceIndex < 0) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
// Remove device
|
|
166
|
-
binding.devices.splice(deviceIndex, 1);
|
|
167
|
-
await this.store.removeDeviceToUserMap(deviceId);
|
|
168
|
-
if (binding.devices.length === 0) {
|
|
169
|
-
// No devices left, delete the entire binding
|
|
170
|
-
await this.store.deleteUserBinding(openId);
|
|
125
|
+
return this.mutate(async () => {
|
|
126
|
+
const binding = this.store.getUserBinding(openId);
|
|
127
|
+
if (!binding?.devices.some(device => device.deviceId === deviceId))
|
|
128
|
+
return false;
|
|
129
|
+
binding.devices = binding.devices.map(device => ({ ...device, isActive: device.deviceId === deviceId }));
|
|
130
|
+
binding.activeDeviceId = deviceId;
|
|
131
|
+
binding.updatedAt = Date.now();
|
|
132
|
+
await this.store.setUserBinding(openId, binding);
|
|
171
133
|
return true;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
binding
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async unbindDevice(openId, deviceId, beforeUnbind) {
|
|
137
|
+
return this.mutate(async () => {
|
|
138
|
+
const binding = this.store.getUserBinding(openId);
|
|
139
|
+
const deviceIndex = binding?.devices.findIndex(device => device.deviceId === deviceId) ?? -1;
|
|
140
|
+
if (!binding || deviceIndex < 0)
|
|
141
|
+
return false;
|
|
142
|
+
this.assertOwnership(deviceId, openId);
|
|
143
|
+
await beforeUnbind?.(deviceId);
|
|
144
|
+
binding.devices.splice(deviceIndex, 1);
|
|
145
|
+
await this.store.removeDeviceToUserMap(deviceId);
|
|
146
|
+
if (binding.devices.length === 0) {
|
|
147
|
+
await this.store.deleteUserBinding(openId);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
if (binding.activeDeviceId === deviceId) {
|
|
151
|
+
binding.devices[0] = { ...binding.devices[0], isActive: true };
|
|
152
|
+
binding.activeDeviceId = binding.devices[0].deviceId;
|
|
153
|
+
}
|
|
154
|
+
binding.updatedAt = Date.now();
|
|
155
|
+
await this.store.setUserBinding(openId, binding);
|
|
156
|
+
return true;
|
|
157
|
+
});
|
|
181
158
|
}
|
|
182
|
-
/**
|
|
183
|
-
* Get device binding information via reverse lookup
|
|
184
|
-
*/
|
|
185
159
|
async getDeviceBinding(deviceId) {
|
|
186
160
|
const openId = this.store.getUserByDeviceId(deviceId);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return this.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
161
|
+
return openId ? this.store.getUserBinding(openId) : null;
|
|
162
|
+
}
|
|
163
|
+
async unbindUser(openId, beforeUnbind) {
|
|
164
|
+
return this.mutate(async () => {
|
|
165
|
+
const binding = this.store.getUserBinding(openId);
|
|
166
|
+
if (!binding)
|
|
167
|
+
return;
|
|
168
|
+
for (const device of binding.devices)
|
|
169
|
+
this.assertOwnership(device.deviceId, openId);
|
|
170
|
+
if (beforeUnbind)
|
|
171
|
+
for (const device of binding.devices)
|
|
172
|
+
await beforeUnbind(device.deviceId);
|
|
173
|
+
await this.store.deleteUserBinding(openId);
|
|
174
|
+
});
|
|
197
175
|
}
|
|
198
|
-
/**
|
|
199
|
-
* Update user last active time
|
|
200
|
-
*/
|
|
201
176
|
async updateLastActive(openId) {
|
|
202
|
-
|
|
177
|
+
return this.mutate(() => this.store.updateLastActive(openId));
|
|
203
178
|
}
|
|
204
|
-
/**
|
|
205
|
-
* Generate random binding code (format: XXX-XXX-XXX)
|
|
206
|
-
*/
|
|
207
179
|
generateRandomCode() {
|
|
208
180
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
209
181
|
const segments = [];
|
|
210
182
|
for (let i = 0; i < 3; i++) {
|
|
211
183
|
let segment = '';
|
|
212
|
-
for (let j = 0; j < 3; j++)
|
|
184
|
+
for (let j = 0; j < 3; j++)
|
|
213
185
|
segment += chars.charAt((0, crypto_1.randomInt)(chars.length));
|
|
214
|
-
}
|
|
215
186
|
segments.push(segment);
|
|
216
187
|
}
|
|
217
188
|
return segments.join('-');
|
|
218
189
|
}
|
|
219
|
-
/**
|
|
220
|
-
* Close and flush data
|
|
221
|
-
*/
|
|
222
190
|
async close() {
|
|
191
|
+
await this.mutationTail;
|
|
223
192
|
await this.store.flush();
|
|
224
193
|
}
|
|
225
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingManager.js","sourceRoot":"","sources":["../../src/binding/BindingManager.ts"],"names":[],"mappings":";;;AAEA,mCAAmC;
|
|
1
|
+
{"version":3,"file":"BindingManager.js","sourceRoot":"","sources":["../../src/binding/BindingManager.ts"],"names":[],"mappings":";;;AAEA,mCAAmC;AAQnC,qFAAqF;AACrF,MAAa,cAAc;IACjB,KAAK,CAAY;IACjB,YAAY,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAExD,YAAY,KAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEO,MAAM,CAAI,SAA2B;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,YAA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BAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,kBAAkB;QACxB,MAAM,KAAK,GAAG,sCAAsC,CAAC;QACrD,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAAE,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,IAAA,kBAAS,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAC7E,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,YAAY,CAAC;QACxB,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF;AAtMD,wCAsMC"}
|
package/dist/commands/start.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAQA,mFAAmF;AACnF,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CA8HlD"}
|