@lingyao037/openclaw-lingyao-cli 0.9.7 → 1.0.0
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/dist/cli.d.ts +78 -2
- package/dist/index.d.ts +4 -974
- package/dist/index.js +49 -1006
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.d.ts +2 -2
- package/dist/setup-entry.js +22 -49
- package/dist/setup-entry.js.map +1 -1
- package/dist/{status-CVwSoPKi.d.ts → status-CS7AsRlS.d.ts} +1 -1
- package/dist/{types-LFC6Wpqo.d.ts → types-BZMU9mea.d.ts} +8 -1
- package/openclaw.plugin.json +13 -1
- package/package.json +1 -1
- package/dist/accounts-BykE02r0.d.ts +0 -80
package/dist/setup-entry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as openclaw_plugin_sdk from 'openclaw/plugin-sdk';
|
|
2
|
-
import { R as ResolvedAccount, L as LingyaoProbeResult } from './status-
|
|
3
|
-
import './types-
|
|
2
|
+
import { R as ResolvedAccount, L as LingyaoProbeResult } from './status-CS7AsRlS.js';
|
|
3
|
+
import './types-BZMU9mea.js';
|
|
4
4
|
|
|
5
5
|
declare const _default: {
|
|
6
6
|
plugin: openclaw_plugin_sdk.ChannelPlugin<ResolvedAccount, LingyaoProbeResult>;
|
package/dist/setup-entry.js
CHANGED
|
@@ -36,7 +36,8 @@ function extractAccounts(cfg) {
|
|
|
36
36
|
allowFrom: Array.isArray(lingyao.allowFrom) ? lingyao.allowFrom : [],
|
|
37
37
|
maxOfflineMessages: lingyao.maxOfflineMessages,
|
|
38
38
|
tokenExpiryDays: lingyao.tokenExpiryDays,
|
|
39
|
-
gatewayId: lingyao.gatewayId
|
|
39
|
+
gatewayId: lingyao.gatewayId,
|
|
40
|
+
websocketHeartbeatIntervalMs: lingyao.websocketHeartbeatIntervalMs
|
|
40
41
|
};
|
|
41
42
|
if (!accounts || Object.keys(accounts).length === 0) {
|
|
42
43
|
return { default: baseConfig };
|
|
@@ -268,6 +269,12 @@ function createMessagingAdapter() {
|
|
|
268
269
|
resolveSessionTarget(params) {
|
|
269
270
|
return `${PREFIX}${params.id}`;
|
|
270
271
|
},
|
|
272
|
+
resolveSessionConversation(params) {
|
|
273
|
+
return {
|
|
274
|
+
id: params.rawId,
|
|
275
|
+
baseConversationId: params.rawId
|
|
276
|
+
};
|
|
277
|
+
},
|
|
271
278
|
inferTargetChatType(_params) {
|
|
272
279
|
return "direct";
|
|
273
280
|
}
|
|
@@ -381,31 +388,6 @@ function getMachineId() {
|
|
|
381
388
|
}
|
|
382
389
|
var MACHINE_ID = getMachineId();
|
|
383
390
|
|
|
384
|
-
// src/channel.ts
|
|
385
|
-
import { createHash as createHash2 } from "crypto";
|
|
386
|
-
import { hostname as hostname2, networkInterfaces as networkInterfaces2 } from "os";
|
|
387
|
-
function getMachineId2() {
|
|
388
|
-
try {
|
|
389
|
-
const interfaces = networkInterfaces2();
|
|
390
|
-
let macStr = "";
|
|
391
|
-
for (const name of Object.keys(interfaces)) {
|
|
392
|
-
const iface = interfaces[name];
|
|
393
|
-
if (!iface) continue;
|
|
394
|
-
for (const alias of iface) {
|
|
395
|
-
if (!alias.internal && alias.mac && alias.mac !== "00:00:00:00:00:00") {
|
|
396
|
-
macStr += alias.mac;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
if (macStr) {
|
|
401
|
-
return createHash2("md5").update(macStr).digest("hex").substring(0, 8);
|
|
402
|
-
}
|
|
403
|
-
} catch (e) {
|
|
404
|
-
}
|
|
405
|
-
return Math.random().toString(36).substring(2, 10);
|
|
406
|
-
}
|
|
407
|
-
var MACHINE_ID2 = getMachineId2();
|
|
408
|
-
|
|
409
391
|
// src/config-schema.ts
|
|
410
392
|
import { z } from "zod";
|
|
411
393
|
var lingyaoDmPolicySchema = z.enum(["pairing", "allowlist", "open"]);
|
|
@@ -416,7 +398,8 @@ var lingyaoAccountConfigSchema = z.object({
|
|
|
416
398
|
allowFrom: allowFromSchema,
|
|
417
399
|
maxOfflineMessages: z.number().int().min(1).max(1e3).optional(),
|
|
418
400
|
tokenExpiryDays: z.number().int().min(1).max(365).optional(),
|
|
419
|
-
gatewayId: z.string().min(1).optional()
|
|
401
|
+
gatewayId: z.string().min(1).optional(),
|
|
402
|
+
websocketHeartbeatIntervalMs: z.number().int().min(5e3).max(12e4).optional()
|
|
420
403
|
});
|
|
421
404
|
var lingyaoConfigSchema = z.object({
|
|
422
405
|
enabled: z.boolean().default(true),
|
|
@@ -424,6 +407,7 @@ var lingyaoConfigSchema = z.object({
|
|
|
424
407
|
allowFrom: allowFromSchema.default([]),
|
|
425
408
|
maxOfflineMessages: z.number().int().min(1).max(1e3).optional().default(100),
|
|
426
409
|
tokenExpiryDays: z.number().int().min(1).max(365).optional().default(30),
|
|
410
|
+
websocketHeartbeatIntervalMs: z.number().int().min(5e3).max(12e4).optional(),
|
|
427
411
|
defaultAccount: z.string().min(1).optional(),
|
|
428
412
|
accounts: z.record(lingyaoAccountConfigSchema).optional()
|
|
429
413
|
});
|
|
@@ -461,6 +445,12 @@ var lingyaoChannelConfigSchema = {
|
|
|
461
445
|
defaultAccount: {
|
|
462
446
|
type: "string"
|
|
463
447
|
},
|
|
448
|
+
websocketHeartbeatIntervalMs: {
|
|
449
|
+
type: "integer",
|
|
450
|
+
minimum: 5e3,
|
|
451
|
+
maximum: 12e4,
|
|
452
|
+
description: "WebSocket gateway_heartbeat interval in ms (default: server register response). Use 5000\u201355000 for typical relay timeout."
|
|
453
|
+
},
|
|
464
454
|
accounts: {
|
|
465
455
|
type: "object",
|
|
466
456
|
additionalProperties: {
|
|
@@ -490,6 +480,11 @@ var lingyaoChannelConfigSchema = {
|
|
|
490
480
|
},
|
|
491
481
|
gatewayId: {
|
|
492
482
|
type: "string"
|
|
483
|
+
},
|
|
484
|
+
websocketHeartbeatIntervalMs: {
|
|
485
|
+
type: "integer",
|
|
486
|
+
minimum: 5e3,
|
|
487
|
+
maximum: 12e4
|
|
493
488
|
}
|
|
494
489
|
}
|
|
495
490
|
},
|
|
@@ -498,15 +493,6 @@ var lingyaoChannelConfigSchema = {
|
|
|
498
493
|
}
|
|
499
494
|
}
|
|
500
495
|
};
|
|
501
|
-
function getDefaultConfig() {
|
|
502
|
-
return {
|
|
503
|
-
enabled: true,
|
|
504
|
-
dmPolicy: "pairing",
|
|
505
|
-
allowFrom: [],
|
|
506
|
-
maxOfflineMessages: 100,
|
|
507
|
-
tokenExpiryDays: 30
|
|
508
|
-
};
|
|
509
|
-
}
|
|
510
496
|
|
|
511
497
|
// src/api.ts
|
|
512
498
|
var orchestrator = null;
|
|
@@ -591,19 +577,6 @@ var lingyaoPlugin = {
|
|
|
591
577
|
directory: directoryAdapter,
|
|
592
578
|
messaging: messagingAdapter
|
|
593
579
|
};
|
|
594
|
-
var pluginMetadata = {
|
|
595
|
-
name: "lingyao",
|
|
596
|
-
version: "0.9.7",
|
|
597
|
-
description: "Lingyao Channel Plugin - bidirectional sync via lingyao.live server relay",
|
|
598
|
-
type: "channel",
|
|
599
|
-
capabilities: {
|
|
600
|
-
chatTypes: ["direct"],
|
|
601
|
-
media: false,
|
|
602
|
-
reactions: false,
|
|
603
|
-
threads: false
|
|
604
|
-
},
|
|
605
|
-
defaultConfig: getDefaultConfig()
|
|
606
|
-
};
|
|
607
580
|
|
|
608
581
|
// src/setup-entry.ts
|
|
609
582
|
var setup_entry_default = defineSetupPluginEntry(lingyaoPlugin);
|