@lingyao037/openclaw-lingyao-cli 1.0.0 → 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/index.js +26 -62
- package/dist/index.js.map +1 -1
- package/dist/setup-entry.js +25 -59
- package/dist/setup-entry.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,8 +89,6 @@ function extractAccounts(cfg) {
|
|
|
89
89
|
enabled: lingyao.enabled,
|
|
90
90
|
dmPolicy: normalizeDmPolicy(lingyao.dmPolicy),
|
|
91
91
|
allowFrom: Array.isArray(lingyao.allowFrom) ? lingyao.allowFrom : [],
|
|
92
|
-
maxOfflineMessages: lingyao.maxOfflineMessages,
|
|
93
|
-
tokenExpiryDays: lingyao.tokenExpiryDays,
|
|
94
92
|
gatewayId: lingyao.gatewayId,
|
|
95
93
|
websocketHeartbeatIntervalMs: lingyao.websocketHeartbeatIntervalMs
|
|
96
94
|
};
|
|
@@ -2267,18 +2265,18 @@ var ErrorHandler = class {
|
|
|
2267
2265
|
function getMachineId() {
|
|
2268
2266
|
try {
|
|
2269
2267
|
const interfaces = networkInterfaces();
|
|
2270
|
-
|
|
2271
|
-
for (const
|
|
2272
|
-
const iface = interfaces[name];
|
|
2268
|
+
const macs = [];
|
|
2269
|
+
for (const iface of Object.values(interfaces)) {
|
|
2273
2270
|
if (!iface) continue;
|
|
2274
2271
|
for (const alias of iface) {
|
|
2275
2272
|
if (!alias.internal && alias.mac && alias.mac !== "00:00:00:00:00:00") {
|
|
2276
|
-
|
|
2273
|
+
macs.push(alias.mac);
|
|
2277
2274
|
}
|
|
2278
2275
|
}
|
|
2279
2276
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2277
|
+
macs.sort();
|
|
2278
|
+
if (macs.length > 0) {
|
|
2279
|
+
return createHash("md5").update(macs.join("")).digest("hex").substring(0, 8);
|
|
2282
2280
|
}
|
|
2283
2281
|
} catch (e) {
|
|
2284
2282
|
}
|
|
@@ -2683,17 +2681,12 @@ var lingyaoAccountConfigSchema = z.object({
|
|
|
2683
2681
|
enabled: z.boolean().optional(),
|
|
2684
2682
|
dmPolicy: lingyaoDmPolicySchema.optional(),
|
|
2685
2683
|
allowFrom: allowFromSchema,
|
|
2686
|
-
maxOfflineMessages: z.number().int().min(1).max(1e3).optional(),
|
|
2687
|
-
tokenExpiryDays: z.number().int().min(1).max(365).optional(),
|
|
2688
|
-
gatewayId: z.string().min(1).optional(),
|
|
2689
2684
|
websocketHeartbeatIntervalMs: z.number().int().min(5e3).max(12e4).optional()
|
|
2690
2685
|
});
|
|
2691
2686
|
var lingyaoConfigSchema = z.object({
|
|
2692
2687
|
enabled: z.boolean().default(true),
|
|
2693
2688
|
dmPolicy: lingyaoDmPolicySchema.optional().default("pairing"),
|
|
2694
2689
|
allowFrom: allowFromSchema.default([]),
|
|
2695
|
-
maxOfflineMessages: z.number().int().min(1).max(1e3).optional().default(100),
|
|
2696
|
-
tokenExpiryDays: z.number().int().min(1).max(365).optional().default(30),
|
|
2697
2690
|
websocketHeartbeatIntervalMs: z.number().int().min(5e3).max(12e4).optional(),
|
|
2698
2691
|
defaultAccount: z.string().min(1).optional(),
|
|
2699
2692
|
accounts: z.record(lingyaoAccountConfigSchema).optional()
|
|
@@ -2701,7 +2694,7 @@ var lingyaoConfigSchema = z.object({
|
|
|
2701
2694
|
var lingyaoChannelConfigSchema = {
|
|
2702
2695
|
schema: {
|
|
2703
2696
|
type: "object",
|
|
2704
|
-
additionalProperties:
|
|
2697
|
+
additionalProperties: false,
|
|
2705
2698
|
properties: {
|
|
2706
2699
|
enabled: {
|
|
2707
2700
|
type: "boolean",
|
|
@@ -2717,18 +2710,6 @@ var lingyaoChannelConfigSchema = {
|
|
|
2717
2710
|
items: { type: "string" },
|
|
2718
2711
|
default: []
|
|
2719
2712
|
},
|
|
2720
|
-
maxOfflineMessages: {
|
|
2721
|
-
type: "integer",
|
|
2722
|
-
minimum: 1,
|
|
2723
|
-
maximum: 1e3,
|
|
2724
|
-
default: 100
|
|
2725
|
-
},
|
|
2726
|
-
tokenExpiryDays: {
|
|
2727
|
-
type: "integer",
|
|
2728
|
-
minimum: 1,
|
|
2729
|
-
maximum: 365,
|
|
2730
|
-
default: 30
|
|
2731
|
-
},
|
|
2732
2713
|
defaultAccount: {
|
|
2733
2714
|
type: "string"
|
|
2734
2715
|
},
|
|
@@ -2740,39 +2721,24 @@ var lingyaoChannelConfigSchema = {
|
|
|
2740
2721
|
},
|
|
2741
2722
|
accounts: {
|
|
2742
2723
|
type: "object",
|
|
2743
|
-
additionalProperties:
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
maximum: 1e3
|
|
2762
|
-
},
|
|
2763
|
-
tokenExpiryDays: {
|
|
2764
|
-
type: "integer",
|
|
2765
|
-
minimum: 1,
|
|
2766
|
-
maximum: 365
|
|
2767
|
-
},
|
|
2768
|
-
gatewayId: {
|
|
2769
|
-
type: "string"
|
|
2770
|
-
},
|
|
2771
|
-
websocketHeartbeatIntervalMs: {
|
|
2772
|
-
type: "integer",
|
|
2773
|
-
minimum: 5e3,
|
|
2774
|
-
maximum: 12e4
|
|
2775
|
-
}
|
|
2724
|
+
additionalProperties: false,
|
|
2725
|
+
properties: {
|
|
2726
|
+
enabled: {
|
|
2727
|
+
type: "boolean",
|
|
2728
|
+
default: true
|
|
2729
|
+
},
|
|
2730
|
+
dmPolicy: {
|
|
2731
|
+
type: "string",
|
|
2732
|
+
enum: ["pairing", "allowlist", "open"]
|
|
2733
|
+
},
|
|
2734
|
+
allowFrom: {
|
|
2735
|
+
type: "array",
|
|
2736
|
+
items: { type: "string" }
|
|
2737
|
+
},
|
|
2738
|
+
websocketHeartbeatIntervalMs: {
|
|
2739
|
+
type: "integer",
|
|
2740
|
+
minimum: 5e3,
|
|
2741
|
+
maximum: 12e4
|
|
2776
2742
|
}
|
|
2777
2743
|
},
|
|
2778
2744
|
default: {}
|
|
@@ -2787,9 +2753,7 @@ function getDefaultConfig() {
|
|
|
2787
2753
|
return {
|
|
2788
2754
|
enabled: true,
|
|
2789
2755
|
dmPolicy: "pairing",
|
|
2790
|
-
allowFrom: []
|
|
2791
|
-
maxOfflineMessages: 100,
|
|
2792
|
-
tokenExpiryDays: 30
|
|
2756
|
+
allowFrom: []
|
|
2793
2757
|
};
|
|
2794
2758
|
}
|
|
2795
2759
|
|