@kirigaya/openclaw-onebot 1.0.3 → 1.0.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/LICENSE +21 -21
- package/README.md +95 -3
- package/dist/cli-commands.d.ts +4 -0
- package/dist/cli-commands.js +119 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +26 -0
- package/dist/connection.d.ts +53 -6
- package/dist/connection.js +171 -19
- package/dist/handlers/process-inbound.js +187 -13
- package/dist/index.js +3 -1
- package/dist/markdown-to-html.d.ts +5 -1
- package/dist/markdown-to-html.js +76 -40
- package/dist/og-image.d.ts +3 -1
- package/dist/og-image.js +10 -4
- package/dist/setup.js +22 -0
- package/dist/tools.d.ts +3 -1
- package/dist/tools.js +54 -5
- package/openclaw.plugin.json +26 -1
- package/package.json +31 -13
- package/skills/onebot-ops/SKILL.md +14 -3
- package/skills/onebot-ops/agent-tools.md +116 -0
- package/skills/onebot-ops/send.md +56 -39
- package/themes/dust.css +1096 -0
- package/dist/gateway-proxy.d.ts +0 -8
- package/dist/gateway-proxy.js +0 -36
package/dist/gateway-proxy.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 当 openclaw message send 在独立进程运行(无 WebSocket)时,
|
|
3
|
-
* 通过 Gateway HTTP API /tools/invoke 代理发送
|
|
4
|
-
*/
|
|
5
|
-
export declare function invokeGatewayTool(cfg: Record<string, unknown>, tool: string, args: Record<string, unknown>): Promise<{
|
|
6
|
-
ok: boolean;
|
|
7
|
-
error?: string;
|
|
8
|
-
}>;
|
package/dist/gateway-proxy.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 当 openclaw message send 在独立进程运行(无 WebSocket)时,
|
|
3
|
-
* 通过 Gateway HTTP API /tools/invoke 代理发送
|
|
4
|
-
*/
|
|
5
|
-
export async function invokeGatewayTool(cfg, tool, args) {
|
|
6
|
-
const gw = cfg?.gateway;
|
|
7
|
-
const port = gw?.port ?? 18789;
|
|
8
|
-
const bind = gw?.bind ?? "loopback";
|
|
9
|
-
const host = bind === "loopback" ? "127.0.0.1" : "0.0.0.0";
|
|
10
|
-
const auth = gw?.auth;
|
|
11
|
-
const token = auth?.token;
|
|
12
|
-
const url = `http://${host}:${port}/tools/invoke`;
|
|
13
|
-
const headers = { "Content-Type": "application/json" };
|
|
14
|
-
if (token)
|
|
15
|
-
headers["Authorization"] = `Bearer ${token}`;
|
|
16
|
-
try {
|
|
17
|
-
const res = await fetch(url, {
|
|
18
|
-
method: "POST",
|
|
19
|
-
headers,
|
|
20
|
-
body: JSON.stringify({ tool, action: "json", args }),
|
|
21
|
-
});
|
|
22
|
-
if (!res.ok) {
|
|
23
|
-
return { ok: false, error: `Gateway API ${res.status}: ${await res.text().catch(() => "")}` };
|
|
24
|
-
}
|
|
25
|
-
const data = (await res.json().catch(() => ({})));
|
|
26
|
-
if (data?.error)
|
|
27
|
-
return { ok: false, error: data.error };
|
|
28
|
-
return { ok: true };
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
return {
|
|
32
|
-
ok: false,
|
|
33
|
-
error: e instanceof Error ? e.message : String(e),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|