@panguard-ai/panguard-mcp 1.0.0 → 1.2.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/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/mcp-config-reader.d.ts +8 -0
- package/dist/config/mcp-config-reader.d.ts.map +1 -1
- package/dist/config/mcp-config-reader.js +35 -1
- package/dist/config/mcp-config-reader.js.map +1 -1
- package/package.json +5 -5
- package/dist/cli/index.d.ts +0 -13
- package/dist/cli/index.js +0 -67
- package/dist/cli/index.js.map +0 -1
- package/dist/config/mcp-injector.d.ts +0 -40
- package/dist/config/mcp-injector.js +0 -294
- package/dist/config/mcp-injector.js.map +0 -1
- package/dist/config/platform-detector.d.ts +0 -30
- package/dist/config/platform-detector.js +0 -176
- package/dist/config/platform-detector.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
- package/dist/server.d.ts +0 -356
- package/dist/server.js +0 -323
- package/dist/server.js.map +0 -1
- package/dist/tools/guard-tools.d.ts +0 -62
- package/dist/tools/guard-tools.d.ts.map +0 -1
- package/dist/tools/guard-tools.js +0 -356
- package/dist/tools/guard-tools.js.map +0 -1
- package/dist/tools/manage-tools.d.ts +0 -65
- package/dist/tools/manage-tools.js +0 -299
- package/dist/tools/manage-tools.js.map +0 -1
- package/dist/tools/scan-tools.d.ts +0 -46
- package/dist/tools/scan-tools.js +0 -157
- package/dist/tools/scan-tools.js.map +0 -1
package/dist/server.js
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Panguard MCP - Server
|
|
3
|
-
* Panguard MCP - 伺服器
|
|
4
|
-
*
|
|
5
|
-
* Main MCP server entry: registers all tools and dispatches incoming requests.
|
|
6
|
-
* 主要 MCP 伺服器入口:註冊所有工具並分派傳入請求。
|
|
7
|
-
*
|
|
8
|
-
* @module @panguard-ai/panguard-mcp/server
|
|
9
|
-
*/
|
|
10
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
12
|
-
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
13
|
-
import { createLogger } from '@panguard-ai/core';
|
|
14
|
-
import { executeScan, executeScanCode } from './tools/scan-tools.js';
|
|
15
|
-
import { executeGuardStart, executeGuardStop, executeStatus, executeAlerts, } from './tools/guard-tools.js';
|
|
16
|
-
import { executeBlockIP, executeGenerateReport, executeInit, executeDeploy, } from './tools/manage-tools.js';
|
|
17
|
-
const logger = createLogger('panguard-mcp:server');
|
|
18
|
-
import { createRequire } from 'node:module';
|
|
19
|
-
const _require = createRequire(import.meta.url);
|
|
20
|
-
const _pkg = _require('../package.json');
|
|
21
|
-
/** MCP server version / MCP 伺服器版本 */
|
|
22
|
-
export const PANGUARD_MCP_VERSION = _pkg.version;
|
|
23
|
-
/**
|
|
24
|
-
* All MCP tool definitions.
|
|
25
|
-
* 所有 MCP 工具定義。
|
|
26
|
-
*
|
|
27
|
-
* Each tool has a name, description (bilingual EN/ZH-TW), and inputSchema.
|
|
28
|
-
* 每個工具都有名稱、雙語描述(EN/ZH-TW)和輸入結構。
|
|
29
|
-
*/
|
|
30
|
-
const TOOL_DEFINITIONS = [
|
|
31
|
-
{
|
|
32
|
-
name: 'panguard_scan',
|
|
33
|
-
description: 'Run a security health check scan on the local system. Returns risk score (0-100), grade (A-F), and list of security findings. / 在本機執行資安健檢掃描,回傳風險分數、等級和安全發現清單。',
|
|
34
|
-
inputSchema: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
properties: {
|
|
37
|
-
depth: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
enum: ['quick', 'full'],
|
|
40
|
-
description: 'Scan depth: quick (~30s) or full (~60s)',
|
|
41
|
-
default: 'quick',
|
|
42
|
-
},
|
|
43
|
-
lang: {
|
|
44
|
-
type: 'string',
|
|
45
|
-
enum: ['en', 'zh-TW'],
|
|
46
|
-
description: 'Output language',
|
|
47
|
-
default: 'en',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'panguard_scan_code',
|
|
54
|
-
description: 'Scan source code directory for security vulnerabilities (SAST). Detects SQL injection, XSS, hardcoded secrets, command injection, and more. / 掃描原始碼目錄的安全漏洞(SAST)。偵測 SQL 注入、XSS、硬編碼密鑰等。',
|
|
55
|
-
inputSchema: {
|
|
56
|
-
type: 'object',
|
|
57
|
-
properties: {
|
|
58
|
-
dir: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
description: 'Source code directory to scan',
|
|
61
|
-
default: '.',
|
|
62
|
-
},
|
|
63
|
-
lang: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
enum: ['en', 'zh-TW'],
|
|
66
|
-
default: 'en',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
required: ['dir'],
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'panguard_guard_start',
|
|
74
|
-
description: 'Start the Panguard Guard real-time threat monitoring daemon. / 啟動 Panguard Guard 即時威脅監控常駐程式。',
|
|
75
|
-
inputSchema: {
|
|
76
|
-
type: 'object',
|
|
77
|
-
properties: {
|
|
78
|
-
dataDir: {
|
|
79
|
-
type: 'string',
|
|
80
|
-
description: 'Data directory (default: ~/.panguard-guard)',
|
|
81
|
-
},
|
|
82
|
-
mode: {
|
|
83
|
-
type: 'string',
|
|
84
|
-
enum: ['learning', 'protection'],
|
|
85
|
-
description: 'Operating mode',
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'panguard_guard_stop',
|
|
92
|
-
description: 'Stop the Panguard Guard daemon. / 停止 Panguard Guard 常駐程式。',
|
|
93
|
-
inputSchema: {
|
|
94
|
-
type: 'object',
|
|
95
|
-
properties: {
|
|
96
|
-
dataDir: {
|
|
97
|
-
type: 'string',
|
|
98
|
-
description: 'Data directory (default: ~/.panguard-guard)',
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: 'panguard_status',
|
|
105
|
-
description: 'Get the current status of all Panguard services (guard, scan, manager). Returns running state, threat counts, and system info. / 取得所有 Panguard 服務的當前狀態。',
|
|
106
|
-
inputSchema: {
|
|
107
|
-
type: 'object',
|
|
108
|
-
properties: {
|
|
109
|
-
dataDir: {
|
|
110
|
-
type: 'string',
|
|
111
|
-
description: 'Data directory (default: ~/.panguard-guard)',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'panguard_alerts',
|
|
118
|
-
description: 'Get recent security alerts detected by Panguard Guard. Returns the latest threat events with severity and details. / 取得 Panguard Guard 偵測到的近期安全告警。',
|
|
119
|
-
inputSchema: {
|
|
120
|
-
type: 'object',
|
|
121
|
-
properties: {
|
|
122
|
-
limit: {
|
|
123
|
-
type: 'number',
|
|
124
|
-
description: 'Maximum number of alerts to return',
|
|
125
|
-
default: 20,
|
|
126
|
-
},
|
|
127
|
-
severity: {
|
|
128
|
-
type: 'string',
|
|
129
|
-
enum: ['critical', 'high', 'medium', 'low', 'all'],
|
|
130
|
-
default: 'all',
|
|
131
|
-
},
|
|
132
|
-
dataDir: {
|
|
133
|
-
type: 'string',
|
|
134
|
-
description: 'Data directory (default: ~/.panguard-guard)',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'panguard_block_ip',
|
|
141
|
-
description: 'Manually block an IP address from accessing the system. / 手動封鎖 IP 位址存取系統。',
|
|
142
|
-
inputSchema: {
|
|
143
|
-
type: 'object',
|
|
144
|
-
properties: {
|
|
145
|
-
ip: {
|
|
146
|
-
type: 'string',
|
|
147
|
-
description: 'IP address to block (IPv4 or IPv6)',
|
|
148
|
-
},
|
|
149
|
-
duration: {
|
|
150
|
-
type: 'string',
|
|
151
|
-
description: 'Block duration (e.g., "1h", "24h", "permanent")',
|
|
152
|
-
default: '1h',
|
|
153
|
-
},
|
|
154
|
-
reason: {
|
|
155
|
-
type: 'string',
|
|
156
|
-
description: 'Reason for blocking',
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
required: ['ip'],
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: 'panguard_generate_report',
|
|
164
|
-
description: 'Generate a PDF compliance report from scan results. Returns the path to the generated PDF. / 從掃描結果生成 PDF 合規報告。',
|
|
165
|
-
inputSchema: {
|
|
166
|
-
type: 'object',
|
|
167
|
-
properties: {
|
|
168
|
-
output: {
|
|
169
|
-
type: 'string',
|
|
170
|
-
description: 'Output PDF path',
|
|
171
|
-
default: './panguard-report.pdf',
|
|
172
|
-
},
|
|
173
|
-
lang: {
|
|
174
|
-
type: 'string',
|
|
175
|
-
enum: ['en', 'zh-TW'],
|
|
176
|
-
default: 'en',
|
|
177
|
-
},
|
|
178
|
-
depth: {
|
|
179
|
-
type: 'string',
|
|
180
|
-
enum: ['quick', 'full'],
|
|
181
|
-
default: 'full',
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
name: 'panguard_init',
|
|
188
|
-
description: 'Initialize Panguard configuration interactively (non-interactive mode with defaults). / 以非互動模式初始化 Panguard 配置。',
|
|
189
|
-
inputSchema: {
|
|
190
|
-
type: 'object',
|
|
191
|
-
properties: {
|
|
192
|
-
dataDir: {
|
|
193
|
-
type: 'string',
|
|
194
|
-
description: 'Data directory (default: ~/.panguard-guard)',
|
|
195
|
-
},
|
|
196
|
-
lang: {
|
|
197
|
-
type: 'string',
|
|
198
|
-
enum: ['en', 'zh-TW'],
|
|
199
|
-
default: 'en',
|
|
200
|
-
},
|
|
201
|
-
mode: {
|
|
202
|
-
type: 'string',
|
|
203
|
-
enum: ['learning', 'protection'],
|
|
204
|
-
default: 'learning',
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: 'panguard_audit_skill',
|
|
211
|
-
description: 'Audit an OpenClaw/AgentSkills SKILL.md directory for security issues. Checks manifest validity, prompt injection, tool poisoning, code vulnerabilities, dependencies, and permissions. Returns risk score (0-100) and detailed findings. / 審計 OpenClaw 技能目錄的安全問題。檢查清單有效性、提示注入、工具投毒、程式碼漏洞、依賴和權限。',
|
|
212
|
-
inputSchema: {
|
|
213
|
-
type: 'object',
|
|
214
|
-
properties: {
|
|
215
|
-
path: {
|
|
216
|
-
type: 'string',
|
|
217
|
-
description: 'Path to skill directory containing SKILL.md',
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
required: ['path'],
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: 'panguard_deploy',
|
|
225
|
-
description: 'Deploy Panguard services: scan for vulnerabilities, start guard monitoring, and generate initial report. This is the one-click setup for protection. / 部署 Panguard 服務:掃描漏洞、啟動監控並生成初始報告。一鍵設定防護。',
|
|
226
|
-
inputSchema: {
|
|
227
|
-
type: 'object',
|
|
228
|
-
properties: {
|
|
229
|
-
dataDir: {
|
|
230
|
-
type: 'string',
|
|
231
|
-
description: 'Data directory (default: ~/.panguard-guard)',
|
|
232
|
-
},
|
|
233
|
-
lang: {
|
|
234
|
-
type: 'string',
|
|
235
|
-
enum: ['en', 'zh-TW'],
|
|
236
|
-
default: 'en',
|
|
237
|
-
},
|
|
238
|
-
mode: {
|
|
239
|
-
type: 'string',
|
|
240
|
-
enum: ['learning', 'protection'],
|
|
241
|
-
default: 'learning',
|
|
242
|
-
},
|
|
243
|
-
generateReport: {
|
|
244
|
-
type: 'boolean',
|
|
245
|
-
description: 'Generate PDF report after scan',
|
|
246
|
-
default: true,
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
];
|
|
252
|
-
/**
|
|
253
|
-
* Returns the complete list of all MCP tool definitions.
|
|
254
|
-
* 返回所有 MCP 工具定義的完整清單。
|
|
255
|
-
*/
|
|
256
|
-
export function getAllToolDefinitions() {
|
|
257
|
-
return TOOL_DEFINITIONS;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Dispatch an incoming tool call to the appropriate handler.
|
|
261
|
-
* 將傳入的工具呼叫分派給適當的處理程序。
|
|
262
|
-
*
|
|
263
|
-
* @param name - Tool name / 工具名稱
|
|
264
|
-
* @param args - Tool arguments / 工具參數
|
|
265
|
-
*/
|
|
266
|
-
export async function dispatchTool(name, args) {
|
|
267
|
-
switch (name) {
|
|
268
|
-
case 'panguard_scan':
|
|
269
|
-
return executeScan(args);
|
|
270
|
-
case 'panguard_scan_code':
|
|
271
|
-
return executeScanCode(args);
|
|
272
|
-
case 'panguard_guard_start':
|
|
273
|
-
return executeGuardStart(args);
|
|
274
|
-
case 'panguard_guard_stop':
|
|
275
|
-
return executeGuardStop(args);
|
|
276
|
-
case 'panguard_status':
|
|
277
|
-
return executeStatus(args);
|
|
278
|
-
case 'panguard_alerts':
|
|
279
|
-
return executeAlerts(args);
|
|
280
|
-
case 'panguard_block_ip':
|
|
281
|
-
return executeBlockIP(args);
|
|
282
|
-
case 'panguard_generate_report':
|
|
283
|
-
return executeGenerateReport(args);
|
|
284
|
-
case 'panguard_init':
|
|
285
|
-
return executeInit(args);
|
|
286
|
-
case 'panguard_deploy':
|
|
287
|
-
return executeDeploy(args);
|
|
288
|
-
case 'panguard_audit_skill': {
|
|
289
|
-
const { auditSkill } = await import('@panguard-ai/panguard-skill-auditor');
|
|
290
|
-
const skillPath = args['path'] ?? '.';
|
|
291
|
-
const report = await auditSkill(skillPath);
|
|
292
|
-
return {
|
|
293
|
-
content: [{ type: 'text', text: JSON.stringify(report, null, 2) }],
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
default:
|
|
297
|
-
return {
|
|
298
|
-
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
299
|
-
isError: true,
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Create and start the MCP server using stdio transport.
|
|
305
|
-
* 使用 stdio 傳輸建立並啟動 MCP 伺服器。
|
|
306
|
-
*
|
|
307
|
-
* This is the main entry point for the MCP server process.
|
|
308
|
-
* 這是 MCP 伺服器進程的主要入口點。
|
|
309
|
-
*/
|
|
310
|
-
export async function startMCPServer() {
|
|
311
|
-
const server = new Server({ name: 'panguard-mcp', version: PANGUARD_MCP_VERSION }, { capabilities: { tools: {} } });
|
|
312
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
313
|
-
tools: getAllToolDefinitions(),
|
|
314
|
-
}));
|
|
315
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
316
|
-
const { name, arguments: args } = request.params;
|
|
317
|
-
return await dispatchTool(name, args ?? {});
|
|
318
|
-
});
|
|
319
|
-
const transport = new StdioServerTransport();
|
|
320
|
-
await server.connect(transport);
|
|
321
|
-
logger.info('Panguard MCP server started / Panguard MCP 伺服器已啟動');
|
|
322
|
-
}
|
|
323
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,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AAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC;gBACnE,OAAO,EAAE,IAAI;aACd,CAAC;IACN,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,oBAAoB,EAAE,EACvD,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE,qBAAqB,EAAE;KAC/B,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Panguard MCP - Guard Tools
|
|
3
|
-
* Panguard MCP - 守護工具
|
|
4
|
-
*
|
|
5
|
-
* Implements panguard_guard_start, panguard_guard_stop, panguard_status,
|
|
6
|
-
* and panguard_alerts MCP tools.
|
|
7
|
-
* 實作 panguard_guard_start、panguard_guard_stop、panguard_status 和 panguard_alerts MCP 工具。
|
|
8
|
-
*
|
|
9
|
-
* @module @panguard-ai/panguard-mcp/tools/guard-tools
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Execute panguard_guard_start — start the real-time threat monitoring daemon.
|
|
13
|
-
* 執行 panguard_guard_start — 啟動即時威脅監控常駐程式。
|
|
14
|
-
*
|
|
15
|
-
* Spawns the guard daemon as a detached background process with stdio
|
|
16
|
-
* redirected to a log file, so it does not interfere with MCP stdio transport.
|
|
17
|
-
* 將守護常駐程式作為分離的背景進程啟動,stdio 重導向到日誌檔案。
|
|
18
|
-
*/
|
|
19
|
-
export declare function executeGuardStart(args: Record<string, unknown>): Promise<{
|
|
20
|
-
content: {
|
|
21
|
-
type: "text";
|
|
22
|
-
text: string;
|
|
23
|
-
}[];
|
|
24
|
-
isError?: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
content: {
|
|
27
|
-
type: "text";
|
|
28
|
-
text: string;
|
|
29
|
-
}[];
|
|
30
|
-
isError: boolean;
|
|
31
|
-
}>;
|
|
32
|
-
/**
|
|
33
|
-
* Execute panguard_guard_stop — stop the real-time threat monitoring daemon.
|
|
34
|
-
* 執行 panguard_guard_stop — 停止即時威脅監控常駐程式。
|
|
35
|
-
*/
|
|
36
|
-
export declare function executeGuardStop(args: Record<string, unknown>): Promise<{
|
|
37
|
-
content: {
|
|
38
|
-
type: "text";
|
|
39
|
-
text: string;
|
|
40
|
-
}[];
|
|
41
|
-
}>;
|
|
42
|
-
/**
|
|
43
|
-
* Execute panguard_status — get current status of all Panguard services.
|
|
44
|
-
* 執行 panguard_status — 取得所有 Panguard 服務的當前狀態。
|
|
45
|
-
*/
|
|
46
|
-
export declare function executeStatus(args: Record<string, unknown>): Promise<{
|
|
47
|
-
content: {
|
|
48
|
-
type: "text";
|
|
49
|
-
text: string;
|
|
50
|
-
}[];
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Execute panguard_alerts — get recent security alerts from guard event log.
|
|
54
|
-
* 執行 panguard_alerts — 從守護事件日誌取得近期安全告警。
|
|
55
|
-
*/
|
|
56
|
-
export declare function executeAlerts(args: Record<string, unknown>): Promise<{
|
|
57
|
-
content: {
|
|
58
|
-
type: "text";
|
|
59
|
-
text: string;
|
|
60
|
-
}[];
|
|
61
|
-
}>;
|
|
62
|
-
//# sourceMappingURL=guard-tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guard-tools.d.ts","sourceRoot":"","sources":["../../src/tools/guard-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAgMpE;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GA6CnE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAiEhE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAiDhE"}
|