@invago/mixin 1.0.12 → 1.0.14
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/channel.ts +25 -10
- package/src/config-schema.ts +13 -1
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import { uniqueConversationID } from "@mixin.dev/mixin-node-sdk";
|
|
4
|
-
import {
|
|
5
|
-
buildChannelConfigSchema,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "openclaw/plugin-sdk";
|
|
4
|
+
import {
|
|
5
|
+
buildChannelConfigSchema,
|
|
6
|
+
formatPairingApproveHint,
|
|
7
|
+
resolveChannelMediaMaxBytes,
|
|
8
|
+
} from "openclaw/plugin-sdk";
|
|
10
9
|
import type { ChannelGatewayContext, OpenClawConfig, ReplyPayload } from "openclaw/plugin-sdk";
|
|
11
10
|
import { runBlazeLoop } from "./blaze-service.js";
|
|
12
11
|
import { buildClient, sleep } from "./shared.js";
|
|
@@ -27,8 +26,24 @@ const BASE_DELAY = 1000;
|
|
|
27
26
|
const MAX_DELAY = 3000;
|
|
28
27
|
const MULTIPLIER = 1.5;
|
|
29
28
|
const MEDIA_MAX_BYTES = 30 * 1024 * 1024;
|
|
30
|
-
const execFileAsync = promisify(execFile);
|
|
31
|
-
const CONVERSATION_CATEGORY_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
29
|
+
const execFileAsync = promisify(execFile);
|
|
30
|
+
const CONVERSATION_CATEGORY_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
31
|
+
|
|
32
|
+
function createDefaultMixinRuntimeState(accountId: string): {
|
|
33
|
+
accountId: string;
|
|
34
|
+
running: boolean;
|
|
35
|
+
lastStartAt: number | null;
|
|
36
|
+
lastStopAt: number | null;
|
|
37
|
+
lastError: string | null;
|
|
38
|
+
} {
|
|
39
|
+
return {
|
|
40
|
+
accountId,
|
|
41
|
+
running: false,
|
|
42
|
+
lastStartAt: null,
|
|
43
|
+
lastStopAt: null,
|
|
44
|
+
lastError: null,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
32
47
|
|
|
33
48
|
const conversationCategoryCache = new Map<string, {
|
|
34
49
|
category: "CONTACT" | "GROUP";
|
|
@@ -512,8 +527,8 @@ export const mixinPlugin = {
|
|
|
512
527
|
},
|
|
513
528
|
},
|
|
514
529
|
|
|
515
|
-
status: {
|
|
516
|
-
defaultRuntime:
|
|
530
|
+
status: {
|
|
531
|
+
defaultRuntime: createDefaultMixinRuntimeState("default"),
|
|
517
532
|
buildChannelSummary: (params: {
|
|
518
533
|
snapshot: {
|
|
519
534
|
configured?: boolean | null;
|
package/src/config-schema.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import { DmPolicySchema, GroupPolicySchema } from "openclaw/plugin-sdk";
|
|
2
1
|
import { z } from "zod";
|
|
3
2
|
|
|
3
|
+
const DmPolicySchema = z.enum([
|
|
4
|
+
"pairing",
|
|
5
|
+
"allowlist",
|
|
6
|
+
"open",
|
|
7
|
+
"disabled",
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
const GroupPolicySchema = z.enum([
|
|
11
|
+
"open",
|
|
12
|
+
"disabled",
|
|
13
|
+
"allowlist",
|
|
14
|
+
]);
|
|
15
|
+
|
|
4
16
|
export const MixinProxyConfigSchema = z.object({
|
|
5
17
|
enabled: z.boolean().optional().default(false),
|
|
6
18
|
url: z.string().optional(),
|