clikit-plugin 0.2.15 → 0.2.16
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.
|
@@ -16,5 +16,5 @@ export interface SecurityCheckResult {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function scanContentForSecrets(content: string, filename?: string): SecurityCheckResult;
|
|
18
18
|
export declare function isSensitiveFile(filepath: string): boolean;
|
|
19
|
-
export declare function formatSecurityWarning(result: SecurityCheckResult): string;
|
|
19
|
+
export declare function formatSecurityWarning(result: SecurityCheckResult | unknown): string;
|
|
20
20
|
//# sourceMappingURL=security-check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-check.d.ts","sourceRoot":"","sources":["../../src/hooks/security-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"security-check.d.ts","sourceRoot":"","sources":["../../src/hooks/security-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AA2BD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAmB7F;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,GAAG,MAAM,CAWnF"}
|
package/dist/index.js
CHANGED
|
@@ -3962,6 +3962,24 @@ var SENSITIVE_FILES = [
|
|
|
3962
3962
|
/id_rsa$/,
|
|
3963
3963
|
/id_ed25519$/
|
|
3964
3964
|
];
|
|
3965
|
+
function normalizeSecurityResult(result) {
|
|
3966
|
+
if (!result || typeof result !== "object") {
|
|
3967
|
+
return { safe: true, findings: [] };
|
|
3968
|
+
}
|
|
3969
|
+
const raw = result;
|
|
3970
|
+
const findings = Array.isArray(raw.findings) ? raw.findings.filter((item) => !!item && typeof item === "object").map((record) => {
|
|
3971
|
+
return {
|
|
3972
|
+
type: typeof record.type === "string" ? record.type : "Unknown",
|
|
3973
|
+
file: typeof record.file === "string" ? record.file : undefined,
|
|
3974
|
+
line: typeof record.line === "number" ? record.line : undefined,
|
|
3975
|
+
snippet: typeof record.snippet === "string" ? record.snippet : undefined
|
|
3976
|
+
};
|
|
3977
|
+
}) : [];
|
|
3978
|
+
return {
|
|
3979
|
+
safe: typeof raw.safe === "boolean" ? raw.safe : findings.length === 0,
|
|
3980
|
+
findings
|
|
3981
|
+
};
|
|
3982
|
+
}
|
|
3965
3983
|
function scanContentForSecrets(content, filename) {
|
|
3966
3984
|
if (typeof content !== "string")
|
|
3967
3985
|
return { safe: true, findings: [] };
|
|
@@ -3986,8 +4004,9 @@ function isSensitiveFile(filepath) {
|
|
|
3986
4004
|
return SENSITIVE_FILES.some((pattern) => pattern.test(filepath));
|
|
3987
4005
|
}
|
|
3988
4006
|
function formatSecurityWarning(result) {
|
|
4007
|
+
const safeResult = normalizeSecurityResult(result);
|
|
3989
4008
|
const lines = ["[CliKit:security] Potential secrets detected:"];
|
|
3990
|
-
for (const f of
|
|
4009
|
+
for (const f of safeResult.findings) {
|
|
3991
4010
|
lines.push(` - ${f.type}${f.file ? ` in ${f.file}` : ""}${f.line ? `:${f.line}` : ""}`);
|
|
3992
4011
|
if (f.snippet) {
|
|
3993
4012
|
lines.push(` ${f.snippet.substring(0, 60)}...`);
|
package/memory/memory.db
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clikit-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "OpenCode plugin with 10 agents, 19 commands, 48 skills, 14 hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,11 +52,12 @@
|
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://github.com/KiraKas-Tr/CliKit#readme",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@opencode-ai/plugin": "1.2.
|
|
55
|
+
"@opencode-ai/plugin": "1.2.4",
|
|
56
56
|
"gray-matter": "^4.0.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"bun-types": "latest",
|
|
60
|
+
"clikit-plugin": "^0.2.15",
|
|
60
61
|
"typescript": "^5.7.3"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|