openclaw-channel-basicops 0.1.6 → 0.1.8
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/index.js +19 -3
- package/openclaw.plugin.json +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { callMcpTool } from "./basicops-mcp.js";
|
|
2
|
+
function getPluginAccountsRoot(cfg) {
|
|
3
|
+
// Primary: plugin entry config (works even when core config schema rejects `channels.basicops`)
|
|
4
|
+
const pluginId = "openclaw-channel-basicops";
|
|
5
|
+
return cfg?.plugins?.entries?.[pluginId]?.config?.accounts;
|
|
6
|
+
}
|
|
7
|
+
function getChannelAccountsRoot(cfg) {
|
|
8
|
+
// Optional: channel config (may be supported by some OpenClaw builds)
|
|
9
|
+
return cfg?.channels?.basicops?.accounts;
|
|
10
|
+
}
|
|
2
11
|
function listAccountIds(cfg) {
|
|
3
|
-
|
|
12
|
+
const ids = new Set();
|
|
13
|
+
for (const k of Object.keys(getPluginAccountsRoot(cfg) ?? {}))
|
|
14
|
+
ids.add(k);
|
|
15
|
+
for (const k of Object.keys(getChannelAccountsRoot(cfg) ?? {}))
|
|
16
|
+
ids.add(k);
|
|
17
|
+
return [...ids];
|
|
4
18
|
}
|
|
5
19
|
function resolveAccount(cfg, accountId) {
|
|
6
|
-
const
|
|
7
|
-
|
|
20
|
+
const id = accountId ?? "default";
|
|
21
|
+
// Prefer plugin entry config, then fall back to channel config.
|
|
22
|
+
const resolved = (getPluginAccountsRoot(cfg)?.[id] ?? getChannelAccountsRoot(cfg)?.[id]);
|
|
23
|
+
const account = resolved ? { ...resolved, accountId: id } : { accountId: id };
|
|
8
24
|
// Minimal configured heuristic
|
|
9
25
|
account.configured = Boolean(account?.enabled && (account?.mcp?.accessToken || account?.apiToken));
|
|
10
26
|
return account;
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "basicops",
|
|
2
|
+
"id": "openclaw-channel-basicops",
|
|
3
3
|
"name": "BasicOps",
|
|
4
4
|
"description": "BasicOps messaging channel connector (webhooks inbound + MCP outbound)",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.8",
|
|
6
6
|
"entry": "dist/index.js",
|
|
7
7
|
"tags": [
|
|
8
8
|
"channel",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-channel-basicops",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "BasicOps messaging channel connector for OpenClaw (webhooks inbound + MCP outbound)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsc -p tsconfig.json",
|
|
19
19
|
"dev": "tsc -w -p tsconfig.json",
|
|
20
|
-
"prepack": "npm run build"
|
|
20
|
+
"prepack": "node ./scripts/prepack-guard.mjs && npm run build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"openclaw": ">=2026.3.0"
|