kodingo-cli 1.1.6 → 1.1.8

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.
@@ -41,16 +41,13 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  return result;
42
42
  };
43
43
  })();
44
- var __importDefault = (this && this.__importDefault) || function (mod) {
45
- return (mod && mod.__esModule) ? mod : { "default": mod };
46
- };
47
44
  Object.defineProperty(exports, "__esModule", { value: true });
48
45
  exports.registerInitCommand = registerInitCommand;
49
46
  const readline = __importStar(require("node:readline"));
50
47
  const fs = __importStar(require("fs"));
51
48
  const path = __importStar(require("path"));
52
49
  const os = __importStar(require("os"));
53
- const open_1 = __importDefault(require("open"));
50
+ // open is imported dynamically to avoid ESM/CJS compatibility issues on Windows
54
51
  const persistence_config_1 = require("../utils/persistence-config");
55
52
  const API_BASE = "https://kodingo-api.onrender.com";
56
53
  const APP_URL = "https://kodingo.xyz";
@@ -140,7 +137,8 @@ async function browserLogin(rl) {
140
137
  });
141
138
  // Open browser
142
139
  try {
143
- await (0, open_1.default)(loginUrl);
140
+ const { default: open } = await Promise.resolve().then(() => __importStar(require("open")));
141
+ await open(loginUrl);
144
142
  }
145
143
  catch { }
146
144
  console.log("Waiting for login...");
@@ -136,19 +136,29 @@ async function securityScanCommand(options = {}) {
136
136
  console.log(" ✔ No suspicious patterns detected.");
137
137
  }
138
138
  else {
139
- const codeScanRes = await fetch(`${apiUrl}/security/scan-code`, {
140
- method: "POST",
141
- headers: { "Content-Type": "application/json", "X-Kodingo-Token": token },
142
- body: JSON.stringify({ repo: repoName, candidates }),
143
- });
144
- if (codeScanRes.ok) {
145
- const codeResult = await codeScanRes.json();
146
- if (!options.silent) {
147
- console.log(` Checked ${codeResult.scanned} candidates — ${codeResult.findingsCreated} confirmed, ${codeResult.dismissed} dismissed as false positives after review\n`);
139
+ const BATCH_SIZE = 20;
140
+ let totalScanned = 0, totalFindings = 0, totalDismissed = 0;
141
+ for (let i = 0; i < candidates.length; i += BATCH_SIZE) {
142
+ const batch = candidates.slice(i, i + BATCH_SIZE);
143
+ const codeScanRes = await fetch(`${apiUrl}/security/scan-code`, {
144
+ method: "POST",
145
+ headers: { "Content-Type": "application/json", "X-Kodingo-Token": token },
146
+ body: JSON.stringify({ repo: repoName, candidates: batch }),
147
+ });
148
+ if (codeScanRes.ok) {
149
+ const codeResult = await codeScanRes.json();
150
+ totalScanned += codeResult.scanned;
151
+ totalFindings += codeResult.findingsCreated;
152
+ totalDismissed += codeResult.dismissed;
153
+ }
154
+ else if (!options.silent) {
155
+ console.error(` ✖ Code analysis batch failed: ${codeScanRes.status}`);
156
+ break;
148
157
  }
149
158
  }
150
- else if (!options.silent) {
151
- console.error(` ✖ Code analysis failed: ${codeScanRes.status}`);
159
+ if (!options.silent && totalScanned > 0) {
160
+ console.log(` Checked ${totalScanned} candidates — ${totalFindings} confirmed, ${totalDismissed} dismissed after review
161
+ `);
152
162
  }
153
163
  }
154
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,