@optiqcode/cli 2.1.5 → 2.1.7
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/commands/index.js +2 -2
- package/dist/index.js +10 -8
- package/package.json +1 -1
package/dist/commands/index.js
CHANGED
|
@@ -74,8 +74,8 @@ export async function index(options) {
|
|
|
74
74
|
spinner.text = 'Indexing with Optiq Engine...';
|
|
75
75
|
// Generate repository ID from path
|
|
76
76
|
const repoId = generateRepoId(targetPath);
|
|
77
|
-
// Batch upload files (
|
|
78
|
-
const BATCH_SIZE =
|
|
77
|
+
// Batch upload files (3 at a time to avoid Cloudflare gateway timeouts)
|
|
78
|
+
const BATCH_SIZE = 3;
|
|
79
79
|
let uploadedCount = 0;
|
|
80
80
|
let totalChunksCreated = 0;
|
|
81
81
|
for (let i = 0; i < fileContents.length; i += BATCH_SIZE) {
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ async function showBanner() {
|
|
|
32
32
|
|_| |_|
|
|
33
33
|
`));
|
|
34
34
|
console.log(chalk.gray(' AI-powered code indexing & search'));
|
|
35
|
-
console.log(chalk.gray(' v2.
|
|
35
|
+
console.log(chalk.gray(' v2.1.6\n'));
|
|
36
36
|
}
|
|
37
37
|
function showHelp() {
|
|
38
38
|
console.log(chalk.cyan.bold('Optiq CLI') + chalk.gray(' - AI-powered code indexing\n'));
|
|
@@ -298,8 +298,8 @@ async function indexOnce(targetPath, config) {
|
|
|
298
298
|
}
|
|
299
299
|
// Generate repository ID from path
|
|
300
300
|
const repoId = generateRepoId(targetPath);
|
|
301
|
-
// Upload in small batches to avoid gateway timeouts
|
|
302
|
-
const BATCH_SIZE =
|
|
301
|
+
// Upload in small batches to avoid Cloudflare gateway timeouts
|
|
302
|
+
const BATCH_SIZE = 3;
|
|
303
303
|
let totalChunks = 0;
|
|
304
304
|
if (DEBUG) {
|
|
305
305
|
console.log(chalk.gray(`\n[DEBUG] Sending to: ${ENGINE_URL}/api/v1/index`));
|
|
@@ -341,13 +341,15 @@ async function indexOnce(targetPath, config) {
|
|
|
341
341
|
catch (err) {
|
|
342
342
|
lastError = err;
|
|
343
343
|
retries--;
|
|
344
|
-
//
|
|
344
|
+
// Stop spinner to show error clearly
|
|
345
|
+
spinner.stop();
|
|
345
346
|
console.log(chalk.red(`\n✗ Batch ${batchNum} failed: ${err.code || err.message}`));
|
|
346
|
-
console.log(chalk.yellow(` Files
|
|
347
|
+
console.log(chalk.yellow(` Files: ${batch.map(f => f.path).join(', ')}`));
|
|
347
348
|
console.log(chalk.gray(` Sizes: ${batch.map(f => `${f.path}(${Math.round(f.content.length / 1024)}KB)`).join(', ')}`));
|
|
348
349
|
if (retries > 0) {
|
|
349
|
-
console.log(chalk.gray(` Retrying... (${retries} left)`));
|
|
350
|
+
console.log(chalk.gray(` Retrying... (${retries} left)\n`));
|
|
350
351
|
await new Promise(r => setTimeout(r, 2000));
|
|
352
|
+
spinner.start(`Retrying batch ${batchNum}...`);
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
}
|
|
@@ -399,8 +401,8 @@ async function watchDirectory(targetPath, config) {
|
|
|
399
401
|
}
|
|
400
402
|
spinner.text = `Reading... ${Math.min(i + PARALLEL_READS, files.length)}/${files.length}`;
|
|
401
403
|
}
|
|
402
|
-
// Upload in small batches to avoid gateway timeouts
|
|
403
|
-
const BATCH_SIZE =
|
|
404
|
+
// Upload in small batches to avoid Cloudflare gateway timeouts
|
|
405
|
+
const BATCH_SIZE = 3;
|
|
404
406
|
for (let i = 0; i < filesArray.length; i += BATCH_SIZE) {
|
|
405
407
|
const batch = filesArray.slice(i, i + BATCH_SIZE);
|
|
406
408
|
const batchNum = Math.floor(i / BATCH_SIZE) + 1;
|