@openclaw/zalouser 2026.2.6 → 2026.2.9
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/CHANGELOG.md +12 -0
- package/index.ts +2 -2
- package/package.json +2 -3
- package/src/channel.ts +1 -1
- package/src/tool.ts +9 -7
- package/src/zca.ts +1 -5
package/CHANGELOG.md
CHANGED
package/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
1
|
+
import type { AnyAgentTool, OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
2
2
|
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
|
3
3
|
import { zalouserDock, zalouserPlugin } from "./src/channel.js";
|
|
4
4
|
import { setZalouserRuntime } from "./src/runtime.js";
|
|
@@ -24,7 +24,7 @@ const plugin = {
|
|
|
24
24
|
"friends (list/search friends), groups (list groups), me (profile info), status (auth check).",
|
|
25
25
|
parameters: ZalouserToolSchema,
|
|
26
26
|
execute: executeZalouserTool,
|
|
27
|
-
});
|
|
27
|
+
} as AnyAgentTool);
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/zalouser",
|
|
3
|
-
"version": "2026.2.
|
|
3
|
+
"version": "2026.2.9",
|
|
4
4
|
"description": "OpenClaw Zalo Personal Account plugin via zca-cli",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@sinclair/typebox": "0.34.48"
|
|
8
|
-
"openclaw": "workspace:*"
|
|
7
|
+
"@sinclair/typebox": "0.34.48"
|
|
9
8
|
},
|
|
10
9
|
"devDependencies": {
|
|
11
10
|
"openclaw": "workspace:*"
|
package/src/channel.ts
CHANGED
package/src/tool.ts
CHANGED
|
@@ -3,6 +3,11 @@ import { runZca, parseJsonOutput } from "./zca.js";
|
|
|
3
3
|
|
|
4
4
|
const ACTIONS = ["send", "image", "link", "friends", "groups", "me", "status"] as const;
|
|
5
5
|
|
|
6
|
+
type AgentToolResult = {
|
|
7
|
+
content: Array<{ type: string; text: string }>;
|
|
8
|
+
details?: unknown;
|
|
9
|
+
};
|
|
10
|
+
|
|
6
11
|
function stringEnum<T extends readonly string[]>(
|
|
7
12
|
values: T,
|
|
8
13
|
options: { description?: string } = {},
|
|
@@ -38,12 +43,7 @@ type ToolParams = {
|
|
|
38
43
|
url?: string;
|
|
39
44
|
};
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
content: Array<{ type: string; text: string }>;
|
|
43
|
-
details: unknown;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function json(payload: unknown): ToolResult {
|
|
46
|
+
function json(payload: unknown): AgentToolResult {
|
|
47
47
|
return {
|
|
48
48
|
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
49
49
|
details: payload,
|
|
@@ -53,7 +53,9 @@ function json(payload: unknown): ToolResult {
|
|
|
53
53
|
export async function executeZalouserTool(
|
|
54
54
|
_toolCallId: string,
|
|
55
55
|
params: ToolParams,
|
|
56
|
-
|
|
56
|
+
_signal?: AbortSignal,
|
|
57
|
+
_onUpdate?: unknown,
|
|
58
|
+
): Promise<AgentToolResult> {
|
|
57
59
|
try {
|
|
58
60
|
switch (params.action) {
|
|
59
61
|
case "send": {
|
package/src/zca.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn, type SpawnOptions } from "node:child_process";
|
|
2
|
+
import { stripAnsi } from "openclaw/plugin-sdk";
|
|
2
3
|
import type { ZcaResult, ZcaRunOptions } from "./types.js";
|
|
3
4
|
|
|
4
5
|
const ZCA_BINARY = "zca";
|
|
@@ -107,11 +108,6 @@ export function runZcaInteractive(args: string[], options?: ZcaRunOptions): Prom
|
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
function stripAnsi(str: string): string {
|
|
111
|
-
// oxlint-disable-next-line no-control-regex
|
|
112
|
-
return str.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "");
|
|
113
|
-
}
|
|
114
|
-
|
|
115
111
|
export function parseJsonOutput<T>(stdout: string): T | null {
|
|
116
112
|
try {
|
|
117
113
|
return JSON.parse(stdout) as T;
|