clikit-plugin 0.2.15 → 0.2.17

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;AAED,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,MAAM,CAUzE"}
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"}
@@ -27,5 +27,5 @@ export declare function isTypeScriptFile(filePath: unknown): boolean;
27
27
  export declare function findTsConfig(projectDir: unknown, override?: string): string | undefined;
28
28
  export declare function hasTscInstalled(projectDir: unknown): boolean;
29
29
  export declare function runTypeCheck(filePath: unknown, projectDir: unknown, config?: TypeCheckConfig): TypeCheckResult;
30
- export declare function formatTypeCheckWarning(result: TypeCheckResult): string;
30
+ export declare function formatTypeCheckWarning(result: TypeCheckResult | unknown): string;
31
31
  //# sourceMappingURL=typecheck-gate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typecheck-gate.d.ts","sourceRoot":"","sources":["../../src/hooks/typecheck-gate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,WAAW,EAA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,EAAE,OAAO,GAAG,OAAO,CAY5D;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,EACnB,MAAM,CAAC,EAAE,eAAe,GACvB,eAAe,CAiCjB;AAsCD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,GAAG,MAAM,CAgBhF"}
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 result.findings) {
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)}...`);
@@ -4364,6 +4383,22 @@ function formatAutoFormatLog(result) {
4364
4383
  import * as fs6 from "fs";
4365
4384
  import * as path6 from "path";
4366
4385
  import { execSync as execSync3 } from "child_process";
4386
+ function normalizeTypeCheckResult(result) {
4387
+ if (!result || typeof result !== "object") {
4388
+ return { clean: true, errors: [], checkedFile: "" };
4389
+ }
4390
+ const raw = result;
4391
+ const errors = Array.isArray(raw.errors) ? raw.errors.filter((item) => !!item && typeof item === "object").map((item) => ({
4392
+ file: typeof item.file === "string" ? item.file : "",
4393
+ line: typeof item.line === "number" ? item.line : 0,
4394
+ column: typeof item.column === "number" ? item.column : 0,
4395
+ code: typeof item.code === "string" ? item.code : "TS0000",
4396
+ message: typeof item.message === "string" ? item.message : "Unknown typecheck error"
4397
+ })) : [];
4398
+ const checkedFile = typeof raw.checkedFile === "string" ? raw.checkedFile : "";
4399
+ const clean = typeof raw.clean === "boolean" ? raw.clean : errors.length === 0;
4400
+ return { clean, errors, checkedFile };
4401
+ }
4367
4402
  var TS_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
4368
4403
  function isTypeScriptFile(filePath) {
4369
4404
  if (typeof filePath !== "string")
@@ -4443,15 +4478,16 @@ function parseTscOutput(output, filterFile) {
4443
4478
  return diagnostics;
4444
4479
  }
4445
4480
  function formatTypeCheckWarning(result) {
4446
- if (result.clean) {
4447
- return `[CliKit:typecheck] ${result.checkedFile} \u2014 no type errors`;
4481
+ const safeResult = normalizeTypeCheckResult(result);
4482
+ if (safeResult.clean) {
4483
+ return `[CliKit:typecheck] ${safeResult.checkedFile} \u2014 no type errors`;
4448
4484
  }
4449
- const lines = [`[CliKit:typecheck] ${result.errors.length} type error(s) in ${result.checkedFile}:`];
4450
- for (const err of result.errors.slice(0, 10)) {
4485
+ const lines = [`[CliKit:typecheck] ${safeResult.errors.length} type error(s) in ${safeResult.checkedFile}:`];
4486
+ for (const err of safeResult.errors.slice(0, 10)) {
4451
4487
  lines.push(` ${err.file}:${err.line}:${err.column} ${err.code}: ${err.message}`);
4452
4488
  }
4453
- if (result.errors.length > 10) {
4454
- lines.push(` ... and ${result.errors.length - 10} more`);
4489
+ if (safeResult.errors.length > 10) {
4490
+ lines.push(` ... and ${safeResult.errors.length - 10} more`);
4455
4491
  }
4456
4492
  return lines.join(`
4457
4493
  `);
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clikit-plugin",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
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.1",
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": {