@honor-claw/yoyo 1.2.0-beta.5 → 1.2.0-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honor-claw/yoyo",
3
- "version": "1.2.0-beta.5",
3
+ "version": "1.2.0-beta.7",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",
@@ -361,20 +361,16 @@ export class MessageHandler {
361
361
 
362
362
  // 收到NOT_PAIRED错误时,自动获取待配对设备并审批
363
363
  if (!gatewayRawData.ok && gatewayRawData.error?.code === "NOT_PAIRED") {
364
- try {
365
- await this.handleAutoPair();
366
- cloudData = JSON.stringify({
367
- ok: true,
368
- type: "res",
369
- id: gatewayRawData.id,
370
- payload: {
371
- type: "hello-ok",
372
- },
373
- });
374
- useClawLogger().info(`${LOG_PREFIX} auto pair succeefully`);
375
- } catch (error) {
376
- useClawLogger().error(`${LOG_PREFIX} auto pair failed: ${String(error)}`);
377
- }
364
+ await this.handleAutoPair();
365
+ cloudData = JSON.stringify({
366
+ ok: true,
367
+ type: "res",
368
+ id: gatewayRawData.id,
369
+ payload: { type: "hello-ok" },
370
+ });
371
+ useClawLogger().info(
372
+ `${LOG_PREFIX} auto pairing is completed, ${JSON.stringify(cloudData)}`,
373
+ );
378
374
  }
379
375
 
380
376
  useClawLogger().debug?.(
@@ -416,7 +412,11 @@ export class MessageHandler {
416
412
  useClawLogger().info(
417
413
  `${LOG_PREFIX} auto approving device: ${device.deviceId}, requestId: ${device.requestId}`,
418
414
  );
419
- await adminClient.devicePairApprove(device.requestId);
415
+ try {
416
+ await adminClient.devicePairApprove(device.requestId);
417
+ } catch (error) {
418
+ useClawLogger().error(`${LOG_PREFIX} auto pair failed: ${String(error)}, ignore...`);
419
+ }
420
420
  }
421
421
 
422
422
  if (pendingDevices.length === 0) {
@@ -16,7 +16,14 @@ export interface AdminGatewayClientOptions extends ProtocolClientOptions {}
16
16
 
17
17
  const ADMIN_CONFIG = {
18
18
  role: "operator",
19
- scopes: ["operator.admin"],
19
+ scopes: [
20
+ "operator.admin",
21
+ "operator.read",
22
+ "operator.write",
23
+ "operator.talk.secrets",
24
+ "operator.approvals",
25
+ "operator.pairing",
26
+ ],
20
27
  clientId: GATEWAY_CLIENT_IDS.CLI,
21
28
  displayName: "YOYO-Control",
22
29
  clientMode: GATEWAY_CLIENT_MODES.BACKEND,