@lingyao037/openclaw-lingyao-cli 0.9.4 → 0.9.5

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.
@@ -0,0 +1,39 @@
1
+ import { h as LingyaoAccountConfig } from './types-Zbv12l39.js';
2
+
3
+ /**
4
+ * Config Adapter - Account resolution, config validation
5
+ *
6
+ * serverUrl is NOT exposed to users — hardcoded as LINGYAO_SERVER_URL.
7
+ */
8
+
9
+ type LingyaoDmPolicy = 'pairing' | 'allowlist' | 'open';
10
+ /**
11
+ * Resolved account after config resolution.
12
+ */
13
+ interface ResolvedAccount {
14
+ readonly id: string;
15
+ readonly accountId?: string | null;
16
+ readonly enabled: boolean;
17
+ readonly dmPolicy: LingyaoDmPolicy;
18
+ readonly allowFrom: string[];
19
+ readonly gatewayId?: string;
20
+ readonly rawConfig: LingyaoAccountConfig;
21
+ }
22
+
23
+ /**
24
+ * Probe result structure.
25
+ */
26
+ interface LingyaoProbeResult {
27
+ ok: boolean;
28
+ status: 'healthy' | 'degraded' | 'unhealthy';
29
+ wsConnected: boolean;
30
+ uptime?: number;
31
+ checks?: Record<string, {
32
+ passed: boolean;
33
+ message: string;
34
+ duration?: number;
35
+ }>;
36
+ error?: string;
37
+ }
38
+
39
+ export type { LingyaoProbeResult as L, ResolvedAccount as R };
@@ -175,7 +175,7 @@ interface NotifyRequest {
175
175
  */
176
176
  interface LingyaoAccountConfig {
177
177
  enabled?: boolean;
178
- dmPolicy?: "paired" | "open" | "deny";
178
+ dmPolicy?: "pairing" | "allowlist" | "open";
179
179
  allowFrom?: string[];
180
180
  maxOfflineMessages?: number;
181
181
  tokenExpiryDays?: number;
@@ -188,7 +188,7 @@ interface LingyaoConfig {
188
188
  enabled: boolean;
189
189
  maxOfflineMessages?: number;
190
190
  tokenExpiryDays?: number;
191
- dmPolicy?: "paired" | "open" | "deny";
191
+ dmPolicy?: "pairing" | "allowlist" | "open";
192
192
  allowFrom?: string[];
193
193
  accounts?: Record<string, LingyaoAccountConfig>;
194
194
  }
@@ -252,81 +252,4 @@ interface HealthStatus {
252
252
  lastError?: string;
253
253
  }
254
254
 
255
- /**
256
- * Account storage and management
257
- */
258
- declare class AccountManager {
259
- private runtime;
260
- private accounts;
261
- private pendingPairings;
262
- constructor(runtime: LingyaoRuntime);
263
- /**
264
- * Initialize account manager from storage
265
- */
266
- initialize(): Promise<void>;
267
- /**
268
- * Get account by device ID
269
- */
270
- getAccount(deviceId: string): LingyaoAccount | undefined;
271
- /**
272
- * Get account by device token
273
- */
274
- getAccountByToken(token: string): LingyaoAccount | undefined;
275
- /**
276
- * Get all active accounts
277
- */
278
- getActiveAccounts(): LingyaoAccount[];
279
- /**
280
- * Create a new pairing session
281
- */
282
- createPairingSession(code: string, expiresAt: number): Promise<void>;
283
- /**
284
- * Get pairing session by code
285
- */
286
- getPairingSession(code: string): PairingSession | undefined;
287
- /**
288
- * Remove a pending pairing (e.g. expired or cancelled)
289
- */
290
- deletePendingPairing(code: string): Promise<void>;
291
- /**
292
- * Confirm pairing and create account
293
- */
294
- confirmPairing(pairingCode: string, deviceToken: DeviceToken, deviceInfo: DeviceInfo): Promise<LingyaoAccount | null>;
295
- /**
296
- * Update account's last seen timestamp
297
- */
298
- updateLastSeen(deviceId: string): Promise<void>;
299
- /**
300
- * Revoke an account
301
- */
302
- revokeAccount(deviceId: string): Promise<boolean>;
303
- /**
304
- * Manually add a device by deviceId (user-initiated pairing).
305
- * No pairing code or deviceToken required — the user explicitly
306
- * trusts this device from the OpenClaw CLI.
307
- */
308
- addDevice(deviceId: string, deviceInfo: DeviceInfo): Promise<LingyaoAccount>;
309
- /**
310
- * Refresh device token
311
- */
312
- refreshDeviceToken(deviceId: string, newToken: DeviceToken): Promise<boolean>;
313
- /**
314
- * Clean up expired accounts
315
- */
316
- cleanupExpired(): Promise<void>;
317
- /**
318
- * Save accounts to storage
319
- */
320
- private saveAccounts;
321
- /**
322
- * Save pending pairings to storage
323
- */
324
- private savePendingPairings;
325
- }
326
- interface PairingSession {
327
- code: string;
328
- createdAt: number;
329
- expiresAt: number;
330
- }
331
-
332
- export { AccountManager as A, type DeviceInfo as D, type FailedEntry as F, type HealthStatus as H, type LingyaoRuntime as L, type MemorySyncPayload as M, type NotifyPayload as N, type PairingCode as P, type QueuedMessage as Q, type SyncRequest as S, type TokenRefreshRequest as T, type WebSocketConnection as W, type LingyaoAccountConfig as a, type DeviceToken as b, type SyncResponse as c, type LingyaoMessage as d, type LingyaoConfig as e, type AckRequest as f, type DiarySyncPayload as g, LINGYAO_SERVER_URL as h, type LingyaoAccount as i, MessageType as j, type NotifyAction as k, type NotifyRequest as l, type PairingConfirmRequest as m, type PairingConfirmResponse as n, type PollRequest as o, type PollResponse as p, type TokenRefreshResponse as q };
255
+ export { type AckRequest as A, type DeviceInfo as D, type FailedEntry as F, type HealthStatus as H, type LingyaoRuntime as L, type MemorySyncPayload as M, type NotifyPayload as N, type PairingCode as P, type QueuedMessage as Q, type SyncRequest as S, type TokenRefreshRequest as T, type WebSocketConnection as W, type SyncResponse as a, type LingyaoMessage as b, type DeviceToken as c, type LingyaoConfig as d, type DiarySyncPayload as e, LINGYAO_SERVER_URL as f, type LingyaoAccount as g, type LingyaoAccountConfig as h, MessageType as i, type NotifyAction as j, type NotifyRequest as k, type PairingConfirmRequest as l, type PairingConfirmResponse as m, type PollRequest as n, type PollResponse as o, type TokenRefreshResponse as p };
@@ -15,14 +15,17 @@
15
15
  },
16
16
  "dmPolicy": {
17
17
  "type": "string",
18
- "enum": ["paired", "open", "deny"],
19
- "default": "paired"
18
+ "enum": ["pairing", "allowlist", "open"],
19
+ "default": "pairing"
20
20
  },
21
21
  "allowFrom": {
22
22
  "type": "array",
23
23
  "items": { "type": "string" },
24
24
  "default": []
25
25
  },
26
+ "defaultAccount": {
27
+ "type": "string"
28
+ },
26
29
  "accounts": {
27
30
  "type": "object",
28
31
  "additionalProperties": {
@@ -31,7 +34,7 @@
31
34
  "enabled": { "type": "boolean", "default": true },
32
35
  "dmPolicy": {
33
36
  "type": "string",
34
- "enum": ["paired", "open", "deny"]
37
+ "enum": ["pairing", "allowlist", "open"]
35
38
  },
36
39
  "allowFrom": {
37
40
  "type": "array",
@@ -46,6 +49,9 @@
46
49
  "type": "integer",
47
50
  "minimum": 1,
48
51
  "maximum": 365
52
+ },
53
+ "gatewayId": {
54
+ "type": "string"
49
55
  }
50
56
  }
51
57
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingyao037/openclaw-lingyao-cli",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "Lingyao Channel Plugin for OpenClaw - bidirectional sync via lingyao.live server relay",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -10,6 +10,14 @@
10
10
  "./dist/index.js"
11
11
  ],
12
12
  "setupEntry": "./dist/setup-entry.js",
13
+ "compat": {
14
+ "pluginApi": ">=2026.3.24",
15
+ "minGatewayVersion": "2026.3.24"
16
+ },
17
+ "build": {
18
+ "openclawVersion": "2026.3.24",
19
+ "pluginSdkVersion": "2026.3.24"
20
+ },
13
21
  "channel": {
14
22
  "id": "lingyao",
15
23
  "label": "Lingyao",