@framers/agentos-ext-channel-zalouser 0.1.3 → 0.1.4
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/README.md +75 -0
- package/manifest.json +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Zalo personal channel
|
|
2
|
+
|
|
3
|
+
This pack gives an agent direct and group text messaging through a Zalo personal account using the unofficial `zca-cli` bridge. It sends messages through CLI commands and receives JSON lines from the CLI listener.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @framers/agentos-ext-channel-zalouser
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `@framers/agentos` `>=0.10.40`.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { AgentOS } from '@framers/agentos';
|
|
17
|
+
|
|
18
|
+
const agentos = await AgentOS.create({
|
|
19
|
+
extensionManifest: {
|
|
20
|
+
packs: [
|
|
21
|
+
{
|
|
22
|
+
package: '@framers/agentos-ext-channel-zalouser',
|
|
23
|
+
options: {
|
|
24
|
+
profile: process.env.ZCA_PROFILE,
|
|
25
|
+
cliPath: process.env.ZCA_CLI_PATH,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configuration
|
|
34
|
+
|
|
35
|
+
| Option | Secret id | Environment variable | Required | Default |
|
|
36
|
+
| --- | --- | --- | --- | --- |
|
|
37
|
+
| `profile` | None | `ZCA_PROFILE` | No | `default` |
|
|
38
|
+
| `cliPath` | None | `ZCA_CLI_PATH` | No | `zca` |
|
|
39
|
+
| `enableReceive` | None | None | No | `true` |
|
|
40
|
+
| `priority` | None | None | No | `20` |
|
|
41
|
+
|
|
42
|
+
Profile and CLI path resolve from trimmed nonempty options, then trimmed environment variables, then defaults. The pack reads no secrets.
|
|
43
|
+
|
|
44
|
+
## Tools
|
|
45
|
+
|
|
46
|
+
| Tool | What it does |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `zalouserSendMessage` | Send a text message through a Zalo personal account using `zca-cli`. |
|
|
49
|
+
|
|
50
|
+
### `zalouserSendMessage`
|
|
51
|
+
|
|
52
|
+
| Parameter | Type | Required | Description |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `conversationId` | string | Yes | Target thread id. Use `group:<threadId>` for group threads. |
|
|
55
|
+
| `text` | string | Yes | Message text. |
|
|
56
|
+
|
|
57
|
+
The input schema disallows additional properties.
|
|
58
|
+
|
|
59
|
+
## Channel adapter
|
|
60
|
+
|
|
61
|
+
The adapter registers platform `zalouser`. Activation starts `zca --profile <profile> listen -r -k` unless `enableReceive` is `false`. The listener parses newline-delimited JSON and emits direct or group text events. Group conversation IDs use `group:<threadId>`. Non-JSON lines and messages without a thread ID or nonempty content are ignored.
|
|
62
|
+
|
|
63
|
+
Sending requires a text block and runs `zca --profile <profile> msg send <threadId> <text>`, adding `-g` for group targets. Outbound message IDs are generated locally. Typing indicators do nothing. Shutdown terminates the listener with `SIGTERM`.
|
|
64
|
+
|
|
65
|
+
## Notes
|
|
66
|
+
|
|
67
|
+
The host needs the `zca` executable and an authenticated account, established through `zca auth login`. The pack does not install the CLI or perform login. Missing CLI or listener failures are recorded in connection status and logged when a logger is provided.
|
|
68
|
+
|
|
69
|
+
Sending posts through the personal account, trims text and truncates it to `2000` characters. Empty text, empty conversation IDs and empty `group:` targets are rejected. Send processes have a `60000` ms timeout and are killed with `SIGKILL` if it expires. Failed sends return an error derived from CLI output.
|
|
70
|
+
|
|
71
|
+
When the listener exits while the service is running, the code attempts a restart after `2000` ms. Setting `enableReceive` to `false` keeps outbound messaging available and disables the listener.
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
Apache-2.0
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
3
|
"id": "com.framers.channels.zalouser",
|
|
4
4
|
"name": "Zalo Personal Channel Extension",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.4",
|
|
6
6
|
"description": "Zalo personal account messaging via zca-cli (unofficial).",
|
|
7
7
|
"categories": ["channel", "communication"],
|
|
8
8
|
"platforms": ["zalouser"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-channel-zalouser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Zalo personal account messaging channel adapter for AgentOS (zca-cli bridge)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/node": "^20.0.0",
|
|
29
29
|
"typescript": "^5.0.0",
|
|
30
30
|
"vitest": "^3.2.7",
|
|
31
|
-
"@framers/agentos": "^0.13.
|
|
31
|
+
"@framers/agentos": "^0.13.47"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=22"
|