@alfe.ai/openclaw-webhooks 0.0.1 → 0.0.3
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/plugin.js +10 -6
- package/openclaw.plugin.json +12 -0
- package/package.json +4 -5
package/dist/plugin.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
1
|
import { WebhooksServiceClient } from "@alfe.ai/webhooks";
|
|
2
|
+
import { DEFAULT_SOCKET_PATH, resolveConfig } from "@alfe.ai/config";
|
|
4
3
|
//#region src/plugin.ts
|
|
5
4
|
/**
|
|
6
5
|
* @alfe.ai/openclaw-webhooks — OpenClaw webhooks plugin.
|
|
@@ -14,7 +13,6 @@ import { WebhooksServiceClient } from "@alfe.ai/webhooks";
|
|
|
14
13
|
* - Registers gateway RPC methods for webhook management
|
|
15
14
|
* - Exposes agent-callable tools for self-service CRUD
|
|
16
15
|
*/
|
|
17
|
-
const DEFAULT_SOCKET_PATH = join(homedir(), ".alfe", "gateway.sock");
|
|
18
16
|
const WEBHOOKS_CAPABILITIES = ["webhooks.receive", "webhooks.manage"];
|
|
19
17
|
let daemonIpcClient = null;
|
|
20
18
|
let webhooksClient = null;
|
|
@@ -61,9 +59,15 @@ const plugin = {
|
|
|
61
59
|
const log = api.logger;
|
|
62
60
|
log.info("Alfe Webhooks plugin activating...");
|
|
63
61
|
const pluginConfig = (api.config ?? {}).plugins?.entries?.["@alfe.ai/openclaw-webhooks"]?.config ?? {};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
let alfeConfig = null;
|
|
63
|
+
try {
|
|
64
|
+
alfeConfig = await resolveConfig();
|
|
65
|
+
} catch {
|
|
66
|
+
log.info("Could not resolve Alfe config — daemon IPC and webhooks WS auth unavailable");
|
|
67
|
+
}
|
|
68
|
+
daemonIpcClient = await connectToDaemon(pluginConfig.daemonSocket ?? alfeConfig?.socketPath ?? DEFAULT_SOCKET_PATH, log);
|
|
69
|
+
const webhooksWsUrl = pluginConfig.webhooksWsUrl;
|
|
70
|
+
const apiKey = alfeConfig?.apiKey;
|
|
67
71
|
if (webhooksWsUrl && apiKey) {
|
|
68
72
|
log.info(`Connecting to webhooks service: ${webhooksWsUrl}`);
|
|
69
73
|
webhooksClient = new WebhooksServiceClient({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "@alfe.ai/openclaw-webhooks",
|
|
3
|
+
"name": "Webhooks",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "Receive and manage external webhooks",
|
|
6
|
+
"entry": "./dist/plugin.js",
|
|
7
|
+
"configSchema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/openclaw-webhooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "OpenClaw webhooks plugin for Alfe — receive and manage external webhooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/plugin.js",
|
|
@@ -21,15 +21,14 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"openclaw.plugin.json"
|
|
25
26
|
],
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"ws": "^8.18.0",
|
|
29
|
+
"@alfe.ai/config": "0.0.5",
|
|
28
30
|
"@alfe.ai/webhooks": "^0.0.1"
|
|
29
31
|
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/ws": "^8.5.13"
|
|
32
|
-
},
|
|
33
32
|
"license": "UNLICENSED",
|
|
34
33
|
"scripts": {
|
|
35
34
|
"build": "tsdown",
|