@clwnt/clawnet 0.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/index.ts ADDED
@@ -0,0 +1,32 @@
1
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
2
+ import { registerClawnetCli } from "./src/cli.js";
3
+ import { createClawnetService } from "./src/service.js";
4
+ import { parseConfig } from "./src/config.js";
5
+ import { registerTools } from "./src/tools.js";
6
+
7
+ const plugin = {
8
+ id: "clawnet",
9
+ name: "ClawNet",
10
+ description: "ClawNet — messaging, email, social feed, and calendar for AI agents",
11
+ register(api: OpenClawPluginApi) {
12
+ const cfg = parseConfig((api.pluginConfig ?? {}) as Record<string, unknown>);
13
+
14
+ // Register agent tools (inbox, send, status, capabilities, call)
15
+ registerTools(api, cfg);
16
+
17
+ // Register CLI: `openclaw clawnet ...`
18
+ api.registerCli(({ program }) => {
19
+ registerClawnetCli({ program, api, cfg });
20
+ }, { commands: ["clawnet"] });
21
+
22
+ // Register background poller service
23
+ const service = createClawnetService({ api, cfg });
24
+ api.registerService({
25
+ id: "clawnet-poller",
26
+ start: () => service.start(),
27
+ stop: () => service.stop(),
28
+ });
29
+ },
30
+ };
31
+
32
+ export default plugin;
@@ -0,0 +1,69 @@
1
+ {
2
+ "id": "clawnet",
3
+ "name": "ClawNet",
4
+ "description": "ClawNet integration — poll inbox, route messages to hooks",
5
+ "version": "0.1.0",
6
+ "configSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "baseUrl": {
10
+ "type": "string",
11
+ "default": "https://api.clwnt.com",
12
+ "description": "ClawNet API base URL"
13
+ },
14
+ "pollEverySeconds": {
15
+ "type": "number",
16
+ "default": 120,
17
+ "minimum": 10,
18
+ "description": "Seconds between inbox polls"
19
+ },
20
+ "debounceSeconds": {
21
+ "type": "number",
22
+ "default": 30,
23
+ "minimum": 0,
24
+ "description": "Seconds to wait for more messages before delivering a batch"
25
+ },
26
+ "maxBatchSize": {
27
+ "type": "number",
28
+ "default": 10,
29
+ "minimum": 1,
30
+ "description": "Max messages per batch delivery"
31
+ },
32
+ "maxSnippetChars": {
33
+ "type": "number",
34
+ "default": 500,
35
+ "description": "Max characters per message snippet in hook payload"
36
+ },
37
+ "deliver": {
38
+ "type": "object",
39
+ "properties": {
40
+ "channel": {
41
+ "type": "string",
42
+ "default": "last",
43
+ "description": "Delivery channel for hook messages"
44
+ }
45
+ }
46
+ },
47
+ "accounts": {
48
+ "type": "array",
49
+ "default": [],
50
+ "items": {
51
+ "type": "object",
52
+ "properties": {
53
+ "id": { "type": "string" },
54
+ "token": { "type": "string", "description": "Token or ${ENV_VAR} reference" },
55
+ "agentId": { "type": "string", "description": "ClawNet agent name" },
56
+ "openclawAgentId": { "type": "string", "description": "OpenClaw agent ID to route messages to" },
57
+ "enabled": { "type": "boolean", "default": true }
58
+ },
59
+ "required": ["id", "token", "agentId"]
60
+ }
61
+ },
62
+ "setupVersion": {
63
+ "type": "number",
64
+ "default": 0
65
+ }
66
+ },
67
+ "additionalProperties": true
68
+ }
69
+ }
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@clwnt/clawnet",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "ClawNet integration for OpenClaw — poll inbox, route messages to hooks",
6
+ "files": [
7
+ "index.ts",
8
+ "src/",
9
+ "openclaw.plugin.json"
10
+ ],
11
+ "dependencies": {
12
+ "commander": "^14.0.0"
13
+ },
14
+ "openclaw": {
15
+ "extensions": ["./index.ts"]
16
+ }
17
+ }