@goplus/agentguard 1.1.1 → 1.1.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/README.md +41 -2
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +335 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/client.d.ts +41 -0
- package/dist/cloud/client.d.ts.map +1 -0
- package/dist/cloud/client.js +145 -0
- package/dist/cloud/client.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +133 -0
- package/dist/config.js.map +1 -0
- package/dist/feed/selfcheck.d.ts +36 -0
- package/dist/feed/selfcheck.d.ts.map +1 -0
- package/dist/feed/selfcheck.js +198 -0
- package/dist/feed/selfcheck.js.map +1 -0
- package/dist/feed/state.d.ts +14 -0
- package/dist/feed/state.d.ts.map +1 -0
- package/dist/feed/state.js +57 -0
- package/dist/feed/state.js.map +1 -0
- package/dist/feed/types.d.ts +102 -0
- package/dist/feed/types.d.ts.map +1 -0
- package/dist/feed/types.js +15 -0
- package/dist/feed/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/installers.d.ts +10 -0
- package/dist/installers.d.ts.map +1 -0
- package/dist/installers.js +137 -0
- package/dist/installers.js.map +1 -0
- package/dist/mcp-server.js +3 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/postinstall.d.ts +3 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +13 -0
- package/dist/postinstall.js.map +1 -0
- package/dist/runtime/audit.d.ts +10 -0
- package/dist/runtime/audit.d.ts.map +1 -0
- package/dist/runtime/audit.js +94 -0
- package/dist/runtime/audit.js.map +1 -0
- package/dist/runtime/evaluator.d.ts +3 -0
- package/dist/runtime/evaluator.d.ts.map +1 -0
- package/dist/runtime/evaluator.js +197 -0
- package/dist/runtime/evaluator.js.map +1 -0
- package/dist/runtime/policy.d.ts +12 -0
- package/dist/runtime/policy.d.ts.map +1 -0
- package/dist/runtime/policy.js +81 -0
- package/dist/runtime/policy.js.map +1 -0
- package/dist/runtime/protect.d.ts +22 -0
- package/dist/runtime/protect.d.ts.map +1 -0
- package/dist/runtime/protect.js +172 -0
- package/dist/runtime/protect.js.map +1 -0
- package/dist/runtime/redaction.d.ts +6 -0
- package/dist/runtime/redaction.d.ts.map +1 -0
- package/dist/runtime/redaction.js +103 -0
- package/dist/runtime/redaction.js.map +1 -0
- package/dist/runtime/types.d.ts +62 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +3 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/tests/cloud-live.test.d.ts +2 -0
- package/dist/tests/cloud-live.test.d.ts.map +1 -0
- package/dist/tests/cloud-live.test.js +68 -0
- package/dist/tests/cloud-live.test.js.map +1 -0
- package/dist/tests/feed-cloud.test.d.ts +2 -0
- package/dist/tests/feed-cloud.test.d.ts.map +1 -0
- package/dist/tests/feed-cloud.test.js +93 -0
- package/dist/tests/feed-cloud.test.js.map +1 -0
- package/dist/tests/feed-selfcheck.test.d.ts +2 -0
- package/dist/tests/feed-selfcheck.test.d.ts.map +1 -0
- package/dist/tests/feed-selfcheck.test.js +118 -0
- package/dist/tests/feed-selfcheck.test.js.map +1 -0
- package/dist/tests/installer.test.d.ts +2 -0
- package/dist/tests/installer.test.d.ts.map +1 -0
- package/dist/tests/installer.test.js +32 -0
- package/dist/tests/installer.test.js.map +1 -0
- package/dist/tests/runtime-cloud.test.d.ts +2 -0
- package/dist/tests/runtime-cloud.test.d.ts.map +1 -0
- package/dist/tests/runtime-cloud.test.js +206 -0
- package/dist/tests/runtime-cloud.test.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/docs/SECURITY-POLICY.md +558 -0
- package/docs/architecture.md +54 -0
- package/docs/claude-code.md +41 -0
- package/docs/cloud-connect.md +73 -0
- package/docs/cloud-native-api.md +526 -0
- package/docs/codex.md +38 -0
- package/docs/goplus-api.md +38 -0
- package/docs/mcp-server.md +39 -0
- package/docs/openclaw.md +41 -0
- package/docs/privacy-boundary.md +37 -0
- package/docs/sdk.md +83 -0
- package/docs/trust-cli.md +58 -0
- package/examples/openclaw-docker/Dockerfile +10 -0
- package/examples/openclaw-docker/README.md +16 -0
- package/examples/openclaw-docker/docker-compose.yml +8 -0
- package/examples/openclaw-docker/plugin.ts +8 -0
- package/package.json +7 -2
- package/skills/agentguard/SKILL.md +19 -0
- package/skills/agentguard/package.json +2 -1
- package/skills/agentguard/scripts/checkup-report.js +2 -15
package/dist/config.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAgentGuardPaths = getAgentGuardPaths;
|
|
4
|
+
exports.defaultConfig = defaultConfig;
|
|
5
|
+
exports.ensureAgentGuardHome = ensureAgentGuardHome;
|
|
6
|
+
exports.ensureConfig = ensureConfig;
|
|
7
|
+
exports.loadConfig = loadConfig;
|
|
8
|
+
exports.saveConfig = saveConfig;
|
|
9
|
+
exports.connectCloud = connectCloud;
|
|
10
|
+
exports.maskApiKey = maskApiKey;
|
|
11
|
+
exports.validateApiKey = validateApiKey;
|
|
12
|
+
exports.normalizeCloudUrl = normalizeCloudUrl;
|
|
13
|
+
const node_fs_1 = require("node:fs");
|
|
14
|
+
const node_path_1 = require("node:path");
|
|
15
|
+
const node_os_1 = require("node:os");
|
|
16
|
+
const DEFAULT_CLOUD_URL = 'https://agentguard.gopluslabs.io';
|
|
17
|
+
const API_KEY_PATTERN = /^ag_live_[A-Za-z0-9_-]{8,}$/;
|
|
18
|
+
function getAgentGuardPaths() {
|
|
19
|
+
const home = process.env.AGENTGUARD_HOME || (0, node_path_1.join)((0, node_os_1.homedir)(), '.agentguard');
|
|
20
|
+
return {
|
|
21
|
+
home,
|
|
22
|
+
configPath: (0, node_path_1.join)(home, 'config.json'),
|
|
23
|
+
policyCachePath: (0, node_path_1.join)(home, 'policy-cache.json'),
|
|
24
|
+
auditPath: (0, node_path_1.join)(home, 'audit.jsonl'),
|
|
25
|
+
eventSpoolPath: (0, node_path_1.join)(home, 'events-spool.jsonl'),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function defaultConfig() {
|
|
29
|
+
const paths = getAgentGuardPaths();
|
|
30
|
+
return {
|
|
31
|
+
version: 1,
|
|
32
|
+
level: 'balanced',
|
|
33
|
+
cloudUrl: DEFAULT_CLOUD_URL,
|
|
34
|
+
policyCachePath: paths.policyCachePath,
|
|
35
|
+
auditPath: paths.auditPath,
|
|
36
|
+
eventSpoolPath: paths.eventSpoolPath,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function ensureAgentGuardHome() {
|
|
40
|
+
const paths = getAgentGuardPaths();
|
|
41
|
+
(0, node_fs_1.mkdirSync)(paths.home, { recursive: true, mode: 0o700 });
|
|
42
|
+
chmodBestEffort(paths.home, 0o700);
|
|
43
|
+
return paths;
|
|
44
|
+
}
|
|
45
|
+
function ensureConfig() {
|
|
46
|
+
const paths = ensureAgentGuardHome();
|
|
47
|
+
if (!(0, node_fs_1.existsSync)(paths.configPath)) {
|
|
48
|
+
const config = defaultConfig();
|
|
49
|
+
saveConfig(config);
|
|
50
|
+
return config;
|
|
51
|
+
}
|
|
52
|
+
return loadConfig();
|
|
53
|
+
}
|
|
54
|
+
function loadConfig() {
|
|
55
|
+
const fallback = defaultConfig();
|
|
56
|
+
try {
|
|
57
|
+
const paths = getAgentGuardPaths();
|
|
58
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(paths.configPath, 'utf8'));
|
|
59
|
+
return {
|
|
60
|
+
...fallback,
|
|
61
|
+
...parsed,
|
|
62
|
+
version: 1,
|
|
63
|
+
level: normalizeLevel(parsed.level) ?? fallback.level,
|
|
64
|
+
cloudUrl: parsed.cloudUrl || fallback.cloudUrl,
|
|
65
|
+
policyCachePath: parsed.policyCachePath || fallback.policyCachePath,
|
|
66
|
+
auditPath: parsed.auditPath || fallback.auditPath,
|
|
67
|
+
eventSpoolPath: parsed.eventSpoolPath || fallback.eventSpoolPath,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return fallback;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function saveConfig(config) {
|
|
75
|
+
const paths = ensureAgentGuardHome();
|
|
76
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(paths.configPath), { recursive: true });
|
|
77
|
+
(0, node_fs_1.writeFileSync)(paths.configPath, `${JSON.stringify(config, null, 2)}\n`, { mode: 0o600 });
|
|
78
|
+
chmodBestEffort(paths.configPath, 0o600);
|
|
79
|
+
}
|
|
80
|
+
function connectCloud(options) {
|
|
81
|
+
const current = ensureConfig();
|
|
82
|
+
validateApiKey(options.apiKey);
|
|
83
|
+
const next = {
|
|
84
|
+
...current,
|
|
85
|
+
cloudUrl: normalizeCloudUrl(options.cloudUrl || current.cloudUrl || DEFAULT_CLOUD_URL),
|
|
86
|
+
apiKey: options.apiKey,
|
|
87
|
+
connectedAt: new Date().toISOString(),
|
|
88
|
+
};
|
|
89
|
+
saveConfig(next);
|
|
90
|
+
return next;
|
|
91
|
+
}
|
|
92
|
+
function maskApiKey(apiKey) {
|
|
93
|
+
if (!apiKey)
|
|
94
|
+
return 'not configured';
|
|
95
|
+
if (apiKey.length <= 12)
|
|
96
|
+
return `${apiKey.slice(0, 4)}…`;
|
|
97
|
+
return `${apiKey.slice(0, 8)}…${apiKey.slice(-4)}`;
|
|
98
|
+
}
|
|
99
|
+
function validateApiKey(apiKey) {
|
|
100
|
+
if (!API_KEY_PATTERN.test(apiKey)) {
|
|
101
|
+
throw new Error('Invalid AgentGuard API key format. Expected an ag_live_ key.');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '::1', '0.0.0.0']);
|
|
105
|
+
function normalizeCloudUrl(value) {
|
|
106
|
+
const normalized = value.replace(/\/+$/, '');
|
|
107
|
+
let parsed;
|
|
108
|
+
try {
|
|
109
|
+
parsed = new URL(normalized);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
throw new Error('Invalid Cloud URL.');
|
|
113
|
+
}
|
|
114
|
+
const isLoopback = LOOPBACK_HOSTS.has(parsed.hostname);
|
|
115
|
+
if (parsed.protocol !== 'https:' && !(parsed.protocol === 'http:' && isLoopback)) {
|
|
116
|
+
throw new Error('Invalid Cloud URL. AgentGuard Cloud URLs must use https:// (http:// allowed only for loopback hosts).');
|
|
117
|
+
}
|
|
118
|
+
return normalized;
|
|
119
|
+
}
|
|
120
|
+
function normalizeLevel(value) {
|
|
121
|
+
return value === 'strict' || value === 'balanced' || value === 'permissive'
|
|
122
|
+
? value
|
|
123
|
+
: null;
|
|
124
|
+
}
|
|
125
|
+
function chmodBestEffort(path, mode) {
|
|
126
|
+
try {
|
|
127
|
+
(0, node_fs_1.chmodSync)(path, mode);
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
// Best-effort hardening for platforms/filesystems that support chmod.
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AA0BA,gDASC;AAED,sCAUC;AAED,oDAKC;AAED,oCAQC;AAED,gCAkBC;AAED,gCAKC;AAED,oCAWC;AAED,gCAIC;AAED,wCAIC;AAID,8CAeC;AAvID,qCAAwF;AACxF,yCAA0C;AAC1C,qCAAkC;AAqBlC,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAC7D,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAEtD,SAAgB,kBA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,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CACb,uGAAuG,CACxG,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,YAAY;QACzE,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,IAAY;IACjD,IAAI,CAAC;QACH,IAAA,mBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,sEAAsE;IACxE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-check engine — runs a single threat-feed advisory against the locally
|
|
3
|
+
* installed skills / plugins / MCP servers and reports which artifacts match.
|
|
4
|
+
*
|
|
5
|
+
* Designed to be cheap (read-only filesystem ops, hashing only when an
|
|
6
|
+
* advisory actually asks for a hash) and never crash on a single bad artifact.
|
|
7
|
+
*/
|
|
8
|
+
import type { Advisory, SelfCheckResult } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Default search locations for each ecosystem.
|
|
11
|
+
*
|
|
12
|
+
* Skill locations cover the four agent frameworks that use the agentskills.io
|
|
13
|
+
* SKILL.md standard: Claude Code, OpenClaw, Hermes Agent, Cursor (project
|
|
14
|
+
* scope only — caller can supply extra roots). MCP server locations cover
|
|
15
|
+
* Claude Code's `~/.claude.json` and Codex's `~/.codex/config.toml` install
|
|
16
|
+
* conventions, but inspection of those is config-aware and lives elsewhere.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DEFAULT_SKILL_ROOTS: string[];
|
|
19
|
+
export interface RunSelfCheckOptions {
|
|
20
|
+
/** Override the default per-ecosystem search roots. */
|
|
21
|
+
skillRoots?: string[];
|
|
22
|
+
/** Cap on hashing work: skill dirs beyond this count are skipped. */
|
|
23
|
+
maxArtifacts?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Run one advisory against the local environment. Never throws — failures
|
|
27
|
+
* become warnings on the result so the caller can keep iterating advisories.
|
|
28
|
+
*/
|
|
29
|
+
export declare function runSelfCheckForAdvisory(advisory: Advisory, options?: RunSelfCheckOptions): Promise<SelfCheckResult>;
|
|
30
|
+
export declare function safeRegexTest(pattern: string, body: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Simple glob match supporting `*` as a single-segment wildcard. Sufficient
|
|
33
|
+
* for `slack-webhook-*` style advisories without pulling in a glob lib.
|
|
34
|
+
*/
|
|
35
|
+
export declare function globMatch(pattern: string, value: string): boolean;
|
|
36
|
+
//# sourceMappingURL=selfcheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selfcheck.d.ts","sourceRoot":"","sources":["../../src/feed/selfcheck.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EACV,QAAQ,EAGR,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,UAK/B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,eAAe,CAAC,CAqC1B;AAgGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAiBpE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAOjE"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Self-check engine — runs a single threat-feed advisory against the locally
|
|
4
|
+
* installed skills / plugins / MCP servers and reports which artifacts match.
|
|
5
|
+
*
|
|
6
|
+
* Designed to be cheap (read-only filesystem ops, hashing only when an
|
|
7
|
+
* advisory actually asks for a hash) and never crash on a single bad artifact.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DEFAULT_SKILL_ROOTS = void 0;
|
|
11
|
+
exports.runSelfCheckForAdvisory = runSelfCheckForAdvisory;
|
|
12
|
+
exports.safeRegexTest = safeRegexTest;
|
|
13
|
+
exports.globMatch = globMatch;
|
|
14
|
+
const node_fs_1 = require("node:fs");
|
|
15
|
+
const promises_1 = require("node:fs/promises");
|
|
16
|
+
const node_os_1 = require("node:os");
|
|
17
|
+
const node_path_1 = require("node:path");
|
|
18
|
+
const hash_js_1 = require("../utils/hash.js");
|
|
19
|
+
/**
|
|
20
|
+
* Default search locations for each ecosystem.
|
|
21
|
+
*
|
|
22
|
+
* Skill locations cover the four agent frameworks that use the agentskills.io
|
|
23
|
+
* SKILL.md standard: Claude Code, OpenClaw, Hermes Agent, Cursor (project
|
|
24
|
+
* scope only — caller can supply extra roots). MCP server locations cover
|
|
25
|
+
* Claude Code's `~/.claude.json` and Codex's `~/.codex/config.toml` install
|
|
26
|
+
* conventions, but inspection of those is config-aware and lives elsewhere.
|
|
27
|
+
*/
|
|
28
|
+
exports.DEFAULT_SKILL_ROOTS = [
|
|
29
|
+
(0, node_path_1.join)((0, node_os_1.homedir)(), '.claude', 'skills'),
|
|
30
|
+
(0, node_path_1.join)((0, node_os_1.homedir)(), '.openclaw', 'skills'),
|
|
31
|
+
(0, node_path_1.join)((0, node_os_1.homedir)(), '.openclaw', 'workspace', 'skills'),
|
|
32
|
+
(0, node_path_1.join)((0, node_os_1.homedir)(), '.hermes', 'skills'),
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Run one advisory against the local environment. Never throws — failures
|
|
36
|
+
* become warnings on the result so the caller can keep iterating advisories.
|
|
37
|
+
*/
|
|
38
|
+
async function runSelfCheckForAdvisory(advisory, options = {}) {
|
|
39
|
+
const startedAt = Date.now();
|
|
40
|
+
const matches = [];
|
|
41
|
+
const warnings = [];
|
|
42
|
+
if (advisory.withdrawnAt) {
|
|
43
|
+
return { advisoryId: advisory.id, matchedArtifacts: [], elapsedMs: 0, warnings };
|
|
44
|
+
}
|
|
45
|
+
if (advisory.ecosystem !== 'skill') {
|
|
46
|
+
warnings.push(`ecosystem "${advisory.ecosystem}" not implemented; only "skill" is supported in this build`);
|
|
47
|
+
return { advisoryId: advisory.id, matchedArtifacts: [], elapsedMs: Date.now() - startedAt, warnings };
|
|
48
|
+
}
|
|
49
|
+
const roots = options.skillRoots ?? exports.DEFAULT_SKILL_ROOTS;
|
|
50
|
+
const skillDirs = await listSkillDirs(roots);
|
|
51
|
+
const cap = options.maxArtifacts ?? 500;
|
|
52
|
+
const considered = skillDirs.slice(0, cap);
|
|
53
|
+
if (skillDirs.length > cap) {
|
|
54
|
+
warnings.push(`only checked first ${cap} of ${skillDirs.length} skill directories`);
|
|
55
|
+
}
|
|
56
|
+
for (const dir of considered) {
|
|
57
|
+
try {
|
|
58
|
+
const m = await matchSkillDir(dir, advisory.affected);
|
|
59
|
+
if (m)
|
|
60
|
+
matches.push(m);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
warnings.push(`skipped ${dir}: ${err.message}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
advisoryId: advisory.id,
|
|
68
|
+
matchedArtifacts: matches,
|
|
69
|
+
elapsedMs: Date.now() - startedAt,
|
|
70
|
+
warnings,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Enumerate every immediate subdirectory of `roots` that contains a SKILL.md. */
|
|
74
|
+
async function listSkillDirs(roots) {
|
|
75
|
+
const found = [];
|
|
76
|
+
for (const root of roots) {
|
|
77
|
+
if (!(0, node_fs_1.existsSync)(root))
|
|
78
|
+
continue;
|
|
79
|
+
let entries;
|
|
80
|
+
try {
|
|
81
|
+
entries = await (0, promises_1.readdir)(root, { withFileTypes: true });
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
if (!entry.isDirectory())
|
|
88
|
+
continue;
|
|
89
|
+
const skillPath = (0, node_path_1.join)(root, entry.name);
|
|
90
|
+
const manifest = (0, node_path_1.join)(skillPath, 'SKILL.md');
|
|
91
|
+
if ((0, node_fs_1.existsSync)(manifest))
|
|
92
|
+
found.push(skillPath);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return found;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Match one skill directory against an advisory's affected[] matchers.
|
|
99
|
+
* Returns the first match found (per matcher precedence: hash > regex > name).
|
|
100
|
+
* Returns null when nothing matched.
|
|
101
|
+
*/
|
|
102
|
+
async function matchSkillDir(skillDir, affected) {
|
|
103
|
+
const name = (0, node_path_1.basename)(skillDir);
|
|
104
|
+
const manifestPath = (0, node_path_1.join)(skillDir, 'SKILL.md');
|
|
105
|
+
// Canonical hash input: the SKILL.md content. The cloud publishes
|
|
106
|
+
// SKILL.md hashes (not directory rollups), so this is the field that
|
|
107
|
+
// must match server-side for `sha256` matchers to be meaningful.
|
|
108
|
+
let localHash = null;
|
|
109
|
+
const wantsHash = affected.some((m) => m.sha256);
|
|
110
|
+
if (wantsHash && (0, node_fs_1.existsSync)(manifestPath)) {
|
|
111
|
+
try {
|
|
112
|
+
localHash = await (0, hash_js_1.hashFile)(manifestPath);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
localHash = null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Regex matching needs the manifest body — only read if some matcher asks.
|
|
119
|
+
let body = null;
|
|
120
|
+
const wantsBody = affected.some((m) => m.bodyRegex);
|
|
121
|
+
if (wantsBody) {
|
|
122
|
+
try {
|
|
123
|
+
body = await (0, promises_1.readFile)(manifestPath, 'utf8');
|
|
124
|
+
// Cap body length to keep regex evaluation bounded.
|
|
125
|
+
if (body.length > MAX_BODY_BYTES)
|
|
126
|
+
body = body.slice(0, MAX_BODY_BYTES);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
body = '';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
for (const matcher of affected) {
|
|
133
|
+
if (matcher.sha256 && localHash && matcher.sha256.toLowerCase() === localHash.toLowerCase()) {
|
|
134
|
+
return { path: skillDir, matchedBy: 'sha256', hash: localHash };
|
|
135
|
+
}
|
|
136
|
+
if (matcher.bodyRegex && body !== null) {
|
|
137
|
+
if (safeRegexTest(matcher.bodyRegex, body)) {
|
|
138
|
+
return { path: skillDir, matchedBy: 'bodyRegex' };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (matcher.namePattern && globMatch(matcher.namePattern, name)) {
|
|
142
|
+
return { path: skillDir, matchedBy: 'namePattern' };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Defense against catastrophic backtracking and malformed regex coming
|
|
149
|
+
* from upstream advisory data:
|
|
150
|
+
* - cap the pattern length
|
|
151
|
+
* - reject patterns with obvious nested-quantifier shapes that explode
|
|
152
|
+
* under ReDoS (e.g. `(.+)+`, `(a*)*`, `(a|a)*`)
|
|
153
|
+
* - swallow compile errors silently (treated as "no match")
|
|
154
|
+
*
|
|
155
|
+
* Node's RegExp has no built-in timeout; the cheap-but-effective fix is
|
|
156
|
+
* to bound both the pattern and the body. We accept a slight false-negative
|
|
157
|
+
* rate over freezing on a hostile feed.
|
|
158
|
+
*/
|
|
159
|
+
const MAX_REGEX_LEN = 256;
|
|
160
|
+
const MAX_BODY_BYTES = 256 * 1024;
|
|
161
|
+
const CATASTROPHIC = [
|
|
162
|
+
/\([^)]*[+*]\)[+*]/, // nested quantifier: (x+)+
|
|
163
|
+
/\(([^|()]+\|)+\1\)[+*]/, // alternation duplicate: (a|a)*
|
|
164
|
+
];
|
|
165
|
+
function safeRegexTest(pattern, body) {
|
|
166
|
+
if (typeof pattern !== 'string' || pattern.length === 0)
|
|
167
|
+
return false;
|
|
168
|
+
if (pattern.length > MAX_REGEX_LEN)
|
|
169
|
+
return false;
|
|
170
|
+
for (const danger of CATASTROPHIC) {
|
|
171
|
+
if (danger.test(pattern))
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
let re;
|
|
175
|
+
try {
|
|
176
|
+
re = new RegExp(pattern);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
return re.test(body);
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Simple glob match supporting `*` as a single-segment wildcard. Sufficient
|
|
190
|
+
* for `slack-webhook-*` style advisories without pulling in a glob lib.
|
|
191
|
+
*/
|
|
192
|
+
function globMatch(pattern, value) {
|
|
193
|
+
const re = new RegExp('^' +
|
|
194
|
+
pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '[^/]*') +
|
|
195
|
+
'$');
|
|
196
|
+
return re.test(value);
|
|
197
|
+
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
* Local feed-subscription state I/O.
|
|
3
|
+
*
|
|
4
|
+
* Persisted at `~/.agentguard/feed-state.json` so the `subscribe` command
|
|
5
|
+
* doesn't re-process the same advisory across invocations / cron ticks.
|
|
6
|
+
*
|
|
7
|
+
* Kept tiny (single JSON object) on purpose — bigger ledgers go through the
|
|
8
|
+
* audit log path, not here.
|
|
9
|
+
*/
|
|
10
|
+
import type { FeedState } from './types.js';
|
|
11
|
+
export declare function loadFeedState(): FeedState;
|
|
12
|
+
export declare function saveFeedState(state: FeedState): void;
|
|
13
|
+
export declare function markAdvisorySeen(state: FeedState, advisoryId: string): FeedState;
|
|
14
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/feed/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,wBAAgB,aAAa,IAAI,SAAS,CAezC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAQpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAOhF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Local feed-subscription state I/O.
|
|
4
|
+
*
|
|
5
|
+
* Persisted at `~/.agentguard/feed-state.json` so the `subscribe` command
|
|
6
|
+
* doesn't re-process the same advisory across invocations / cron ticks.
|
|
7
|
+
*
|
|
8
|
+
* Kept tiny (single JSON object) on purpose — bigger ledgers go through the
|
|
9
|
+
* audit log path, not here.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.loadFeedState = loadFeedState;
|
|
13
|
+
exports.saveFeedState = saveFeedState;
|
|
14
|
+
exports.markAdvisorySeen = markAdvisorySeen;
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const config_js_1 = require("../config.js");
|
|
18
|
+
const SEEN_ID_LIMIT = 1000;
|
|
19
|
+
function statePath() {
|
|
20
|
+
return (0, node_path_1.join)((0, config_js_1.getAgentGuardPaths)().home, 'feed-state.json');
|
|
21
|
+
}
|
|
22
|
+
function loadFeedState() {
|
|
23
|
+
const file = statePath();
|
|
24
|
+
if (!(0, node_fs_1.existsSync)(file))
|
|
25
|
+
return {};
|
|
26
|
+
try {
|
|
27
|
+
const raw = (0, node_fs_1.readFileSync)(file, 'utf8');
|
|
28
|
+
const parsed = JSON.parse(raw);
|
|
29
|
+
return {
|
|
30
|
+
lastPulledAt: parsed.lastPulledAt,
|
|
31
|
+
seenAdvisoryIds: parsed.seenAdvisoryIds ?? [],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Corrupt state file: pretend it's empty rather than crash. The next
|
|
36
|
+
// successful subscribe will overwrite it.
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function saveFeedState(state) {
|
|
41
|
+
const file = statePath();
|
|
42
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(file), { recursive: true });
|
|
43
|
+
const trimmed = {
|
|
44
|
+
lastPulledAt: state.lastPulledAt,
|
|
45
|
+
seenAdvisoryIds: (state.seenAdvisoryIds ?? []).slice(-SEEN_ID_LIMIT),
|
|
46
|
+
};
|
|
47
|
+
(0, node_fs_1.writeFileSync)(file, `${JSON.stringify(trimmed, null, 2)}\n`, { mode: 0o600 });
|
|
48
|
+
}
|
|
49
|
+
function markAdvisorySeen(state, advisoryId) {
|
|
50
|
+
const set = new Set(state.seenAdvisoryIds ?? []);
|
|
51
|
+
set.add(advisoryId);
|
|
52
|
+
return {
|
|
53
|
+
...state,
|
|
54
|
+
seenAdvisoryIds: [...set],
|
|
55
|
+
};
|
|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CAAC,aAAa,CAAC;KACrE,CAAC;IACF,IAAA,uBAAa,EAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAgB,EAAE,UAAkB;IACnE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IACjD,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACpB,OAAO;QACL,GAAG,KAAK;QACR,eAAe,EAAE,CAAC,GAAG,GAAG,CAAC;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Threat-feed advisory types.
|
|
3
|
+
*
|
|
4
|
+
* AgentGuard Cloud publishes `Advisory` objects describing newly discovered
|
|
5
|
+
* supply-chain threats (malicious skills, rugged MCP servers, prompt-injection
|
|
6
|
+
* patterns in popular plugins). Subscribing local guards pull the feed,
|
|
7
|
+
* run a targeted self-check, and report back which local artifacts matched.
|
|
8
|
+
*
|
|
9
|
+
* Schema intentionally mirrors the OSV.dev advisory shape (signed JSON over
|
|
10
|
+
* HTTPS, `affected[]` array of identifier matchers) so the feed can later be
|
|
11
|
+
* federated with OSV and OSS Insight.
|
|
12
|
+
*/
|
|
13
|
+
/** Supply-chain ecosystem an advisory targets. */
|
|
14
|
+
export type AdvisoryEcosystem = 'skill' | 'plugin' | 'mcp_server';
|
|
15
|
+
export type AdvisorySeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
16
|
+
/**
|
|
17
|
+
* One matcher inside `Advisory.affected[]`. A local artifact matches the
|
|
18
|
+
* advisory if ANY matcher matches. A matcher matches if ALL of its fields
|
|
19
|
+
* that are set match the artifact (so name + hash narrows the match).
|
|
20
|
+
*/
|
|
21
|
+
export interface AdvisoryAffected {
|
|
22
|
+
/**
|
|
23
|
+
* Glob-ish name pattern matched against the skill's `name` field or the
|
|
24
|
+
* containing directory name. Supports `*` as a single-segment wildcard.
|
|
25
|
+
* Example: `slack-webhook-*`.
|
|
26
|
+
*/
|
|
27
|
+
namePattern?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Specific SHA-256 hash (hex, lowercase) of the artifact's content
|
|
30
|
+
* (a directory hash for skill dirs, file hash for single-file artifacts).
|
|
31
|
+
* Exact match.
|
|
32
|
+
*/
|
|
33
|
+
sha256?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Optional semver range. Reserved for future use — current matchers
|
|
36
|
+
* ignore version unless explicitly set. Tools should treat unknown ranges
|
|
37
|
+
* as "match any version" rather than fail closed.
|
|
38
|
+
*/
|
|
39
|
+
versionRange?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Optional regex applied to the textual body of `SKILL.md` (or the file
|
|
42
|
+
* contents for non-skill artifacts). Use this when the threat manifests as
|
|
43
|
+
* a code/text pattern rather than a known hash.
|
|
44
|
+
*/
|
|
45
|
+
bodyRegex?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface Advisory {
|
|
48
|
+
/** Stable identifier, e.g. `AGS-2026-0042`. */
|
|
49
|
+
id: string;
|
|
50
|
+
ecosystem: AdvisoryEcosystem;
|
|
51
|
+
severity: AdvisorySeverity;
|
|
52
|
+
/** Short headline. <= 120 chars. */
|
|
53
|
+
summary: string;
|
|
54
|
+
/** Long-form markdown body. May include remediation steps. */
|
|
55
|
+
detailsMd: string;
|
|
56
|
+
/** Matchers — local artifact matches the advisory if ANY entry matches. */
|
|
57
|
+
affected: AdvisoryAffected[];
|
|
58
|
+
/** ISO-8601 timestamp when published. */
|
|
59
|
+
publishedAt: string;
|
|
60
|
+
/** Optional withdrawal timestamp — if set, the advisory was retracted. */
|
|
61
|
+
withdrawnAt?: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Optional HMAC-SHA256 hex signature of the canonical JSON payload, signed
|
|
64
|
+
* with the cloud's per-publisher key. Subscribers can verify integrity if
|
|
65
|
+
* they have the verifier key. Empty when the cloud doesn't sign yet.
|
|
66
|
+
*/
|
|
67
|
+
signature?: string;
|
|
68
|
+
/** External references — Snyk, NVD, GHSA, blog posts. */
|
|
69
|
+
references?: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Local feed-subscription state. Persisted between `subscribe` runs so the
|
|
73
|
+
* client doesn't re-process advisories it has already seen.
|
|
74
|
+
*/
|
|
75
|
+
export interface FeedState {
|
|
76
|
+
/** ISO-8601 timestamp of the latest advisory `publishedAt` we've processed. */
|
|
77
|
+
lastPulledAt?: string;
|
|
78
|
+
/** Stable IDs of advisories already evaluated; bounded LRU. */
|
|
79
|
+
seenAdvisoryIds?: string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Result of running a single advisory's checks against the local environment.
|
|
83
|
+
*/
|
|
84
|
+
export interface SelfCheckResult {
|
|
85
|
+
advisoryId: string;
|
|
86
|
+
/** Always populated, even when empty (means "we checked, nothing matched"). */
|
|
87
|
+
matchedArtifacts: SelfCheckMatch[];
|
|
88
|
+
/** Wall-clock duration in milliseconds. */
|
|
89
|
+
elapsedMs: number;
|
|
90
|
+
/** Errors per-matcher that prevented a definitive answer. Non-fatal. */
|
|
91
|
+
warnings: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface SelfCheckMatch {
|
|
94
|
+
/** Local path to the matched artifact (skill dir / file). Redaction is the
|
|
95
|
+
* caller's responsibility before reporting upstream. */
|
|
96
|
+
path: string;
|
|
97
|
+
/** Which matcher hit. Useful for explaining "why" to the user. */
|
|
98
|
+
matchedBy: 'namePattern' | 'sha256' | 'bodyRegex';
|
|
99
|
+
/** When matched by hash, this is the local hash that equalled the advisory's. */
|
|
100
|
+
hash?: string;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types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;IAC/E,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B;6DACyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,SAAS,EAAE,aAAa,GAAG,QAAQ,GAAG,WAAW,CAAC;IAClD,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Threat-feed advisory types.
|
|
4
|
+
*
|
|
5
|
+
* AgentGuard Cloud publishes `Advisory` objects describing newly discovered
|
|
6
|
+
* supply-chain threats (malicious skills, rugged MCP servers, prompt-injection
|
|
7
|
+
* patterns in popular plugins). Subscribing local guards pull the feed,
|
|
8
|
+
* run a targeted self-check, and report back which local artifacts matched.
|
|
9
|
+
*
|
|
10
|
+
* Schema intentionally mirrors the OSV.dev advisory shape (signed JSON over
|
|
11
|
+
* HTTPS, `affected[]` array of identifier matchers) so the feed can later be
|
|
12
|
+
* federated with OSV and OSS Insight.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/feed/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,13 @@ export { ActionScanner, GoPlusClient, type ActionScannerOptions, } from './actio
|
|
|
13
13
|
export { DEFAULT_POLICIES, RESTRICTIVE_CAPABILITY, PERMISSIVE_CAPABILITY, CAPABILITY_PRESETS, type PolicyConfig, } from './policy/default.js';
|
|
14
14
|
export { containsSensitiveData, maskSensitiveData, extractDomain, isDomainAllowed, SENSITIVE_PATTERNS, } from './utils/patterns.js';
|
|
15
15
|
export { ClaudeCodeAdapter, OpenClawAdapter, evaluateHook, registerOpenClawPlugin, loadConfig, type HookAdapter, type HookInput, type HookOutput, type EngineOptions, } from './adapters/index.js';
|
|
16
|
+
export { ensureConfig, loadConfig as loadAgentGuardConfig, saveConfig as saveAgentGuardConfig, connectCloud, getAgentGuardPaths, type AgentGuardConfig, } from './config.js';
|
|
17
|
+
export { AgentGuardCloudClient } from './cloud/client.js';
|
|
18
|
+
export { evaluateLocalAction } from './runtime/evaluator.js';
|
|
19
|
+
export { protectAction, formatProtectResult, exitCodeForDecision, type ProtectOptions, type ProtectResult, } from './runtime/protect.js';
|
|
20
|
+
export { redactText, redactPreview, redactReasons } from './runtime/redaction.js';
|
|
21
|
+
export { getDefaultEffectiveRuntimePolicy, loadCachedPolicy, saveCachedPolicy, resolveRuntimePolicy, } from './runtime/policy.js';
|
|
22
|
+
export type { EffectiveRuntimePolicy, RuntimeAction, RuntimeDecision, RuntimeAuditEvent, RuntimeActionType, RuntimeAgentHost, CloudPolicyDecision, } from './runtime/types.js';
|
|
16
23
|
import { SkillScanner } from './scanner/index.js';
|
|
17
24
|
import { SkillRegistry } from './registry/index.js';
|
|
18
25
|
import { ActionScanner } from './action/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACL,aAAa,EACb,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,oBAAoB,GAC1B,MAAM,m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