nsf-clawguard 1.0.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/LICENSE +21 -0
- package/README-CN.md +329 -0
- package/README.md +329 -0
- package/clawdbot.plugin.json +18 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.mjs +48698 -0
- package/openclaw.plugin.json +18 -0
- package/package.json +61 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "nsf-clawguard",
|
|
3
|
+
"name": "nsf-clawguard",
|
|
4
|
+
"description": "Real-time monitoring of the security status on the client side, intelligently identifying risks and providing handling solutions",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"configSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"mcpPaths": {
|
|
10
|
+
"type": "array",
|
|
11
|
+
"items": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"description": "Paths to MCP config files to monitor"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
|
+
|
|
4
|
+
interface Logger {
|
|
5
|
+
info(message: string): void;
|
|
6
|
+
warn(message: string): void;
|
|
7
|
+
error(message: string): void;
|
|
8
|
+
debug(message: string): void;
|
|
9
|
+
}
|
|
10
|
+
interface PluginConfig {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
interface Message {
|
|
14
|
+
role: string;
|
|
15
|
+
content: string;
|
|
16
|
+
sender?: {
|
|
17
|
+
id: string;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
interface EventContext {
|
|
23
|
+
sessionKey?: string;
|
|
24
|
+
sendMessage?: (message: Message) => Promise<void>;
|
|
25
|
+
terminateSession?: (options: {
|
|
26
|
+
reason: string;
|
|
27
|
+
silent: boolean;
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
type OpenClawPluginCliContext = {
|
|
32
|
+
program: Command;
|
|
33
|
+
config?: {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
};
|
|
36
|
+
workspaceDir?: string;
|
|
37
|
+
logger: Logger;
|
|
38
|
+
};
|
|
39
|
+
type OpenClawPluginCliRegistrar = (ctx: OpenClawPluginCliContext) => void | Promise<void>;
|
|
40
|
+
type OpenClawPluginHttpRouteAuth = "gateway" | "plugin";
|
|
41
|
+
type OpenClawPluginHttpRouteMatch = "exact" | "prefix";
|
|
42
|
+
type OpenClawPluginHttpRouteHandler = (req: IncomingMessage, res: ServerResponse, logger: Logger) => Promise<boolean | void> | boolean | void;
|
|
43
|
+
type OpenClawPluginHttpRouteParams = {
|
|
44
|
+
path: string;
|
|
45
|
+
handler: OpenClawPluginHttpRouteHandler;
|
|
46
|
+
auth: OpenClawPluginHttpRouteAuth;
|
|
47
|
+
match?: OpenClawPluginHttpRouteMatch;
|
|
48
|
+
replaceExisting?: boolean;
|
|
49
|
+
};
|
|
50
|
+
interface OpenClawPluginApi {
|
|
51
|
+
logger: Logger;
|
|
52
|
+
config: PluginConfig;
|
|
53
|
+
pluginConfig: PluginConfig;
|
|
54
|
+
resolvePath: (input: string) => string;
|
|
55
|
+
version: string;
|
|
56
|
+
registerHttpRoute: (params: OpenClawPluginHttpRouteParams) => void;
|
|
57
|
+
registerCli: (registrar: OpenClawPluginCliRegistrar, opts?: {
|
|
58
|
+
commands?: string[];
|
|
59
|
+
}) => void;
|
|
60
|
+
on(event: string, handler: (event: any, ctx: EventContext) => Promise<void | {
|
|
61
|
+
block: boolean;
|
|
62
|
+
blockReason: string;
|
|
63
|
+
}>): void;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare function register(api: OpenClawPluginApi): Promise<void>;
|
|
67
|
+
|
|
68
|
+
export { register as default };
|