@lingyao037/openclaw-lingyao-cli 0.9.8 → 1.1.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 -978
- package/dist/index.js +35 -1069
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.d.ts +2 -2
- package/dist/setup-entry.js +31 -106
- package/dist/setup-entry.js.map +1 -1
- package/dist/{status-BaZOYVZY.d.ts → status-CS7AsRlS.d.ts} +1 -1
- package/dist/{types-D3SmE-b0.d.ts → types-BZMU9mea.d.ts} +1 -1
- package/openclaw.plugin.json +2 -1
- package/package.json +1 -1
- package/dist/accounts-t-QtF58y.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
|
@@ -34,8 +34,6 @@ function extractAccounts(cfg) {
|
|
|
34
34
|
enabled: lingyao.enabled,
|
|
35
35
|
dmPolicy: normalizeDmPolicy(lingyao.dmPolicy),
|
|
36
36
|
allowFrom: Array.isArray(lingyao.allowFrom) ? lingyao.allowFrom : [],
|
|
37
|
-
maxOfflineMessages: lingyao.maxOfflineMessages,
|
|
38
|
-
tokenExpiryDays: lingyao.tokenExpiryDays,
|
|
39
37
|
gatewayId: lingyao.gatewayId,
|
|
40
38
|
websocketHeartbeatIntervalMs: lingyao.websocketHeartbeatIntervalMs
|
|
41
39
|
};
|
|
@@ -269,6 +267,12 @@ function createMessagingAdapter() {
|
|
|
269
267
|
resolveSessionTarget(params) {
|
|
270
268
|
return `${PREFIX}${params.id}`;
|
|
271
269
|
},
|
|
270
|
+
resolveSessionConversation(params) {
|
|
271
|
+
return {
|
|
272
|
+
id: params.rawId,
|
|
273
|
+
baseConversationId: params.rawId
|
|
274
|
+
};
|
|
275
|
+
},
|
|
272
276
|
inferTargetChatType(_params) {
|
|
273
277
|
return "direct";
|
|
274
278
|
}
|
|
@@ -363,18 +367,18 @@ import WebSocket from "ws";
|
|
|
363
367
|
function getMachineId() {
|
|
364
368
|
try {
|
|
365
369
|
const interfaces = networkInterfaces();
|
|
366
|
-
|
|
367
|
-
for (const
|
|
368
|
-
const iface = interfaces[name];
|
|
370
|
+
const macs = [];
|
|
371
|
+
for (const iface of Object.values(interfaces)) {
|
|
369
372
|
if (!iface) continue;
|
|
370
373
|
for (const alias of iface) {
|
|
371
374
|
if (!alias.internal && alias.mac && alias.mac !== "00:00:00:00:00:00") {
|
|
372
|
-
|
|
375
|
+
macs.push(alias.mac);
|
|
373
376
|
}
|
|
374
377
|
}
|
|
375
378
|
}
|
|
376
|
-
|
|
377
|
-
|
|
379
|
+
macs.sort();
|
|
380
|
+
if (macs.length > 0) {
|
|
381
|
+
return createHash("md5").update(macs.join("")).digest("hex").substring(0, 8);
|
|
378
382
|
}
|
|
379
383
|
} catch (e) {
|
|
380
384
|
}
|
|
@@ -382,31 +386,6 @@ function getMachineId() {
|
|
|
382
386
|
}
|
|
383
387
|
var MACHINE_ID = getMachineId();
|
|
384
388
|
|
|
385
|
-
// src/channel.ts
|
|
386
|
-
import { createHash as createHash2 } from "crypto";
|
|
387
|
-
import { hostname as hostname2, networkInterfaces as networkInterfaces2 } from "os";
|
|
388
|
-
function getMachineId2() {
|
|
389
|
-
try {
|
|
390
|
-
const interfaces = networkInterfaces2();
|
|
391
|
-
let macStr = "";
|
|
392
|
-
for (const name of Object.keys(interfaces)) {
|
|
393
|
-
const iface = interfaces[name];
|
|
394
|
-
if (!iface) continue;
|
|
395
|
-
for (const alias of iface) {
|
|
396
|
-
if (!alias.internal && alias.mac && alias.mac !== "00:00:00:00:00:00") {
|
|
397
|
-
macStr += alias.mac;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
if (macStr) {
|
|
402
|
-
return createHash2("md5").update(macStr).digest("hex").substring(0, 8);
|
|
403
|
-
}
|
|
404
|
-
} catch (e) {
|
|
405
|
-
}
|
|
406
|
-
return Math.random().toString(36).substring(2, 10);
|
|
407
|
-
}
|
|
408
|
-
var MACHINE_ID2 = getMachineId2();
|
|
409
|
-
|
|
410
389
|
// src/config-schema.ts
|
|
411
390
|
import { z } from "zod";
|
|
412
391
|
var lingyaoDmPolicySchema = z.enum(["pairing", "allowlist", "open"]);
|
|
@@ -415,17 +394,12 @@ var lingyaoAccountConfigSchema = z.object({
|
|
|
415
394
|
enabled: z.boolean().optional(),
|
|
416
395
|
dmPolicy: lingyaoDmPolicySchema.optional(),
|
|
417
396
|
allowFrom: allowFromSchema,
|
|
418
|
-
maxOfflineMessages: z.number().int().min(1).max(1e3).optional(),
|
|
419
|
-
tokenExpiryDays: z.number().int().min(1).max(365).optional(),
|
|
420
|
-
gatewayId: z.string().min(1).optional(),
|
|
421
397
|
websocketHeartbeatIntervalMs: z.number().int().min(5e3).max(12e4).optional()
|
|
422
398
|
});
|
|
423
399
|
var lingyaoConfigSchema = z.object({
|
|
424
400
|
enabled: z.boolean().default(true),
|
|
425
401
|
dmPolicy: lingyaoDmPolicySchema.optional().default("pairing"),
|
|
426
402
|
allowFrom: allowFromSchema.default([]),
|
|
427
|
-
maxOfflineMessages: z.number().int().min(1).max(1e3).optional().default(100),
|
|
428
|
-
tokenExpiryDays: z.number().int().min(1).max(365).optional().default(30),
|
|
429
403
|
websocketHeartbeatIntervalMs: z.number().int().min(5e3).max(12e4).optional(),
|
|
430
404
|
defaultAccount: z.string().min(1).optional(),
|
|
431
405
|
accounts: z.record(lingyaoAccountConfigSchema).optional()
|
|
@@ -433,7 +407,7 @@ var lingyaoConfigSchema = z.object({
|
|
|
433
407
|
var lingyaoChannelConfigSchema = {
|
|
434
408
|
schema: {
|
|
435
409
|
type: "object",
|
|
436
|
-
additionalProperties:
|
|
410
|
+
additionalProperties: false,
|
|
437
411
|
properties: {
|
|
438
412
|
enabled: {
|
|
439
413
|
type: "boolean",
|
|
@@ -449,18 +423,6 @@ var lingyaoChannelConfigSchema = {
|
|
|
449
423
|
items: { type: "string" },
|
|
450
424
|
default: []
|
|
451
425
|
},
|
|
452
|
-
maxOfflineMessages: {
|
|
453
|
-
type: "integer",
|
|
454
|
-
minimum: 1,
|
|
455
|
-
maximum: 1e3,
|
|
456
|
-
default: 100
|
|
457
|
-
},
|
|
458
|
-
tokenExpiryDays: {
|
|
459
|
-
type: "integer",
|
|
460
|
-
minimum: 1,
|
|
461
|
-
maximum: 365,
|
|
462
|
-
default: 30
|
|
463
|
-
},
|
|
464
426
|
defaultAccount: {
|
|
465
427
|
type: "string"
|
|
466
428
|
},
|
|
@@ -472,39 +434,24 @@ var lingyaoChannelConfigSchema = {
|
|
|
472
434
|
},
|
|
473
435
|
accounts: {
|
|
474
436
|
type: "object",
|
|
475
|
-
additionalProperties:
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
maximum: 1e3
|
|
494
|
-
},
|
|
495
|
-
tokenExpiryDays: {
|
|
496
|
-
type: "integer",
|
|
497
|
-
minimum: 1,
|
|
498
|
-
maximum: 365
|
|
499
|
-
},
|
|
500
|
-
gatewayId: {
|
|
501
|
-
type: "string"
|
|
502
|
-
},
|
|
503
|
-
websocketHeartbeatIntervalMs: {
|
|
504
|
-
type: "integer",
|
|
505
|
-
minimum: 5e3,
|
|
506
|
-
maximum: 12e4
|
|
507
|
-
}
|
|
437
|
+
additionalProperties: false,
|
|
438
|
+
properties: {
|
|
439
|
+
enabled: {
|
|
440
|
+
type: "boolean",
|
|
441
|
+
default: true
|
|
442
|
+
},
|
|
443
|
+
dmPolicy: {
|
|
444
|
+
type: "string",
|
|
445
|
+
enum: ["pairing", "allowlist", "open"]
|
|
446
|
+
},
|
|
447
|
+
allowFrom: {
|
|
448
|
+
type: "array",
|
|
449
|
+
items: { type: "string" }
|
|
450
|
+
},
|
|
451
|
+
websocketHeartbeatIntervalMs: {
|
|
452
|
+
type: "integer",
|
|
453
|
+
minimum: 5e3,
|
|
454
|
+
maximum: 12e4
|
|
508
455
|
}
|
|
509
456
|
},
|
|
510
457
|
default: {}
|
|
@@ -512,15 +459,6 @@ var lingyaoChannelConfigSchema = {
|
|
|
512
459
|
}
|
|
513
460
|
}
|
|
514
461
|
};
|
|
515
|
-
function getDefaultConfig() {
|
|
516
|
-
return {
|
|
517
|
-
enabled: true,
|
|
518
|
-
dmPolicy: "pairing",
|
|
519
|
-
allowFrom: [],
|
|
520
|
-
maxOfflineMessages: 100,
|
|
521
|
-
tokenExpiryDays: 30
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
462
|
|
|
525
463
|
// src/api.ts
|
|
526
464
|
var orchestrator = null;
|
|
@@ -605,19 +543,6 @@ var lingyaoPlugin = {
|
|
|
605
543
|
directory: directoryAdapter,
|
|
606
544
|
messaging: messagingAdapter
|
|
607
545
|
};
|
|
608
|
-
var pluginMetadata = {
|
|
609
|
-
name: "lingyao",
|
|
610
|
-
version: "0.9.8",
|
|
611
|
-
description: "Lingyao Channel Plugin - bidirectional sync via lingyao.live server relay",
|
|
612
|
-
type: "channel",
|
|
613
|
-
capabilities: {
|
|
614
|
-
chatTypes: ["direct"],
|
|
615
|
-
media: false,
|
|
616
|
-
reactions: false,
|
|
617
|
-
threads: false
|
|
618
|
-
},
|
|
619
|
-
defaultConfig: getDefaultConfig()
|
|
620
|
-
};
|
|
621
546
|
|
|
622
547
|
// src/setup-entry.ts
|
|
623
548
|
var setup_entry_default = defineSetupPluginEntry(lingyaoPlugin);
|